mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Show logs and usernames for deleted users and remove svg mimetype for client side
This commit is contained in:
@@ -83,6 +83,7 @@ export interface ChangeLog {
|
||||
id: string;
|
||||
website_id: string | null;
|
||||
user_id: string | null;
|
||||
username: string;
|
||||
tstamp: Date;
|
||||
table_name: string;
|
||||
operation: string;
|
||||
@@ -93,6 +94,7 @@ export interface ChangeLogInput {
|
||||
id?: string;
|
||||
website_id?: string | null;
|
||||
user_id?: string | null;
|
||||
username?: string;
|
||||
tstamp?: Date;
|
||||
table_name: string;
|
||||
operation: string;
|
||||
@@ -105,6 +107,7 @@ const change_log = {
|
||||
"id",
|
||||
"website_id",
|
||||
"user_id",
|
||||
"username",
|
||||
"tstamp",
|
||||
"table_name",
|
||||
"operation",
|
||||
@@ -320,7 +323,7 @@ const legal_information = {
|
||||
export interface Media {
|
||||
id: string;
|
||||
website_id: string;
|
||||
user_id: string;
|
||||
user_id: string | null;
|
||||
blob: string;
|
||||
mimetype: string;
|
||||
original_name: string;
|
||||
@@ -329,7 +332,7 @@ export interface Media {
|
||||
export interface MediaInput {
|
||||
id?: string;
|
||||
website_id: string;
|
||||
user_id?: string;
|
||||
user_id?: string | null;
|
||||
blob: string;
|
||||
mimetype: string;
|
||||
original_name: string;
|
||||
|
||||
@@ -15,7 +15,7 @@ import type {
|
||||
LegalInformation
|
||||
} from "$lib/db-schema";
|
||||
|
||||
export const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/svg+xml", "image/webp"];
|
||||
export const ALLOWED_MIME_TYPES = ["image/jpeg", "image/png", "image/webp"];
|
||||
|
||||
export const slugify = (string: string) => {
|
||||
return string
|
||||
|
||||
@@ -69,10 +69,10 @@
|
||||
</h2>
|
||||
|
||||
<ul class="unpadded">
|
||||
{#each data.collaborators as { website_id, user_id, permission_level, user: { username } } (`${website_id}-${user_id}`)}
|
||||
{#each data.collaborators as { website_id, user_id, permission_level, user } (`${website_id}-${user_id}`)}
|
||||
<li class="collaborator-card">
|
||||
<p>
|
||||
<strong>{username} ({permission_level})</strong>
|
||||
<strong>{user?.username} ({permission_level})</strong>
|
||||
</p>
|
||||
|
||||
<div class="collaborator-card__actions">
|
||||
|
||||
@@ -9,10 +9,10 @@ export const load: PageServerLoad = async ({ parent, fetch, params, cookies, url
|
||||
|
||||
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!inner(username)&order=tstamp.desc`;
|
||||
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 (userFilter && userFilter !== "all") {
|
||||
searchParams.append("user.username", `eq.${userFilter}`);
|
||||
searchParams.append("username", `eq.${userFilter}`);
|
||||
}
|
||||
|
||||
if (resourceFilter && resourceFilter !== "all") {
|
||||
|
||||
@@ -126,9 +126,13 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each data.changeLog as { id, table_name, operation, tstamp, old_value, new_value, user }}
|
||||
{#each data.changeLog as { id, table_name, operation, tstamp, old_value, new_value, user_id, username }}
|
||||
<tr>
|
||||
<td>{user.username}</td>
|
||||
<td>
|
||||
<span style:text-decoration={user_id ? "" : "line-through"}>
|
||||
{username}
|
||||
</span>
|
||||
</td>
|
||||
<td>{table_name}</td>
|
||||
<td>{operation}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user