This commit is contained in:
Timothy Jaeryang Baek committed 2026-02-11 17:26:25 -06:00
1 parent 96c07f44a8
commit 97331bf11d
2 files changed
+17 -6

No files matched your search

+3 -4
View File
@@ -462,7 +462,7 @@
<div
class="flex transition rounded-2xl w-full p-2.5 {model.write_access
? 'cursor-pointer dark:hover:bg-gray-850/50 hover:bg-gray-50'
: 'cursor-not-allowed opacity-60'}"
: 'dark:hover:bg-gray-850/50 hover:bg-gray-50'}"
id="model-item-{model.id}"
on:click={() => {
if (model.write_access) {
@@ -507,10 +507,9 @@
</div>
{/if}
{#if model.write_access || $user?.role === 'admin'}
<div class="flex {model.is_active ? '' : 'text-gray-500'}">
<div class="flex items-center gap-0.5">
{#if shiftKey}
{#if shiftKey && model.write_access}
<Tooltip
content={model?.meta?.hidden
? $i18n.t('Show')
@@ -548,6 +547,7 @@
<ModelMenu
user={$user}
{model}
writeAccess={model.write_access}
editHandler={() => {
goto(
`/workspace/models/edit?id=${encodeURIComponent(model.id)}`
@@ -586,7 +586,6 @@
{/if}
</div>
</div>
{/if}
{#if model.write_access}
<button
@@ -35,6 +35,8 @@
export let deleteHandler: Function;
export let onClose: Function;
export let writeAccess: boolean = true;
let show = false;
</script>
@@ -65,6 +67,7 @@
align="start"
transition={flyAndScale}
>
{#if writeAccess}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
@@ -74,7 +77,9 @@
<Pencil />
<div class="flex items-center">{$i18n.t('Edit')}</div>
</DropdownMenu.Item>
{/if}
{#if writeAccess}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
@@ -126,6 +131,7 @@
{/if}
</div>
</DropdownMenu.Item>
{/if}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
@@ -148,6 +154,7 @@
</div>
</DropdownMenu.Item>
{#if writeAccess}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
@@ -158,8 +165,11 @@
<div class="flex items-center">{$i18n.t('Clone')}</div>
</DropdownMenu.Item>
{/if}
{#if writeAccess}
<hr class="border-gray-50/30 dark:border-gray-800/30 my-1" />
{/if}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
@@ -172,7 +182,7 @@
<div class="flex items-center">{$i18n.t('Copy Link')}</div>
</DropdownMenu.Item>
{#if $currentUser?.role === 'admin' || $currentUser?.permissions?.workspace?.models_export}
{#if writeAccess && ($currentUser?.role === 'admin' || $currentUser?.permissions?.workspace?.models_export)}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
@@ -185,7 +195,7 @@
</DropdownMenu.Item>
{/if}
{#if $config?.features.enable_community_sharing}
{#if writeAccess && $config?.features.enable_community_sharing}
<DropdownMenu.Item
class="flex gap-2 items-center px-3 py-1.5 text-sm cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-xl"
on:click={() => {
@@ -197,6 +207,7 @@
</DropdownMenu.Item>
{/if}
{#if writeAccess}
<hr class="border-gray-50/30 dark:border-gray-800/30 my-1" />
<DropdownMenu.Item
@@ -208,6 +219,7 @@
<GarbageBin />
<div class="flex items-center">{$i18n.t('Delete')}</div>
</DropdownMenu.Item>
{/if}
</DropdownMenu.Content>
</div>
</Dropdown>