Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,373 changes: 0 additions & 1,373 deletions dashboard/src/assets/mdi-subset/materialdesignicons-subset.css

This file was deleted.

Binary file not shown.
Binary file not shown.
34 changes: 34 additions & 0 deletions dashboard/src/components/shared/ExtensionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const props = defineProps({
type: Boolean,
default: false,
},
selectable: {
type: Boolean,
default: false,
},
selected: {
type: Boolean,
default: false,
},
});

// 定义要发送到父组件的事件
Expand All @@ -39,6 +47,7 @@ const emit = defineEmits([
"view-changelog",
"toggle-pin",
"open-webui",
"select",
]);

const hasPages = computed(() => {
Expand Down Expand Up @@ -149,6 +158,7 @@ const openWebui = () => {
height="100%"
:ripple="false"
variant="outlined"
:class="{ 'extension-card--selected': selectable && selected }"
:style="{
position: 'relative',
backgroundColor:
Expand Down Expand Up @@ -231,6 +241,15 @@ const openWebui = () => {
</p>

<template v-if="!marketMode">
<v-checkbox
:model-value="selected"
density="compact"
hide-details
color="primary"
class="extension-checkbox-inline"
@click.stop="emit('select')"
Comment on lines +244 to +250

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Clicking the checkbox will likely emit the select event twice, causing a double-toggle.

Because the checkbox uses both @click.stop="emit('select')" and @update:model-value="emit('select')", a single user click will invoke emit('select') twice in Vuetify (once for each handler), which cancels the parent’s toggle logic. Removing one handler—ideally keeping only @update:model-value for state changes—will avoid the double emission.

@update:model-value="emit('select')"
/>
Comment on lines +244 to +252

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

v-checkbox 上同时绑定了 @click.stop="emit('select')"@update:model-value="emit('select')"。当用户点击复选框时,这两个事件都会被触发,导致 select 事件被发送两次。由于 togglePluginSelection 是通过取反(Set 的 add/delete)来切换选中状态的,触发两次会导致选中状态保持不变或表现异常。\n\n建议将 @click.stop 修改为仅阻止事件冒泡,而不触发 emit,让 @update:model-value 统一处理选中状态的更新。

              <v-checkbox\n                :model-value="selected"\n                density="compact"\n                hide-details\n                color="primary"\n                class="extension-checkbox-inline"\n                @click.stop\n                @update:model-value="emit('select')"\n              />

<v-tooltip location="left">
<template v-slot:activator="{ props: tooltipProps }">
<div class="extension-switch-wrap" @click.stop>
Expand Down Expand Up @@ -425,6 +444,21 @@ const openWebui = () => {
cursor: pointer;
}

.extension-card--selected {
border-color: rgb(var(--v-theme-primary)) !important;
border-width: 2px;
}

.extension-checkbox-inline {
flex-shrink: 0;
margin-right: 4px;
}

.extension-checkbox-inline :deep(.v-switch),
.extension-checkbox-inline :deep(.v-selection-control) {
min-height: 0;
}

.extension-image-container {
display: flex;
align-items: flex-start;
Expand Down
25 changes: 25 additions & 0 deletions dashboard/src/i18n/locales/en-US/features/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,37 @@
"author": "Author",
"updated": "Last Updated",
"updateStatus": "Update Status",
"activated": "Status (Enabled/Disabled)",
"ascending": "Ascending",
"descending": "Descending"
},
"tags": {
"danger": "Danger"
},
"batch": {
"select": "Select",
"exitSelect": "Exit Select",
"selectedCount": "{count} selected",
"selectAll": "Select All",
"deselectAll": "Deselect All",
"invertSelection": "Invert",
"enable": "Enable",
"disable": "Disable",
"uninstall": "Uninstall",
"confirmTitle": {
"enable": "Batch Enable",
"disable": "Batch Disable",
"uninstall": "Batch Uninstall"
},
"confirmMessage": "Are you sure you want to {operation} {count} plugin(s)?",
"confirmAction": "Confirm",
"reservedSkipped": "{count} system plugin(s) will be skipped.",
"results": {
"title": "Batch Operation Results",
"summary": "{succeeded} succeeded, {failed} failed.",
"failedList": "Failed plugins:"
}
},
"dialogs": {
"error": {
"title": "Error Information",
Expand Down
25 changes: 25 additions & 0 deletions dashboard/src/i18n/locales/ru-RU/features/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,37 @@
"author": "Автору",
"updated": "Дате обновления",
"updateStatus": "Статусу обновления",
"activated": "Статус (Включен/Выключен)",
"ascending": "По возрастанию",
"descending": "По убыванию"
},
"tags": {
"danger": "Опасно"
},
"batch": {
"select": "Выбрать",
"exitSelect": "Отменить выбор",
"selectedCount": "Выбрано: {count}",
"selectAll": "Выбрать все",
"deselectAll": "Снять выбор",
"invertSelection": "Инвертировать",
"enable": "Включить",
"disable": "Выключить",
"uninstall": "Удалить",
"confirmTitle": {
"enable": "Включить выбранные",
"disable": "Выключить выбранные",
"uninstall": "Удалить выбранные"
},
"confirmMessage": "Вы уверены, что хотите {operation} {count} плагин(ов)?",
"confirmAction": "Подтвердить",
"reservedSkipped": "{count} системных плагинов будут пропущены.",
"results": {
"title": "Результаты массовой операции",
"summary": "{succeeded} успешно, {failed} с ошибками.",
"failedList": "Ошибки:"
}
},
"dialogs": {
"error": {
"title": "Ошибка",
Expand Down
25 changes: 25 additions & 0 deletions dashboard/src/i18n/locales/zh-CN/features/extension.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,37 @@
"author": "作者名",
"updated": "更新时间",
"updateStatus": "更新状态",
"activated": "状态(启用/禁用)",
"ascending": "升序",
"descending": "降序"
},
"tags": {
"danger": "危险"
},
"batch": {
"select": "多选",
"exitSelect": "退出多选",
"selectedCount": "已选择 {count} 个",
"selectAll": "全选",
"deselectAll": "取消全选",
"invertSelection": "反选",
"enable": "批量启用",
"disable": "批量禁用",
"uninstall": "批量卸载",
"confirmTitle": {
"enable": "批量启用",
"disable": "批量禁用",
"uninstall": "批量卸载"
},
"confirmMessage": "确定要{operation} {count} 个插件吗?",
"confirmAction": "确认",
"reservedSkipped": "{count} 个系统插件将被跳过。",
"results": {
"title": "批量操作结果",
"summary": "{succeeded} 个成功,{failed} 个失败。",
"failedList": "失败的插件:"
}
},
"dialogs": {
"error": {
"title": "错误信息",
Expand Down
Loading
Loading