Skip to content

Commit

Permalink
feat: 文件支持 Mihomo 配置, 支持使用覆写; target 名称适配大小写和别名
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 3, 2025
1 parent 856b8b3 commit 19abb83
Show file tree
Hide file tree
Showing 9 changed files with 335 additions and 248 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.319",
"version": "2.14.320",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ArtifactPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
class="artifact-radio-group"
>
<nut-radio label="Stash">Stash</nut-radio>
<nut-radio label="ClashMeta">Clash.Meta(mihomo)</nut-radio>
<nut-radio label="ClashMeta">Mihomo</nut-radio>
<nut-radio label="Clash">Clash(Deprecated)</nut-radio>
<nut-radio label="Egern">Egern</nut-radio>
<nut-radio label="Surfboard">Surfboard</nut-radio>
Expand Down
3 changes: 3 additions & 0 deletions src/components/FileListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@
import { useRouter, useRoute } from 'vue-router';
import { useHostAPI } from '@/hooks/useHostAPI';
import { useBackend } from "@/hooks/useBackend";
import clashmetaIcon from '@/assets/icons/clashmeta_color.png';
const { copy, isSupported } = useClipboard();
const { toClipboard: copyFallback } = useV3Clipboard();
Expand Down Expand Up @@ -291,6 +292,7 @@
})
const { flows } = storeToRefs(subsStore);
const icon = computed(() => {
if (props.file.type === 'mihomoProfile') return clashmetaIcon;
return appearanceSetting.value.isDefaultIcon ? logoIcon : logoRedIcon;
})
const collectionDetail = computed(() => {
Expand All @@ -309,6 +311,7 @@
});
const flow = computed(() => {
if (props.file.type === 'mihomoProfile') return t('filePage.type.mihomoProfile');
if (props.file.source === 'remote') return t('filePage.source.remote');
return t('filePage.source.local');
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/PreviewPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
icon: stash,
},
{
name: 'Clash.Meta(mihomo)',
name: 'Mihomo',
path: 'ClashMeta',
icon: clashmeta,
},
Expand Down
5 changes: 5 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
all: "All",
untagged: "Untagged",
or: "or",
type: "Type",
},
globalNotify: {
refresh: {
Expand Down Expand Up @@ -72,6 +73,10 @@ export default {
"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.",
},
filePage: {
type: {
mihomoProfile: 'Mihomo Profile',
mihomoProfileTips: 'Override is supported',
},
addFileTitle: "Create File",
importFileTitle: "Import File data",
importFileTips: "On the File Management page, click the Export icon button in the More items section of a file.",
Expand Down
5 changes: 5 additions & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default {
all: '全部',
untagged: '未分组',
or: '或',
type: '类型',
},
globalNotify: {
refresh: {
Expand Down Expand Up @@ -99,6 +100,10 @@ export default {
backendDesc: '如果你看到这个 可能是因为浏览器前端路由拦截的问题 可以强制刷新查看或直接使用该链接 不影响此链接的使用',
},
filePage: {
type: {
mihomoProfile: 'Mihomo 配置',
mihomoProfileTips: '可使用覆写',
},
addFileTitle: '创建文件',
importFileTitle: '导入 Sub-Store 文件数据',
importFileTips: '文件管理页面, 在某个文件左滑/右滑的更多项中, 点击导出图标按钮',
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ router.beforeResolve(async (to, from) => {
// 进入编辑页面前查询是否存在订阅
if (to.fullPath.startsWith('/edit/')) {
const name = to.params.id as string;
if (name !== 'UNTITLED') {
if (!['UNTITLED', 'UNTITLED-mihomoProfile'].includes(name)) {
try {
if (to.params.editType === 'subs') {
await useSubsApi().getOne('sub', name);
Expand Down
24 changes: 16 additions & 8 deletions src/views/File.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@
<span>{{ $t(`specificWord.file`) }}</span>
</router-link>
</li>
<!-- <li>
<router-link to="/edit/collections/UNTITLED" class="router-link">
<svg-icon name="collectionSubs" />
<span>{{ $t(`specificWord.collectionSub`) }}</span>
<li>
<router-link to="/edit/files/UNTITLED-mihomoProfile" class="router-link">
<img src="@/assets/icons/clashmeta_color.png" alt="">
<span>{{ $t(`filePage.type.mihomoProfile`) }}</span>
<small>{{ $t(`filePage.type.mihomoProfileTips`) }}</small>
</router-link>
</li> -->
</li>
</ul>
</nut-popup>
</div>
Expand Down Expand Up @@ -476,7 +477,7 @@ const importTips = () => {
}
.add-sub-panel-list {
padding: 16px 0;
padding: 10px 0;
font-size: 16px;
font-weight: bold;
display: flex;
Expand All @@ -493,14 +494,21 @@ const importTips = () => {
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
justify-content: flex-start;
> svg {
> svg, > img {
width: 44px;
height: 44px;
color: var(--primary-color);
margin-bottom: 12px;
}
span {
font-size: 14px;
}
small {
font-size: 12px;
color: var(--comment-text-color);
}
}
}
}
Expand Down
Loading

0 comments on commit 19abb83

Please sign in to comment.