refac
This commit is contained in:
1 parent
fd07e3a8e3
commit
9281adc564
5 files changed
+85
-74
No files matched your search
@@ -119,7 +119,11 @@ async def _verify_knowledge_file_access(
|
|||||||
PAGE_ITEM_COUNT = 30
|
PAGE_ITEM_COUNT = 30
|
||||||
|
|
||||||
|
|
||||||
@router.get('/list', response_model=ModelAccessListResponse) # do NOT use "/" as path, conflicts with main.py
|
@router.get(
|
||||||
|
'/list',
|
||||||
|
response_model=ModelAccessListResponse,
|
||||||
|
response_model_exclude={'items': {'__all__': {'meta': {'profile_image_url'}}}},
|
||||||
|
) # do NOT use "/" as path, conflicts with main.py
|
||||||
async def get_models(
|
async def get_models(
|
||||||
query: str | None = None,
|
query: str | None = None,
|
||||||
view_option: str | None = None,
|
view_option: str | None = None,
|
||||||
@@ -415,7 +419,10 @@ async def import_models(
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# Update existing model
|
# Update existing model
|
||||||
model_data['meta'] = model_data.get('meta', {})
|
model_data['meta'] = {
|
||||||
|
**existing_model.meta.model_dump(),
|
||||||
|
**(model_data.get('meta') or {}),
|
||||||
|
}
|
||||||
model_data['params'] = model_data.get('params', {})
|
model_data['params'] = model_data.get('params', {})
|
||||||
|
|
||||||
updated_model = ModelForm(**{**existing_model.model_dump(), **model_data})
|
updated_model = ModelForm(**{**existing_model.model_dump(), **model_data})
|
||||||
|
|||||||
@@ -7,12 +7,13 @@
|
|||||||
import { onMount, onDestroy, getContext, tick } from 'svelte';
|
import { onMount, onDestroy, getContext, tick } from 'svelte';
|
||||||
const i18n = getContext('i18n');
|
const i18n = getContext('i18n');
|
||||||
|
|
||||||
import { config, models as _models, settings, user } from '$lib/stores';
|
import { config, models as _models, settings, showSettings, user } from '$lib/stores';
|
||||||
import {
|
import {
|
||||||
createNewModel,
|
createNewModel,
|
||||||
deleteAllModels,
|
deleteAllModels,
|
||||||
getBaseModelTags,
|
getBaseModelTags,
|
||||||
getBaseModels,
|
getBaseModels,
|
||||||
|
getModelById,
|
||||||
toggleModelById,
|
toggleModelById,
|
||||||
updateModelById,
|
updateModelById,
|
||||||
updateModelAccessGrants,
|
updateModelAccessGrants,
|
||||||
@@ -228,6 +229,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const downloadModels = async (models) => {
|
const downloadModels = async (models) => {
|
||||||
|
models = await Promise.all(models.map(getFullModel));
|
||||||
let blob = new Blob([JSON.stringify(models)], {
|
let blob = new Blob([JSON.stringify(models)], {
|
||||||
type: 'application/json'
|
type: 'application/json'
|
||||||
});
|
});
|
||||||
@@ -483,22 +485,30 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const hideModelHandler = async (model) => {
|
const hideModelHandler = async (model) => {
|
||||||
model.meta = {
|
const updatedModel = {
|
||||||
...model.meta,
|
...model,
|
||||||
hidden: !(model?.meta?.hidden ?? false)
|
meta: {
|
||||||
|
...model.meta,
|
||||||
|
hidden: !(model?.meta?.hidden ?? false)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.debug(model);
|
await upsertModelHandler(updatedModel, { meta: updatedModel.meta }, false);
|
||||||
|
models = models.map((model) => (model.id === updatedModel.id ? updatedModel : model));
|
||||||
upsertModelHandler(model, { meta: model.meta }, false);
|
_models.set(
|
||||||
|
await getModels(
|
||||||
|
localStorage.token,
|
||||||
|
$config?.features?.enable_direct_connections && ($settings?.directConnections ?? null)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
toast.success(
|
toast.success(
|
||||||
model.meta.hidden
|
updatedModel.meta.hidden
|
||||||
? $i18n.t(`Model {{name}} is now hidden`, {
|
? $i18n.t(`Model {{name}} is now hidden`, {
|
||||||
name: model.id
|
name: updatedModel.id
|
||||||
})
|
})
|
||||||
: $i18n.t(`Model {{name}} is now visible`, {
|
: $i18n.t(`Model {{name}} is now visible`, {
|
||||||
name: model.id
|
name: updatedModel.id
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -551,17 +561,25 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getFullModel = async (model) =>
|
||||||
|
workspaceModels.some((workspaceModel) => workspaceModel.id === model.id)
|
||||||
|
? ((await getModelById(localStorage.token, model.id).catch(() => null)) ?? model)
|
||||||
|
: model;
|
||||||
|
|
||||||
const cloneHandler = async (model) => {
|
const cloneHandler = async (model) => {
|
||||||
|
model = await getFullModel(model);
|
||||||
sessionStorage.model = JSON.stringify({
|
sessionStorage.model = JSON.stringify({
|
||||||
...model,
|
...model,
|
||||||
base_model_id: model.id,
|
base_model_id: model.id,
|
||||||
id: `${model.id}-clone`,
|
id: `${model.id}-clone`,
|
||||||
name: `${model.name} (Clone)`
|
name: `${model.name} (Clone)`
|
||||||
});
|
});
|
||||||
goto('/workspace/models/create');
|
showSettings.set(false);
|
||||||
|
await goto('/workspace/models/create');
|
||||||
};
|
};
|
||||||
|
|
||||||
const exportModelHandler = async (model) => {
|
const exportModelHandler = async (model) => {
|
||||||
|
model = await getFullModel(model);
|
||||||
let blob = new Blob([JSON.stringify([model])], {
|
let blob = new Blob([JSON.stringify([model])], {
|
||||||
type: 'application/json'
|
type: 'application/json'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -41,6 +41,11 @@
|
|||||||
|
|
||||||
let show = false;
|
let show = false;
|
||||||
|
|
||||||
|
const runAndClose = async (handler: Function) => {
|
||||||
|
show = false;
|
||||||
|
await handler();
|
||||||
|
};
|
||||||
|
|
||||||
const isPublicModel = (model) =>
|
const isPublicModel = (model) =>
|
||||||
(model?.access_grants ?? []).some(
|
(model?.access_grants ?? []).some(
|
||||||
(g) => g.principal_type === 'user' && g.principal_id === '*' && g.permission === 'read'
|
(g) => g.principal_type === 'user' && g.principal_id === '*' && g.permission === 'read'
|
||||||
@@ -63,9 +68,7 @@
|
|||||||
<DropdownMenu className="min-w-[170px]">
|
<DropdownMenu className="min-w-[170px]">
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(hideHandler)}
|
||||||
hideHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if model?.meta?.hidden ?? false}
|
{#if model?.meta?.hidden ?? false}
|
||||||
<svg
|
<svg
|
||||||
@@ -115,10 +118,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={async () => {
|
on:click={() => runAndClose(defaultSelectedHandler)}
|
||||||
show = false;
|
|
||||||
await defaultSelectedHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Check className="size-3.5" />
|
<Check className="size-3.5" />
|
||||||
|
|
||||||
@@ -133,10 +133,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={async () => {
|
on:click={() => runAndClose(defaultPinnedHandler)}
|
||||||
show = false;
|
|
||||||
await defaultPinnedHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if isDefaultPinned}
|
{#if isDefaultPinned}
|
||||||
<PinSlash className="size-3.5" />
|
<PinSlash className="size-3.5" />
|
||||||
@@ -155,9 +152,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(privacyHandler)}
|
||||||
privacyHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if isPublicModel(model)}
|
{#if isPublicModel(model)}
|
||||||
<LockClosed className="size-3.5" />
|
<LockClosed className="size-3.5" />
|
||||||
@@ -176,9 +171,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(() => pinModelHandler(model?.id))}
|
||||||
pinModelHandler(model?.id);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if ($settings?.pinnedModels ?? []).includes(model?.id)}
|
{#if ($settings?.pinnedModels ?? []).includes(model?.id)}
|
||||||
<PinSlash />
|
<PinSlash />
|
||||||
@@ -197,9 +190,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(copyLinkHandler)}
|
||||||
copyLinkHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Link />
|
<Link />
|
||||||
|
|
||||||
@@ -209,9 +200,7 @@
|
|||||||
{#if model?.is_active ?? true}
|
{#if model?.is_active ?? true}
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(cloneHandler)}
|
||||||
cloneHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<DocumentDuplicate />
|
<DocumentDuplicate />
|
||||||
|
|
||||||
@@ -221,9 +210,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
class="select-none flex w-full gap-2 items-center h-[1.6875rem] px-2 text-[13px] font-normal cursor-pointer hover:bg-gray-50/40 dark:hover:bg-gray-800/40 rounded-xl"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(exportHandler)}
|
||||||
exportHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Download />
|
<Download />
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
import {
|
import {
|
||||||
createNewModel,
|
createNewModel,
|
||||||
deleteModelById,
|
deleteModelById,
|
||||||
|
getModelById,
|
||||||
getModelItems as getWorkspaceModels,
|
getModelItems as getWorkspaceModels,
|
||||||
getModelTags,
|
getModelTags,
|
||||||
toggleModelById,
|
toggleModelById,
|
||||||
@@ -196,7 +197,11 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getFullModel = async (model) =>
|
||||||
|
(await getModelById(localStorage.token, model.id).catch(() => null)) ?? model;
|
||||||
|
|
||||||
const cloneModelHandler = async (model) => {
|
const cloneModelHandler = async (model) => {
|
||||||
|
model = await getFullModel(model);
|
||||||
sessionStorage.model = JSON.stringify({
|
sessionStorage.model = JSON.stringify({
|
||||||
...model,
|
...model,
|
||||||
id: `${model.id}-clone`,
|
id: `${model.id}-clone`,
|
||||||
@@ -209,13 +214,14 @@
|
|||||||
toast.success($i18n.t('Redirecting you to Open WebUI Community'));
|
toast.success($i18n.t('Redirecting you to Open WebUI Community'));
|
||||||
|
|
||||||
const url = 'https://openwebui.com';
|
const url = 'https://openwebui.com';
|
||||||
|
const fullModel = getFullModel(model);
|
||||||
|
|
||||||
const tab = await window.open(`${url}/post?type=model`, '_blank');
|
const tab = await window.open(`${url}/post?type=model`, '_blank');
|
||||||
|
|
||||||
const messageHandler = (event) => {
|
const messageHandler = async (event) => {
|
||||||
if (event.origin !== url) return;
|
if (event.origin !== url) return;
|
||||||
if (event.data === 'loaded') {
|
if (event.data === 'loaded') {
|
||||||
tab.postMessage(JSON.stringify(model), '*');
|
tab.postMessage(JSON.stringify(await fullModel), '*');
|
||||||
window.removeEventListener('message', messageHandler);
|
window.removeEventListener('message', messageHandler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -224,25 +230,27 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const hideModelHandler = async (model) => {
|
const hideModelHandler = async (model) => {
|
||||||
model.meta = {
|
const updatedModel = {
|
||||||
...model.meta,
|
...model,
|
||||||
hidden: !(model?.meta?.hidden ?? false)
|
meta: {
|
||||||
|
...model.meta,
|
||||||
|
hidden: !(model?.meta?.hidden ?? false)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(model);
|
const res = await updateModelById(localStorage.token, updatedModel.id, updatedModel);
|
||||||
|
|
||||||
const res = await updateModelById(localStorage.token, model.id, model);
|
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
models = models.map((model) => (model.id === updatedModel.id ? updatedModel : model));
|
||||||
toast.success(
|
toast.success(
|
||||||
$i18n.t(`Model {{name}} is now {{status}}`, {
|
$i18n.t(`Model {{name}} is now {{status}}`, {
|
||||||
name: model.id,
|
name: updatedModel.id,
|
||||||
status: model.meta.hidden ? 'hidden' : 'visible'
|
status: updatedModel.meta.hidden ? 'hidden' : 'visible'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
page = 1;
|
page = 1;
|
||||||
getModelList();
|
await getModelList();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _models.set(
|
await _models.set(
|
||||||
@@ -265,6 +273,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const downloadModels = async (models) => {
|
const downloadModels = async (models) => {
|
||||||
|
models = await Promise.all(models.map(getFullModel));
|
||||||
let blob = new Blob([JSON.stringify(models)], {
|
let blob = new Blob([JSON.stringify(models)], {
|
||||||
type: 'application/json'
|
type: 'application/json'
|
||||||
});
|
});
|
||||||
@@ -272,6 +281,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const exportModelHandler = async (model) => {
|
const exportModelHandler = async (model) => {
|
||||||
|
model = await getFullModel(model);
|
||||||
let blob = new Blob([JSON.stringify([model])], {
|
let blob = new Blob([JSON.stringify([model])], {
|
||||||
type: 'application/json'
|
type: 'application/json'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,6 +37,11 @@
|
|||||||
export let writeAccess: boolean = true;
|
export let writeAccess: boolean = true;
|
||||||
|
|
||||||
let show = false;
|
let show = false;
|
||||||
|
|
||||||
|
const runAndClose = async (handler: Function) => {
|
||||||
|
show = false;
|
||||||
|
await handler();
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Dropdown
|
<Dropdown
|
||||||
@@ -63,9 +68,7 @@
|
|||||||
{#if writeAccess}
|
{#if writeAccess}
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(editHandler)}
|
||||||
editHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Pencil />
|
<Pencil />
|
||||||
<div class="flex items-center">{$i18n.t('Edit')}</div>
|
<div class="flex items-center">{$i18n.t('Edit')}</div>
|
||||||
@@ -75,9 +78,7 @@
|
|||||||
{#if writeAccess}
|
{#if writeAccess}
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(hideHandler)}
|
||||||
hideHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if model?.meta?.hidden ?? false}
|
{#if model?.meta?.hidden ?? false}
|
||||||
<svg
|
<svg
|
||||||
@@ -128,9 +129,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(() => pinModelHandler(model?.id))}
|
||||||
pinModelHandler(model?.id);
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
{#if ($settings?.pinnedModels ?? []).includes(model?.id)}
|
{#if ($settings?.pinnedModels ?? []).includes(model?.id)}
|
||||||
<PinSlash />
|
<PinSlash />
|
||||||
@@ -150,9 +149,7 @@
|
|||||||
{#if writeAccess}
|
{#if writeAccess}
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(cloneHandler)}
|
||||||
cloneHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<DocumentDuplicate />
|
<DocumentDuplicate />
|
||||||
|
|
||||||
@@ -166,9 +163,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(copyLinkHandler)}
|
||||||
copyLinkHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Link />
|
<Link />
|
||||||
|
|
||||||
@@ -178,9 +173,7 @@
|
|||||||
{#if writeAccess && ($currentUser?.role === 'admin' || $currentUser?.permissions?.workspace?.models_export)}
|
{#if writeAccess && ($currentUser?.role === 'admin' || $currentUser?.permissions?.workspace?.models_export)}
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(exportHandler)}
|
||||||
exportHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Download />
|
<Download />
|
||||||
|
|
||||||
@@ -191,9 +184,7 @@
|
|||||||
{#if writeAccess && $config?.features.enable_community_sharing}
|
{#if writeAccess && $config?.features.enable_community_sharing}
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(shareHandler)}
|
||||||
shareHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Share />
|
<Share />
|
||||||
<div class="flex items-center">{$i18n.t('Share')}</div>
|
<div class="flex items-center">{$i18n.t('Share')}</div>
|
||||||
@@ -205,9 +196,7 @@
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
class="select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-[13px] hover:text-gray-900 dark:hover:text-gray-100"
|
||||||
on:click={() => {
|
on:click={() => runAndClose(deleteHandler)}
|
||||||
deleteHandler();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<GarbageBin />
|
<GarbageBin />
|
||||||
<div class="flex items-center">{$i18n.t('Delete')}</div>
|
<div class="flex items-center">{$i18n.t('Delete')}</div>
|
||||||
|
|||||||
Reference in new issue
Block a user