Skip to content

Commit 6cc44d2

Browse files
committed
feat: 文件 mihomo 配置的来源新增远程/本地, 可作为 mihomo 配置或转换为 mihomo 节点; 文件路由支持参数覆盖
1 parent 1cacdf6 commit 6cc44d2

19 files changed

Lines changed: 422 additions & 126 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.25.5",
3+
"version": "2.26.3",
44
"private": true,
55
"packageManager": "pnpm@11.0.9",
66
"scripts": {

src/components/ArtifactPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@
132132
>
133133
<nut-radio label="Stash">Stash</nut-radio>
134134
<nut-radio label="Egern">Egern</nut-radio>
135-
<nut-radio label="ClashMeta">Mihomo</nut-radio>
135+
<nut-radio label="ClashMeta">mihomo</nut-radio>
136136
<nut-radio label="Surfboard">Surfboard</nut-radio>
137137
<nut-radio label="Surge">Surge</nut-radio>
138-
<nut-radio label="SurgeMac">Surge(macOS) <a href="https://github.com/sub-store-org/Sub-Store/wiki/%E9%93%BE%E6%8E%A5%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E" target="_blank">ⓘ</a></nut-radio>
138+
<nut-radio label="SurgeMac">Surge Mac <a href="https://github.com/sub-store-org/Sub-Store/wiki/%E9%93%BE%E6%8E%A5%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E" target="_blank">ⓘ</a></nut-radio>
139139
<nut-radio label="Loon">Loon</nut-radio>
140140
<nut-radio label="ShadowRocket">Shadowrocket</nut-radio>
141141
<nut-radio label="QX">Quantumult X<span name="tips" @click="qxTips">&nbsp;ⓘ</span></nut-radio>

src/components/FileListItem.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
import { useHostAPI } from '@/hooks/useHostAPI';
270270
import { useBackend } from "@/hooks/useBackend";
271271
import clashmetaIcon from '@/assets/icons/clashmeta_color.png';
272+
import { isMihomoConfigFileType } from "@/utils/fileType";
272273
273274
const { copy, isSupported } = useClipboard();
274275
const { toClipboard: copyFallback } = useV3Clipboard();
@@ -343,7 +344,7 @@
343344
});
344345
const { flows } = storeToRefs(subsStore);
345346
const icon = computed(() => {
346-
if (props.file.type === 'mihomoProfile') return clashmetaIcon;
347+
if (isMihomoConfigFileType(props.file.type)) return clashmetaIcon;
347348
return appearanceSetting.value.isDefaultIcon ? logoIcon : logoRedIcon;
348349
})
349350
const avatarSize = computed(() => {
@@ -388,7 +389,7 @@
388389
});
389390
390391
const flow = computed(() => {
391-
if (props.file.type === 'mihomoProfile') return t('filePage.type.mihomoProfile');
392+
if (isMihomoConfigFileType(props.file.type)) return t('filePage.type.mihomoConfig');
392393
if (props.file.source === 'remote') return t('filePage.source.remote');
393394
return t('filePage.source.local');
394395
});

src/components/PreviewPanel.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
icon: stash,
233233
},
234234
{
235-
name: 'Mihomo',
235+
name: 'mihomo',
236236
path: 'ClashMeta',
237237
icon: clashmeta,
238238
},
@@ -257,7 +257,7 @@
257257
icon: surge,
258258
},
259259
{
260-
name: 'Surge(macOS)',
260+
name: 'Surge Mac',
261261
path: 'SurgeMac',
262262
icon: surgeMac,
263263
},

