From 9e9060dbb00d041e643ce48360550add6dd596e9 Mon Sep 17 00:00:00 2001 From: wumode Date: Mon, 7 Jul 2025 13:26:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(ClashRuleProvider):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E7=BB=84=E4=BF=AE=E6=94=B9=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 3 +- plugins.v2/clashruleprovider/__init__.py | 4 +- ... => __federation_expose_Page-BYw_2U8w.css} | 20 ++--- ...s => __federation_expose_Page-CdB5Ln3A.js} | 75 ++++++++++--------- .../dist/assets/remoteEntry.js | 4 +- 5 files changed, 54 insertions(+), 52 deletions(-) rename plugins.v2/clashruleprovider/dist/assets/{__federation_expose_Page-DMGoo00L.css => __federation_expose_Page-BYw_2U8w.css} (68%) rename plugins.v2/clashruleprovider/dist/assets/{__federation_expose_Page-BNbsW3Id.js => __federation_expose_Page-CdB5Ln3A.js} (99%) diff --git a/package.v2.json b/package.v2.json index 53ba249..38ebaf6 100644 --- a/package.v2.json +++ b/package.v2.json @@ -456,11 +456,12 @@ "name": "Clash Rule Provider", "description": "随时为Clash添加一些额外的规则。", "labels": "工具", - "version": "1.2.4", + "version": "1.2.5", "icon": "Mihomo_Meta_A.png", "author": "wumode", "level": 1, "history": { + "v1.2.5": "修复代理组修改丢失问题", "v1.2.4": "支持geo规则补全; 代理组编辑", "v1.2.3": "修复规则集名称错误", "v1.2.2": "展示更多信息; 修复交互问题", diff --git a/plugins.v2/clashruleprovider/__init__.py b/plugins.v2/clashruleprovider/__init__.py index 2cf7a1d..0a72eb6 100644 --- a/plugins.v2/clashruleprovider/__init__.py +++ b/plugins.v2/clashruleprovider/__init__.py @@ -39,7 +39,7 @@ class ClashRuleProvider(_PluginBase): # 插件图标 plugin_icon = "Mihomo_Meta_A.png" # 插件版本 - plugin_version = "1.2.4" + plugin_version = "1.2.5" # 插件作者 plugin_author = "wumode" # 作者主页 @@ -893,6 +893,7 @@ class ClashRuleProvider(_PluginBase): continue new_item[k] = v self._proxy_groups[index] = new_item + self.save_data('proxy_groups', self._proxy_groups) return schemas.Response(success=True) def delete_proxy_group(self, params: dict = Body(...)) -> schemas.Response: @@ -1107,7 +1108,6 @@ class ClashRuleProvider(_PluginBase): yaml_files = [item["path"][:item["path"].rfind('.')] for item in tree["tree"] if item["type"] == "blob" and item['path'].endswith((".yaml", ".yml"))] self._geo_rules[path["name"]] = yaml_files - print(len(self._geo_rules['geosite'])) def refresh_subscriptions(self) -> Dict[str, bool]: """ diff --git a/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-DMGoo00L.css b/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BYw_2U8w.css similarity index 68% rename from plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-DMGoo00L.css rename to plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BYw_2U8w.css index 19567d2..431b55e 100644 --- a/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-DMGoo00L.css +++ b/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BYw_2U8w.css @@ -1,13 +1,13 @@ -.plugin-page[data-v-40c8d8f5] { +.plugin-page[data-v-77adff9b] { margin: 0 auto; } /* 使卡片等宽并适应移动端 */ -.d-flex.flex-wrap[data-v-40c8d8f5] { +.d-flex.flex-wrap[data-v-77adff9b] { gap: 16px; } -.url-display[data-v-40c8d8f5] { +.url-display[data-v-77adff9b] { word-break: break-all; padding: 8px; background: rgba(0, 0, 0, 0.05); @@ -16,19 +16,19 @@ /* 移动端堆叠布局 */ @media (max-width: 768px) { -.d-flex.flex-wrap[data-v-40c8d8f5] { +.d-flex.flex-wrap[data-v-77adff9b] { flex-direction: column; } } /* Add visual distinction between sections */ -.ruleset-section[data-v-40c8d8f5] { +.ruleset-section[data-v-77adff9b] { border: 1px solid #e0e0e0; border-radius: 4px; padding: 16px; background-color: #f5f5f5; } -.top-section[data-v-40c8d8f5] { +.top-section[data-v-77adff9b] { border: 1px solid #e0e0e0; border-radius: 4px; padding: 16px; @@ -36,15 +36,15 @@ } /* Optional: Add different border colors to further distinguish */ -.ruleset-section[data-v-40c8d8f5] { +.ruleset-section[data-v-77adff9b] { border-left: 4px solid #2196F3; /* Blue accent */ } -.top-section[data-v-40c8d8f5] { +.top-section[data-v-77adff9b] { border-left: 4px solid #4CAF50; /* Green accent */ } -.drag-handle[data-v-40c8d8f5] { +.drag-handle[data-v-77adff9b] { cursor: move; } -.gap-2[data-v-40c8d8f5] { +.gap-2[data-v-77adff9b] { gap: 8px; } diff --git a/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BNbsW3Id.js b/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-CdB5Ln3A.js similarity index 99% rename from plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BNbsW3Id.js rename to plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-CdB5Ln3A.js index 253736e..649abaf 100644 --- a/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-BNbsW3Id.js +++ b/plugins.v2/clashruleprovider/dist/assets/__federation_expose_Page-CdB5Ln3A.js @@ -4295,33 +4295,32 @@ const _hoisted_39 = { style: {"position":"absolute","right":"0","bottom":"0"} }; const _hoisted_40 = { class: "d-flex flex-column justify-space-between gap-1" }; const _hoisted_41 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; const _hoisted_42 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; -const _hoisted_43 = { class: "text-white" }; +const _hoisted_43 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; const _hoisted_44 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; const _hoisted_45 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; -const _hoisted_46 = { class: "d-flex justify-space-between text-body-2 border-b pb-1" }; -const _hoisted_47 = { class: "d-flex justify-space-between text-body-2" }; -const _hoisted_48 = { +const _hoisted_46 = { class: "d-flex justify-space-between text-body-2" }; +const _hoisted_47 = { key: 0, class: "d-flex flex-column align-start ga-2" }; -const _hoisted_49 = { class: "d-flex align-center" }; -const _hoisted_50 = { class: "pl-6 d-flex flex-wrap gap-2 mt-2" }; -const _hoisted_51 = { +const _hoisted_48 = { class: "d-flex align-center" }; +const _hoisted_49 = { class: "pl-6 d-flex flex-wrap gap-2 mt-2" }; +const _hoisted_50 = { key: 1, class: "text-caption text-disabled" }; -const _hoisted_52 = { class: "my-2 d-flex align-center" }; -const _hoisted_53 = { class: "d-flex align-center" }; -const _hoisted_54 = { class: "pl-6 text-wrap text-body-2" }; -const _hoisted_55 = ["href"]; -const _hoisted_56 = { +const _hoisted_51 = { class: "my-2 d-flex align-center" }; +const _hoisted_52 = { class: "d-flex align-center" }; +const _hoisted_53 = { class: "pl-6 text-wrap text-body-2" }; +const _hoisted_54 = ["href"]; +const _hoisted_55 = { key: 1, class: "text-grey" }; -const _hoisted_57 = { class: "mb-2" }; +const _hoisted_56 = { class: "mb-2" }; +const _hoisted_57 = { class: "d-flex justify-space-between mb-2" }; const _hoisted_58 = { class: "d-flex justify-space-between mb-2" }; -const _hoisted_59 = { class: "d-flex justify-space-between mb-2" }; -const _hoisted_60 = { class: "d-flex justify-space-between text-caption text-grey" }; +const _hoisted_59 = { class: "d-flex justify-space-between text-caption text-grey" }; const {ref,onMounted,computed} = await importShared('vue'); // v-data-table 的 headers 定义 @@ -6227,6 +6226,7 @@ return (_ctx, _cache) => { }, 8, ["modelValue"]), _createVNode(_component_v_row, { class: "mt-4", + align: "stretch", dense: "" }, { default: _withCtx(() => [ @@ -6235,7 +6235,7 @@ return (_ctx, _cache) => { md: "6" }, { default: _withCtx(() => [ - _createVNode(_component_v_card, null, { + _createVNode(_component_v_card, { class: "h-100" }, { default: _withCtx(() => [ _createVNode(_component_v_card_title, { class: "text-h6 font-weight-medium" }, { default: _withCtx(() => _cache[127] || (_cache[127] = [ @@ -6260,21 +6260,21 @@ return (_ctx, _cache) => { ]), _createElementVNode("div", _hoisted_42, [ _cache[129] || (_cache[129] = _createElementVNode("span", null, "订阅配置规则数", -1)), - _createElementVNode("span", _hoisted_43, _toDisplayString(subscriptionInfo.value.rule_size), 1) + _createElementVNode("span", null, _toDisplayString(subscriptionInfo.value.rule_size), 1) ]), - _createElementVNode("div", _hoisted_44, [ + _createElementVNode("div", _hoisted_43, [ _cache[130] || (_cache[130] = _createElementVNode("span", null, "置顶规则数", -1)), _createElementVNode("span", null, _toDisplayString(sortedRules.value.length), 1) ]), - _createElementVNode("div", _hoisted_45, [ + _createElementVNode("div", _hoisted_44, [ _cache[131] || (_cache[131] = _createElementVNode("span", null, "规则集规则数", -1)), _createElementVNode("span", null, _toDisplayString(sortedRulesetRules.value.length), 1) ]), - _createElementVNode("div", _hoisted_46, [ + _createElementVNode("div", _hoisted_45, [ _cache[132] || (_cache[132] = _createElementVNode("span", null, "代理组数", -1)), _createElementVNode("span", null, _toDisplayString(proxyGroups.value.length), 1) ]), - _createElementVNode("div", _hoisted_47, [ + _createElementVNode("div", _hoisted_46, [ _cache[133] || (_cache[133] = _createElementVNode("span", null, "最后更新", -1)), _createElementVNode("span", null, _toDisplayString(lastUpdated.value), 1) ]) @@ -6293,7 +6293,7 @@ return (_ctx, _cache) => { md: "6" }, { default: _withCtx(() => [ - _createVNode(_component_v_card, null, { + _createVNode(_component_v_card, { class: "h-100" }, { default: _withCtx(() => [ _createVNode(_component_v_card_title, { class: "d-flex justify-space-between align-center" }, { default: _withCtx(() => [ @@ -6331,8 +6331,8 @@ return (_ctx, _cache) => { _createVNode(_component_v_card_text, null, { default: _withCtx(() => [ (subUrl.value) - ? (_openBlock(), _createElementBlock("div", _hoisted_48, [ - _createElementVNode("div", _hoisted_49, [ + ? (_openBlock(), _createElementBlock("div", _hoisted_47, [ + _createElementVNode("div", _hoisted_48, [ _createVNode(_component_v_icon, { color: "grey", class: "mr-2" @@ -6344,7 +6344,7 @@ return (_ctx, _cache) => { }), _cache[137] || (_cache[137] = _createElementVNode("span", { class: "text-grey-darken-1" }, "原始链接:", -1)) ]), - _createElementVNode("div", _hoisted_50, [ + _createElementVNode("div", _hoisted_49, [ (Object.keys(subscriptionsInfo.value).length > 0) ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(subscriptionsInfo.value, (info, url) => { return (_openBlock(), _createElementBlock("div", { key: url }, [ @@ -6359,9 +6359,9 @@ return (_ctx, _cache) => { }, 1040, ["onClick"]) ])) }), 128)) - : (_openBlock(), _createElementBlock("div", _hoisted_51, " 暂无可用订阅 ")) + : (_openBlock(), _createElementBlock("div", _hoisted_50, " 暂无可用订阅 ")) ]), - _createElementVNode("div", _hoisted_52, [ + _createElementVNode("div", _hoisted_51, [ _createVNode(_component_v_icon, { color: "blue" }, { default: _withCtx(() => _cache[138] || (_cache[138] = [ _createTextVNode("mdi-arrow-down-bold") @@ -6369,7 +6369,7 @@ return (_ctx, _cache) => { _: 1 }) ]), - _createElementVNode("div", _hoisted_53, [ + _createElementVNode("div", _hoisted_52, [ _createVNode(_component_v_icon, { color: "primary", class: "mr-2" @@ -6381,15 +6381,15 @@ return (_ctx, _cache) => { }), _cache[140] || (_cache[140] = _createElementVNode("span", { class: "text-grey-darken-1" }, "生成链接:", -1)) ]), - _createElementVNode("div", _hoisted_54, [ + _createElementVNode("div", _hoisted_53, [ _createElementVNode("a", { href: subUrl.value, target: "_blank", class: "text-primary" - }, _toDisplayString(subUrl.value), 9, _hoisted_55) + }, _toDisplayString(subUrl.value), 9, _hoisted_54) ]) ])) - : (_openBlock(), _createElementBlock("div", _hoisted_56, "未配置订阅 URL")) + : (_openBlock(), _createElementBlock("div", _hoisted_55, "未配置订阅 URL")) ]), _: 1 }) @@ -6404,7 +6404,8 @@ return (_ctx, _cache) => { }), _createVNode(_component_v_expansion_panels, { modelValue: expansionPanels.value, - "onUpdate:modelValue": _cache[25] || (_cache[25] = $event => ((expansionPanels).value = $event)) + "onUpdate:modelValue": _cache[25] || (_cache[25] = $event => ((expansionPanels).value = $event)), + class: "mt-4" }, { default: _withCtx(() => [ _createVNode(_component_v_expansion_panel, null, { @@ -6475,7 +6476,7 @@ return (_ctx, _cache) => { default: _withCtx(() => [ _createVNode(_component_v_card_text, null, { default: _withCtx(() => [ - _createElementVNode("div", _hoisted_57, [ + _createElementVNode("div", _hoisted_56, [ (info.proxy_num != null) ? (_openBlock(), _createBlock(_component_v_chip, { key: 0, @@ -6515,11 +6516,11 @@ return (_ctx, _cache) => { }, 1032, ["color"])) : _createCommentVNode("", true) ]), - _createElementVNode("div", _hoisted_58, [ + _createElementVNode("div", _hoisted_57, [ _cache[144] || (_cache[144] = _createElementVNode("span", null, "已用流量:", -1)), _createElementVNode("strong", null, _toDisplayString(formatBytes(info.download + info.upload)), 1) ]), - _createElementVNode("div", _hoisted_59, [ + _createElementVNode("div", _hoisted_58, [ _cache[145] || (_cache[145] = _createElementVNode("span", null, "剩余流量:", -1)), _createElementVNode("strong", null, _toDisplayString(formatBytes(info.total - info.download)), 1) ]), @@ -6531,7 +6532,7 @@ return (_ctx, _cache) => { rounded: "", striped: "" }, null, 8, ["model-value", "color"]), - _createElementVNode("div", _hoisted_60, [ + _createElementVNode("div", _hoisted_59, [ _createElementVNode("span", null, "下载:" + _toDisplayString(formatBytes(info.download)), 1), _createElementVNode("span", null, "上传:" + _toDisplayString(formatBytes(info.upload)), 1), _createElementVNode("span", null, "总量:" + _toDisplayString(formatBytes(info.total)), 1) @@ -7613,6 +7614,6 @@ return (_ctx, _cache) => { } }; -const PageComponent = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-40c8d8f5"]]); +const PageComponent = /*#__PURE__*/_export_sfc(_sfc_main, [['__scopeId',"data-v-77adff9b"]]); export { PageComponent as default }; diff --git a/plugins.v2/clashruleprovider/dist/assets/remoteEntry.js b/plugins.v2/clashruleprovider/dist/assets/remoteEntry.js index 4672a18..0074dbf 100644 --- a/plugins.v2/clashruleprovider/dist/assets/remoteEntry.js +++ b/plugins.v2/clashruleprovider/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_Page-DMGoo00L.css"], false, './Page'); - return __federation_import('./__federation_expose_Page-BNbsW3Id.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, + dynamicLoadingCss(["__federation_expose_Page-BYw_2U8w.css"], false, './Page'); + return __federation_import('./__federation_expose_Page-CdB5Ln3A.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)}, "./Config":()=>{ dynamicLoadingCss(["__federation_expose_Config-s4NWY2Hy.css"], false, './Config'); return __federation_import('./__federation_expose_Config-HFXrSiMi.js').then(module =>Object.keys(module).every(item => exportSet.has(item)) ? () => module.default : () => module)},