diff --git a/package.v2.json b/package.v2.json index 0d2372c..9eb57aa 100644 --- a/package.v2.json +++ b/package.v2.json @@ -1048,13 +1048,14 @@ "name": "Agent Tokens 管理", "description": "管理多平台免费 Token 配额,按优先级自动切换 Agent LLM 供应商。", "labels": "Agent,AI,系统", - "version": "1.0.1", + "version": "1.0.2", "icon": "agentresourceofficer.png", "author": "jxxghp", "level": 1, "system_version": ">=2.13.0", "release": true, "history": { + "v1.0.2": "修复UI界面显示不全及前端路由报错问题", "v1.0.1": "新增 Agent Tokens 配额管理、供应商优先级切换和用量展示" } } diff --git a/plugins.v2/agenttokens/__init__.py b/plugins.v2/agenttokens/__init__.py index b3a0f5d..bc46ca3 100644 --- a/plugins.v2/agenttokens/__init__.py +++ b/plugins.v2/agenttokens/__init__.py @@ -24,7 +24,7 @@ class AgentTokens(_PluginBase): plugin_name = "Agent Tokens 管理" plugin_desc = "管理多平台免费 Token 配额,按优先级自动切换 Agent LLM 供应商。" plugin_icon = "agentresourceofficer.png" - plugin_version = "1.0.1" + plugin_version = "1.0.2" plugin_author = "jxxghp" author_url = "https://github.com/jxxghp" plugin_config_prefix = "agenttokens_" diff --git a/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CWiPD-TF.css b/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BjNAU01R.css similarity index 56% rename from plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CWiPD-TF.css rename to plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BjNAU01R.css index 82315f3..905cb1d 100644 --- a/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CWiPD-TF.css +++ b/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BjNAU01R.css @@ -1,15 +1,15 @@ -.agenttokens-page[data-v-37f144a0] { +.agenttokens-page[data-v-f613ca6c] { max-width: 1280px; margin: 0 auto; } -.gap-2[data-v-37f144a0] { +.gap-2[data-v-f613ca6c] { gap: 8px; } -.progress-cell[data-v-37f144a0] { +.progress-cell[data-v-f613ca6c] { min-width: 140px; } -.truncate-cell[data-v-37f144a0] { +.truncate-cell[data-v-f613ca6c] { max-width: 280px; overflow: hidden; text-overflow: ellipsis; diff --git a/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BniPA2RJ.js b/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CpDG627M.js similarity index 93% rename from plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BniPA2RJ.js rename to plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CpDG627M.js index 37e9448..5dbb84a 100644 --- a/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-BniPA2RJ.js +++ b/plugins.v2/agenttokens/dist/assets/__federation_expose_AppPage-CpDG627M.js @@ -1,22 +1,26 @@ import { importShared } from './__federation_fn_import-JrT3xvdd.js'; import { _ as _export_sfc } from './_plugin-vue_export-helper-pcqpp-6-.js'; -const {createElementVNode:_createElementVNode,resolveComponent:_resolveComponent,createVNode:_createVNode,createTextVNode:_createTextVNode,withCtx:_withCtx,toDisplayString:_toDisplayString,openBlock:_openBlock,createBlock:_createBlock,createCommentVNode:_createCommentVNode,renderList:_renderList,Fragment:_Fragment,createElementBlock:_createElementBlock} = await importShared('vue'); +const {openBlock:_openBlock,createElementBlock:_createElementBlock,createCommentVNode:_createCommentVNode,resolveComponent:_resolveComponent,createVNode:_createVNode,createTextVNode:_createTextVNode,withCtx:_withCtx,createElementVNode:_createElementVNode,toDisplayString:_toDisplayString,createBlock:_createBlock,renderList:_renderList,Fragment:_Fragment} = await importShared('vue'); const _hoisted_1 = { class: "agenttokens-page pa-4" }; const _hoisted_2 = { class: "d-flex align-center gap-2 mb-4 flex-wrap" }; -const _hoisted_3 = { class: "text-h5" }; +const _hoisted_3 = { + key: 0, + class: "text-h5 font-weight-medium" +}; const _hoisted_4 = { class: "text-h5" }; const _hoisted_5 = { class: "text-h5" }; -const _hoisted_6 = { class: "d-flex flex-column" }; -const _hoisted_7 = { class: "progress-cell" }; -const _hoisted_8 = { class: "text-right" }; -const _hoisted_9 = { key: 0 }; -const _hoisted_10 = { class: "d-flex justify-end mb-3 gap-2" }; -const _hoisted_11 = { class: "truncate-cell" }; -const _hoisted_12 = { class: "text-right" }; -const _hoisted_13 = { key: 0 }; +const _hoisted_6 = { class: "text-h5" }; +const _hoisted_7 = { class: "d-flex flex-column" }; +const _hoisted_8 = { class: "progress-cell" }; +const _hoisted_9 = { class: "text-right" }; +const _hoisted_10 = { key: 0 }; +const _hoisted_11 = { class: "d-flex justify-end mb-3 gap-2" }; +const _hoisted_12 = { class: "truncate-cell" }; +const _hoisted_13 = { class: "text-right" }; +const _hoisted_14 = { key: 0 }; const {computed,onMounted,ref} = await importShared('vue'); @@ -33,6 +37,10 @@ const _sfc_main = { type: String, default: 'AgentTokens', }, + hideTitle: { + type: Boolean, + default: false, + }, }, setup(__props) { @@ -221,7 +229,9 @@ return (_ctx, _cache) => { return (_openBlock(), _createElementBlock("div", _hoisted_1, [ _createElementVNode("div", _hoisted_2, [ - _cache[15] || (_cache[15] = _createElementVNode("div", { class: "text-h5 font-weight-medium" }, "Agent Tokens 管理", -1)), + (!__props.hideTitle) + ? (_openBlock(), _createElementBlock("div", _hoisted_3, "Agent Tokens 管理")) + : _createCommentVNode("", true), _createVNode(_component_VSpacer), _createVNode(_component_VBtn, { icon: "mdi-refresh", @@ -268,8 +278,8 @@ return (_ctx, _cache) => { class: "pa-4 h-100" }, { default: _withCtx(() => [ - _cache[16] || (_cache[16] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "可用供应商", -1)), - _createElementVNode("div", _hoisted_3, _toDisplayString(summary.value.available_count || 0) + " / " + _toDisplayString(summary.value.enabled_count || 0), 1) + _cache[15] || (_cache[15] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "可用供应商", -1)), + _createElementVNode("div", _hoisted_4, _toDisplayString(summary.value.available_count || 0) + " / " + _toDisplayString(summary.value.enabled_count || 0), 1) ]), _: 1 }) @@ -288,8 +298,8 @@ return (_ctx, _cache) => { class: "pa-4 h-100" }, { default: _withCtx(() => [ - _cache[17] || (_cache[17] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "累计使用", -1)), - _createElementVNode("div", _hoisted_4, _toDisplayString(formatTokens(summary.value.total_used)), 1) + _cache[16] || (_cache[16] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "累计使用", -1)), + _createElementVNode("div", _hoisted_5, _toDisplayString(formatTokens(summary.value.total_used)), 1) ]), _: 1 }) @@ -308,8 +318,8 @@ return (_ctx, _cache) => { class: "pa-4 h-100" }, { default: _withCtx(() => [ - _cache[18] || (_cache[18] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "总额度", -1)), - _createElementVNode("div", _hoisted_5, _toDisplayString(formatTokens(summary.value.total_limit)), 1) + _cache[17] || (_cache[17] = _createElementVNode("div", { class: "text-caption text-medium-emphasis" }, "总额度", -1)), + _createElementVNode("div", _hoisted_6, _toDisplayString(formatTokens(summary.value.total_limit)), 1) ]), _: 1 }) @@ -328,7 +338,7 @@ return (_ctx, _cache) => { class: "pa-4 h-100 d-flex align-center" }, { default: _withCtx(() => [ - _createElementVNode("div", _hoisted_6, [ + _createElementVNode("div", _hoisted_7, [ _createVNode(_component_VSwitch, { modelValue: _ctx.status.config.enabled, "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.status.config.enabled) = $event)), @@ -364,13 +374,13 @@ return (_ctx, _cache) => { }, { default: _withCtx(() => [ _createVNode(_component_VTab, { value: "usage" }, { - default: _withCtx(() => [...(_cache[19] || (_cache[19] = [ + default: _withCtx(() => [...(_cache[18] || (_cache[18] = [ _createTextVNode("用量", -1) ]))]), _: 1 }), _createVNode(_component_VTab, { value: "config" }, { - default: _withCtx(() => [...(_cache[20] || (_cache[20] = [ + default: _withCtx(() => [...(_cache[19] || (_cache[19] = [ _createTextVNode("配置", -1) ]))]), _: 1 @@ -392,7 +402,7 @@ return (_ctx, _cache) => { default: _withCtx(() => [ _createVNode(_component_VTable, { density: "comfortable" }, { default: _withCtx(() => [ - _cache[22] || (_cache[22] = _createElementVNode("thead", null, [ + _cache[21] || (_cache[21] = _createElementVNode("thead", null, [ _createElementVNode("tr", null, [ _createElementVNode("th", null, "优先级"), _createElementVNode("th", null, "名称"), @@ -414,7 +424,7 @@ return (_ctx, _cache) => { _createElementVNode("td", null, _toDisplayString(row.model), 1), _createElementVNode("td", null, _toDisplayString(formatTokens(row.usage?.total_tokens)), 1), _createElementVNode("td", null, _toDisplayString(row.usage?.remaining_tokens === null ? '不限' : formatTokens(row.usage?.remaining_tokens)), 1), - _createElementVNode("td", _hoisted_7, [ + _createElementVNode("td", _hoisted_8, [ _createVNode(_component_VProgressLinear, { "model-value": row.usage?.usage_percent || 0, color: rowStatusColor(row), @@ -434,7 +444,7 @@ return (_ctx, _cache) => { _: 2 }, 1032, ["color"]) ]), - _createElementVNode("td", _hoisted_8, [ + _createElementVNode("td", _hoisted_9, [ _createVNode(_component_VBtn, { icon: "mdi-backup-restore", size: "small", @@ -445,7 +455,7 @@ return (_ctx, _cache) => { ])) }), 128)), (!providerRows.value.length) - ? (_openBlock(), _createElementBlock("tr", _hoisted_9, [...(_cache[21] || (_cache[21] = [ + ? (_openBlock(), _createElementBlock("tr", _hoisted_10, [...(_cache[20] || (_cache[20] = [ _createElementVNode("td", { colspan: "8", class: "text-center text-medium-emphasis py-8" @@ -464,14 +474,14 @@ return (_ctx, _cache) => { }), _createVNode(_component_VWindowItem, { value: "config" }, { default: _withCtx(() => [ - _createElementVNode("div", _hoisted_10, [ + _createElementVNode("div", _hoisted_11, [ _createVNode(_component_VBtn, { "prepend-icon": "mdi-plus", color: "primary", variant: "tonal", onClick: addProvider }, { - default: _withCtx(() => [...(_cache[23] || (_cache[23] = [ + default: _withCtx(() => [...(_cache[22] || (_cache[22] = [ _createTextVNode("新增", -1) ]))]), _: 1 @@ -482,7 +492,7 @@ return (_ctx, _cache) => { variant: "tonal", onClick: resetAllUsage }, { - default: _withCtx(() => [...(_cache[24] || (_cache[24] = [ + default: _withCtx(() => [...(_cache[23] || (_cache[23] = [ _createTextVNode("重置用量", -1) ]))]), _: 1 @@ -495,7 +505,7 @@ return (_ctx, _cache) => { default: _withCtx(() => [ _createVNode(_component_VTable, { density: "comfortable" }, { default: _withCtx(() => [ - _cache[26] || (_cache[26] = _createElementVNode("thead", null, [ + _cache[25] || (_cache[25] = _createElementVNode("thead", null, [ _createElementVNode("tr", null, [ _createElementVNode("th", null, "启用"), _createElementVNode("th", null, "优先级"), @@ -525,11 +535,11 @@ return (_ctx, _cache) => { _createElementVNode("td", null, _toDisplayString(row.priority), 1), _createElementVNode("td", null, _toDisplayString(row.name), 1), _createElementVNode("td", null, _toDisplayString(row.provider), 1), - _createElementVNode("td", _hoisted_11, _toDisplayString(row.base_url), 1), + _createElementVNode("td", _hoisted_12, _toDisplayString(row.base_url), 1), _createElementVNode("td", null, _toDisplayString(providerRows.value[index]?.masked_api_key || '****'), 1), _createElementVNode("td", null, _toDisplayString(row.model), 1), _createElementVNode("td", null, _toDisplayString(row.token_limit > 0 ? formatTokens(row.token_limit) : '不限'), 1), - _createElementVNode("td", _hoisted_12, [ + _createElementVNode("td", _hoisted_13, [ _createVNode(_component_VBtn, { icon: "mdi-pencil", size: "small", @@ -547,7 +557,7 @@ return (_ctx, _cache) => { ])) }), 128)), (!config.value.providers?.length) - ? (_openBlock(), _createElementBlock("tr", _hoisted_13, [...(_cache[25] || (_cache[25] = [ + ? (_openBlock(), _createElementBlock("tr", _hoisted_14, [...(_cache[24] || (_cache[24] = [ _createElementVNode("td", { colspan: "9", class: "text-center text-medium-emphasis py-8" @@ -713,7 +723,7 @@ return (_ctx, _cache) => { variant: "text", onClick: _cache[12] || (_cache[12] = $event => (_ctx.showEditor = false)) }, { - default: _withCtx(() => [...(_cache[27] || (_cache[27] = [ + default: _withCtx(() => [...(_cache[26] || (_cache[26] = [ _createTextVNode("取消", -1) ]))]), _: 1 @@ -722,7 +732,7 @@ return (_ctx, _cache) => { color: "primary", onClick: commitProvider }, { - default: _withCtx(() => [...(_cache[28] || (_cache[28] = [ + default: _withCtx(() => [...(_cache[27] || (_cache[27] = [ _createTextVNode("确定", -1) ]))]), _: 1 @@ -741,6 +751,6 @@ return (_ctx, _cache) => { } }; -const AppPage = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-37f144a0"]]); +const AppPage = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-f613ca6c"]]); export { AppPage as default }; diff --git a/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-4pktUk8J.js b/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-4pktUk8J.js new file mode 100644 index 0000000..e0f6d84 --- /dev/null +++ b/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-4pktUk8J.js @@ -0,0 +1,64 @@ +import { importShared } from './__federation_fn_import-JrT3xvdd.js'; +import AppPage from './__federation_expose_AppPage-CpDG627M.js'; + +const {createTextVNode:_createTextVNode,resolveComponent:_resolveComponent,withCtx:_withCtx,createVNode:_createVNode,openBlock:_openBlock,createElementBlock:_createElementBlock} = await importShared('vue'); + + +const _hoisted_1 = { class: "agenttokens-page-wrapper" }; + + +const _sfc_main = { + __name: 'Page', + props: { + api: { + type: Object, + default: () => ({}), + }, +}, + emits: ['close'], + setup(__props, { emit: __emit }) { + + +const emit = __emit; + +return (_ctx, _cache) => { + const _component_VToolbarTitle = _resolveComponent("VToolbarTitle"); + const _component_VSpacer = _resolveComponent("VSpacer"); + const _component_VBtn = _resolveComponent("VBtn"); + const _component_VToolbar = _resolveComponent("VToolbar"); + const _component_VDivider = _resolveComponent("VDivider"); + + return (_openBlock(), _createElementBlock("div", _hoisted_1, [ + _createVNode(_component_VToolbar, { + density: "comfortable", + color: "transparent" + }, { + default: _withCtx(() => [ + _createVNode(_component_VToolbarTitle, null, { + default: _withCtx(() => [...(_cache[1] || (_cache[1] = [ + _createTextVNode("Agent Tokens 数据", -1) + ]))]), + _: 1 + }), + _createVNode(_component_VSpacer), + _createVNode(_component_VBtn, { + icon: "mdi-close", + variant: "text", + onClick: _cache[0] || (_cache[0] = $event => (emit('close'))) + }) + ]), + _: 1 + }), + _createVNode(_component_VDivider), + _createVNode(AppPage, { + api: __props.api, + "plugin-id": "AgentTokens", + "hide-title": "" + }, null, 8, ["api"]) + ])) +} +} + +}; + +export { _sfc_main as default }; diff --git a/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-Dz_SgNh_.js b/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-Dz_SgNh_.js deleted file mode 100644 index 6d01a71..0000000 --- a/plugins.v2/agenttokens/dist/assets/__federation_expose_Page-Dz_SgNh_.js +++ /dev/null @@ -1,57 +0,0 @@ -import { importShared } from './__federation_fn_import-JrT3xvdd.js'; -import AppPage from './__federation_expose_AppPage-BniPA2RJ.js'; - -const {createElementVNode:_createElementVNode,resolveComponent:_resolveComponent,createVNode:_createVNode,withCtx:_withCtx,openBlock:_openBlock,createBlock:_createBlock} = await importShared('vue'); - - -const _sfc_main = { - __name: 'Page', - props: { - api: { - type: Object, - default: () => ({}), - }, -}, - emits: ['close'], - setup(__props, { emit: __emit }) { - - -const emit = __emit; - -return (_ctx, _cache) => { - const _component_VBtn = _resolveComponent("VBtn"); - const _component_VCardTitle = _resolveComponent("VCardTitle"); - const _component_VCardText = _resolveComponent("VCardText"); - const _component_VCard = _resolveComponent("VCard"); - - return (_openBlock(), _createBlock(_component_VCard, null, { - default: _withCtx(() => [ - _createVNode(_component_VCardTitle, { class: "d-flex justify-space-between align-center" }, { - default: _withCtx(() => [ - _cache[1] || (_cache[1] = _createElementVNode("span", null, "Agent Tokens 配置", -1)), - _createVNode(_component_VBtn, { - icon: "mdi-close", - variant: "text", - onClick: _cache[0] || (_cache[0] = $event => (emit('close'))) - }) - ]), - _: 1 - }), - _createVNode(_component_VCardText, { class: "pa-0" }, { - default: _withCtx(() => [ - _createVNode(AppPage, { - api: __props.api, - "plugin-id": "AgentTokens" - }, null, 8, ["api"]) - ]), - _: 1 - }) - ]), - _: 1 - })) -} -} - -}; - -export { _sfc_main as default }; diff --git a/plugins.v2/agenttokens/dist/assets/index-D-L22f8O.js b/plugins.v2/agenttokens/dist/assets/index-JEfKS0NU.js similarity index 95% rename from plugins.v2/agenttokens/dist/assets/index-D-L22f8O.js rename to plugins.v2/agenttokens/dist/assets/index-JEfKS0NU.js index 2b24fb2..61bf02d 100644 --- a/plugins.v2/agenttokens/dist/assets/index-D-L22f8O.js +++ b/plugins.v2/agenttokens/dist/assets/index-JEfKS0NU.js @@ -1,5 +1,5 @@ import { importShared } from './__federation_fn_import-JrT3xvdd.js'; -import AppPage from './__federation_expose_AppPage-BniPA2RJ.js'; +import AppPage from './__federation_expose_AppPage-CpDG627M.js'; true&&(function polyfill() { const relList = document.createElement("link").relList; diff --git a/plugins.v2/agenttokens/dist/assets/remoteEntry.js b/plugins.v2/agenttokens/dist/assets/remoteEntry.js index d655f3d..d4a4240 100644 --- a/plugins.v2/agenttokens/dist/assets/remoteEntry.js +++ b/plugins.v2/agenttokens/dist/assets/remoteEntry.js @@ -2,8 +2,8 @@ const currentImports = {}; const exportSet = new Set(['Module', '__esModule', 'default', '_export_sfc']); let moduleMap = { "./Page":()=>{ - dynamicLoadingCss(["__federation_expose_AppPage-CWiPD-TF.css"], false, './Page'); - return __federation_import('./__federation_expose_Page-Dz_SgNh_.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, + dynamicLoadingCss(["__federation_expose_AppPage-BjNAU01R.css"], false, './Page'); + return __federation_import('./__federation_expose_Page-4pktUk8J.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, "./Config":()=>{ dynamicLoadingCss(["__federation_expose_Config-BRhIQuJm.css"], false, './Config'); return __federation_import('./__federation_expose_Config-FSeNNeNu.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, @@ -11,8 +11,8 @@ const currentImports = {}; dynamicLoadingCss([], false, './Dashboard'); return __federation_import('./__federation_expose_Dashboard-BPSul9jL.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, "./AppPage":()=>{ - dynamicLoadingCss(["__federation_expose_AppPage-CWiPD-TF.css"], false, './AppPage'); - return __federation_import('./__federation_expose_AppPage-BniPA2RJ.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)},}; + dynamicLoadingCss(["__federation_expose_AppPage-BjNAU01R.css"], false, './AppPage'); + return __federation_import('./__federation_expose_AppPage-CpDG627M.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)},}; const seen = {}; const dynamicLoadingCss = (cssFilePaths, dontAppendStylesToHead, exposeItemName) => { const metaUrl = import.meta.url; diff --git a/plugins.v2/agenttokens/dist/index.html b/plugins.v2/agenttokens/dist/index.html index c90df4f..10abbb1 100644 --- a/plugins.v2/agenttokens/dist/index.html +++ b/plugins.v2/agenttokens/dist/index.html @@ -1,6 +1,6 @@ - + - - + +
diff --git a/plugins.v2/agenttokens/package.json b/plugins.v2/agenttokens/package.json index 8fc85f2..c1dd572 100644 --- a/plugins.v2/agenttokens/package.json +++ b/plugins.v2/agenttokens/package.json @@ -1,7 +1,7 @@ { "name": "moviepilot-agenttokens-plugin", "private": true, - "version": "1.0.1", + "version": "1.0.2", "type": "module", "scripts": { "build": "vite build" diff --git a/plugins.v2/agenttokens/src/components/AppPage.vue b/plugins.v2/agenttokens/src/components/AppPage.vue index 7ebcd41..18ef29f 100644 --- a/plugins.v2/agenttokens/src/components/AppPage.vue +++ b/plugins.v2/agenttokens/src/components/AppPage.vue @@ -10,6 +10,10 @@ const props = defineProps({ type: String, default: 'AgentTokens', }, + hideTitle: { + type: Boolean, + default: false, + }, }) // 构造 API 基础路径。 @@ -174,7 +178,7 @@ onMounted(loadStatus)