mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add ability to export articles, track publications in json file on NGINX, fix vulnerabilities and refactor
This commit is contained in:
@@ -9,12 +9,17 @@ export const load: PageServerLoad = async ({ parent, fetch, params, url }) => {
|
||||
const resourceFilter = url.searchParams.get("resource");
|
||||
const operationFilter = url.searchParams.get("operation");
|
||||
const currentPage = Number.parseInt(url.searchParams.get("page") ?? "1");
|
||||
const sinceTime = url.searchParams.get("since");
|
||||
const resultOffset = (currentPage - 1) * PAGINATION_MAX_ITEMS;
|
||||
|
||||
const searchParams = new URLSearchParams();
|
||||
|
||||
const baseFetchUrl = `${API_BASE_PREFIX}/change_log?website_id=eq.${params.websiteId}&select=id,table_name,operation,tstamp,old_value,new_value,user_id,username&order=tstamp.desc`;
|
||||
|
||||
if (sinceTime) {
|
||||
searchParams.append("tstamp", `gt.${sinceTime}`);
|
||||
}
|
||||
|
||||
if (userFilter && userFilter !== "all") {
|
||||
searchParams.append("username", `eq.${userFilter}`);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
</select>
|
||||
</label>
|
||||
<input type="hidden" name="page" value={1} />
|
||||
<input type="hidden" name="since" value={$page.url.searchParams.get("since")} />
|
||||
<button type="submit">Apply</button>
|
||||
</form>
|
||||
</details>
|
||||
@@ -163,7 +164,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<Pagination
|
||||
commonFilters={["user", "resource", "operation"]}
|
||||
commonFilters={["user", "resource", "operation", "since"]}
|
||||
resultCount={data.resultChangeLogCount}
|
||||
/>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user