src/locales/en.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ export default {
154154
},
155155
filePage: {
156156
type: {
157-
mihomoProfile: 'Mihomo Profile',
158-
mihomoProfileTips: 'Override is supported',
159-
mihomoProfileTips2: 'Override(JavaScript/YAML) is supported',
157+
mihomoConfig: 'mihomo config',
158+
mihomoConfigTips: 'Override is supported',
159+
mihomoConfigTips2: 'Override(JavaScript/YAML) is supported',
160+
mihomoConfigScriptActionTips: 'Script actions can use JavaScript/YAML overrides',
160161
},
161162
addFileTitle: "Create File",
162163
importFileTitle: "Import File data",
@@ -194,6 +195,11 @@ export default {
194195
local: "Local",
195196
remote: "Remote",
196197
},
198+
mode: {
199+
label: "Mode",
200+
config: "Use as mihomo config",
201+
proxy: "Convert to mihomo proxies",
202+
},
197203
ignoreFailedRemoteFile: {
198204
label: "Remote File Failure Handling",
199205
disabled: 'Strict Errors',
@@ -536,7 +542,7 @@ export default {
536542
actions: {
537543
label: "Node Actions",
538544
addAction: {
539-
title: "Add an action",
545+
title: "Add action",
540546
cancel: "Cancel",
541547
confirm: "Confirm",
542548
},
@@ -762,7 +768,7 @@ export default {
762768
label: "Add Nodes From Subscription",
763769
tipsTitle: "Add Nodes From Subscription Tips",
764770
tipsDes:
765-
"Add Mihomo nodes produced by a single subscription or collection subscription to the current Mihomo profile proxies field.",
771+
"Add mihomo nodes produced by a single subscription or collection subscription to the current mihomo config proxies field.",
766772
des: {
767773
source: "Source",
768774
sourceName: "Subscription",

src/locales/ru.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,10 @@ export default {
149149
},
150150
"filePage": {
151151
"type": {
152-
"mihomoProfile": "Профиль Mihomo",
153-
"mihomoProfileTips": "Поддерживается перезапись",
154-
"mihomoProfileTips2": "Поддерживается перезапись (JavaScript/YAML)"
152+
"mihomoConfig": "Конфиг mihomo",
153+
"mihomoConfigTips": "Поддерживается перезапись",
154+
"mihomoConfigTips2": "Поддерживается перезапись (JavaScript/YAML)",
155+
"mihomoConfigScriptActionTips": "В скриптовых действиях можно использовать перезапись JavaScript/YAML"
155156
},
156157
"addFileTitle": "Создать файл",
157158
"importFileTitle": "Импорт данных файла",
@@ -186,6 +187,11 @@ export default {
186187
"local": "Локальный",
187188
"remote": "Удаленный"
188189
},
190+
"mode": {
191+
"label": "Режим",
192+
"config": "Использовать как конфиг mihomo",
193+
"proxy": "Преобразовать в узлы mihomo"
194+
},
189195
"ignoreFailedRemoteFile": {
190196
"label": "Обработка ошибок удаленного файла",
191197
"disabled": "Строгие ошибки",
@@ -809,7 +815,7 @@ export default {
809815
"Add Proxies From Subscription Operator": {
810816
"label": "Добавить узлы из подписки",
811817
"tipsTitle": "Подсказки по добавлению узлов из подписки",
812-
"tipsDes": "Добавляет Mihomo-узлы из одиночной или групповой подписки в поле proxies текущего Mihomo-профиля.",
818+
"tipsDes": "Добавляет mihomo-узлы из одиночной или групповой подписки в поле proxies текущего mihomo-конфига.",
813819
"des": {
814820
"source": "Источник",
815821
"sourceName": "Подписка",

src/locales/zh.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ export default {
153153
},
154154
filePage: {
155155
type: {
156-
mihomoProfile: 'Mihomo 配置',
157-
mihomoProfileTips: '可使用覆写',
158-
mihomoProfileTips2: '可使用 JavaScript/YAML 覆写',
156+
mihomoConfig: 'mihomo 配置',
157+
mihomoConfigTips: '可使用覆写',
158+
mihomoConfigTips2: '可使用 JavaScript/YAML 覆写',
159+
mihomoConfigScriptActionTips: '脚本操作中可使用 JavaScript/YAML 覆写',
159160
},
160161
addFileTitle: '创建文件',
161162
importFileTitle: '导入 Sub-Store 文件数据',
@@ -190,6 +191,11 @@ export default {
190191
local: '本地',
191192
remote: '远程',
192193
},
194+
mode: {
195+
label: '模式',
196+
config: '作为 mihomo 配置',
197+
proxy: '转换为 mihomo 节点',
198+
},
193199
ignoreFailedRemoteFile: {
194200
label: '远程文件失败处理',
195201
disabled: '严格报错',
@@ -524,7 +530,7 @@ export default {
524530
actions: {
525531
label: '节点操作',
526532
addAction: {
527-
title: '添加一个操作',
533+
title: '添加操作',
528534
cancel: '取消',
529535
confirm: '确认',
530536
},
@@ -581,7 +587,7 @@ export default {
581587
'Add Proxies From Subscription Operator': {
582588
label: '从订阅添加节点',
583589
tipsTitle: '从订阅添加节点提示',
584-
tipsDes: '将单条订阅或组合订阅产出的 Mihomo 节点写入当前 Mihomo 配置的 proxies 字段',
590+
tipsDes: '将单条订阅或组合订阅产出的 mihomo 节点写入当前 mihomo 配置的 proxies 字段',
585591
des: {
586592
source: '来源',
587593
sourceName: '订阅',

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ router.beforeResolve(async (to, from) => {
431431
// 进入编辑页面前查询是否存在订阅
432432
if (to.fullPath.startsWith('/edit/')) {
433433
const name = (to.params.id || to.params.name) as string;
434-
if (!['UNTITLED', 'UNTITLED-mihomoProfile'].includes(name)) {
434+
if (!['UNTITLED', 'UNTITLED-mihomoConfig', 'UNTITLED-mihomoProfile'].includes(name)) {
435435
try {
436436
if (to.params.editType === 'subs') {
437437
await useSubsApi().getOne('sub', name);

0 commit comments

Comments
 (0)