Skip to content

Commit d67db17

Browse files
committed
feat: 文件支持 Mihomo 配置, 支持使用覆写; target 名称适配大小写和别名
1 parent 856b8b3 commit d67db17

File tree

9 files changed

+336
-248
lines changed

9 files changed

+336
-248
lines changed

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.14.319",
3+
"version": "2.14.320",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/components/ArtifactPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
class="artifact-radio-group"
119119
>
120120
<nut-radio label="Stash">Stash</nut-radio>
121-
<nut-radio label="ClashMeta">Clash.Meta(mihomo)</nut-radio>
121+
<nut-radio label="ClashMeta">Mihomo</nut-radio>
122122
<nut-radio label="Clash">Clash(Deprecated)</nut-radio>
123123
<nut-radio label="Egern">Egern</nut-radio>
124124
<nut-radio label="Surfboard">Surfboard</nut-radio>

src/components/FileListItem.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
import { useRouter, useRoute } from 'vue-router';
237237
import { useHostAPI } from '@/hooks/useHostAPI';
238238
import { useBackend } from "@/hooks/useBackend";
239+
import clashmetaIcon from '@/assets/icons/clashmeta_color.png';
239240
240241
const { copy, isSupported } = useClipboard();
241242
const { toClipboard: copyFallback } = useV3Clipboard();
@@ -291,6 +292,7 @@
291292
})
292293
const { flows } = storeToRefs(subsStore);
293294
const icon = computed(() => {
295+
if (props.file.type === 'mihomoProfile') return clashmetaIcon;
294296
return appearanceSetting.value.isDefaultIcon ? logoIcon : logoRedIcon;
295297
})
296298
const collectionDetail = computed(() => {
@@ -309,6 +311,7 @@
309311
});
310312
311313
const flow = computed(() => {
314+
if (props.file.type === 'mihomoProfile') return t('filePage.type.mihomoProfile');
312315
if (props.file.source === 'remote') return t('filePage.source.remote');
313316
return t('filePage.source.local');
314317
});

src/components/PreviewPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
icon: stash,
113113
},
114114
{
115-
name: 'Clash.Meta(mihomo)',
115+
name: 'Mihomo',
116116
path: 'ClashMeta',
117117
icon: clashmeta,
118118
},

src/locales/en.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default {
1010
all: "All",
1111
untagged: "Untagged",
1212
or: "or",
13+
type: "Type",
1314
},
1415
globalNotify: {
1516
refresh: {
@@ -72,6 +73,10 @@ export default {
7273
"If you are seeing this, it is probably due to a routing interception issue on the front end of your browser. You can force a refresh to see it or use the link directly without affecting the use of this link.",
7374
},
7475
filePage: {
76+
type: {
77+
mihomoProfile: 'Mihomo Profile',
78+
mihomoProfileTips: 'Override is supported',
79+
},
7580
addFileTitle: "Create File",
7681
importFileTitle: "Import File data",
7782
importFileTips: "On the File Management page, click the Export icon button in the More items section of a file.",

src/locales/zh.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default {
1010
all: '全部',
1111
untagged: '未分组',
1212
or: '或',
13+
type: '类型',
1314
},
1415
globalNotify: {
1516
refresh: {
@@ -99,6 +100,10 @@ export default {
99100
backendDesc: '如果你看到这个 可能是因为浏览器前端路由拦截的问题 可以强制刷新查看或直接使用该链接 不影响此链接的使用',
100101
},
101102
filePage: {
103+
type: {
104+
mihomoProfile: 'Mihomo 配置',
105+
mihomoProfileTips: '可使用覆写',
106+
},
102107
addFileTitle: '创建文件',
103108
importFileTitle: '导入 Sub-Store 文件数据',
104109
importFileTips: '文件管理页面, 在某个文件左滑/右滑的更多项中, 点击导出图标按钮',

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ router.beforeResolve(async (to, from) => {
297297
// 进入编辑页面前查询是否存在订阅
298298
if (to.fullPath.startsWith('/edit/')) {
299299
const name = to.params.id as string;
300-
if (name !== 'UNTITLED') {
300+
if (!['UNTITLED', 'UNTITLED-mihomoProfile'].includes(name)) {
301301
try {
302302
if (to.params.editType === 'subs') {
303303
await useSubsApi().getOne('sub', name);

src/views/File.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@
4949
<span>{{ $t(`specificWord.file`) }}</span>
5050
</router-link>
5151
</li>
52-
<!-- <li>
53-
<router-link to="/edit/collections/UNTITLED" class="router-link">
54-
<svg-icon name="collectionSubs" />
55-
<span>{{ $t(`specificWord.collectionSub`) }}</span>
52+
<li>
53+
<router-link to="/edit/files/UNTITLED-mihomoProfile" class="router-link">
54+
<img src="@/assets/icons/clashmeta_color.png" alt="">
55+
<span>{{ $t(`filePage.type.mihomoProfile`) }}</span>
56+
<small>{{ $t(`filePage.type.mihomoProfileTips`) }}</small>
5657
</router-link>
57-
</li> -->
58+
</li>
5859
</ul>
5960
</nut-popup>
6061
</div>
@@ -476,7 +477,7 @@ const importTips = () => {
476477
}
477478
478479
.add-sub-panel-list {
479-
padding: 16px 0;
480+
padding: 10px 0;
480481
font-size: 16px;
481482
font-weight: bold;
482483
display: flex;
@@ -493,14 +494,21 @@ const importTips = () => {
493494
display: flex;
494495
flex-direction: column;
495496
align-items: center;
496-
justify-content: space-between;
497+
justify-content: flex-start;
497498
498-
> svg {
499+
> svg, > img {
499500
width: 44px;
500501
height: 44px;
501502
color: var(--primary-color);
502503
margin-bottom: 12px;
503504
}
505+
span {
506+
font-size: 14px;
507+
}
508+
small {
509+
font-size: 12px;
510+
color: var(--comment-text-color);
511+
}
504512
}
505513
}
506514
}

0 commit comments

Comments
 (0)