fix(ClashRuleProvider): 修复代理组修改丢失问题

This commit is contained in:
wumode
2025-07-07 13:26:55 +08:00
parent 2060b0b98c
commit 9e9060dbb0
5 changed files with 54 additions and 52 deletions

View File

@@ -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": "展示更多信息; 修复交互问题",

View File

@@ -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]:
"""

View File

@@ -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;
}

View File

@@ -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 };

View File

@@ -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)},