Skip to content

Commit

Permalink
feat: 增加链接参数说明在线文档; 优化同步配置图标点击跳转逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Jan 19, 2024
1 parent 1c9716c commit d155c3c
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 15 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.79",
"version": "2.14.80",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
9 changes: 7 additions & 2 deletions src/components/ArtifactsListItem.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<nut-swipe class="sub-item-swipe" ref="swipe" :disabled="$props.disabled">
<div class="sub-item-wrapper" :style="{'padding': isSimpleMode ? '9px' : '16px' }" @click.stop="previewSource">
<a class="sub-img-wrappers" :href="artifact.url" target="_blank">
<div class="sub-img-wrappers" @click.stop="openUrl">
<nut-avatar :class="{ 'sub-item-customer-icon': !isIconColor }" :size="isSimpleMode ? '36' : '48'" :url="icon" bg-color=""></nut-avatar>
</a>
</div>
<div class="sub-item-content">
<div class="sub-item-title-wrapper">
<h3 class="sub-item-title">
Expand Down Expand Up @@ -236,6 +236,11 @@ const sourceUrl = computed(() => {
}${encodeURIComponent(artifact.value.source)}${urlTarget}${urlIncludeUnsupportedProxy}`;
});
const openUrl = () => {
if (artifact.value.url) {
window.open(artifact.value.url);
}
}
const previewSource = () => {
if (!sourceUrl.value) {
return
Expand Down
27 changes: 17 additions & 10 deletions src/components/PreviewPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@
const { copy, isSupported } = useClipboard();
const { toClipboard: copyFallback } = useV3Clipboard();
const { showNotify } = useAppNotifyStore();
const { name, type, general, notify, tipsTitle, tipsContent, desc } = defineProps<{
const { name, type, general, notify, tipsTitle, tipsContent, desc,tipsCancelText, tipsOkText } = defineProps<{
name: string;
type: 'sub' | 'collection';
general: string;
notify: string;
desc: string;
tipsTitle?: string;
tipsContent?: string;
tipsCancelText?: string;
tipsOkText?: string;
}>();
const { currentUrl: host } = useHostAPI();
Expand Down Expand Up @@ -144,15 +146,20 @@
},
];
const tips = () => {
Dialog({
title: tipsTitle,
content: tipsContent,
popClass: 'auto-dialog',
okText: 'OK',
noCancelBtn: true,
closeOnPopstate: true,
lockScroll: false,
});
window.open('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');
// Dialog({
// title: tipsTitle,
// content: tipsContent,
// popClass: 'auto-dialog',
// onOk: () => {
// window.open('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');
// },
// okText: tipsOkText,
// cancelText: tipsCancelText,
// // noCancelBtn: true,
// closeOnPopstate: true,
// lockScroll: false,
// });
};
</script>
Expand Down
2 changes: 2 additions & 0 deletions src/components/SubListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@
tipsTitle: t(`subPage.panel.tips.title`),
tipsContent: `${t('subPage.panel.tips.content')}\n${t('syncPage.addArtForm.includeUnsupportedProxy.tips.content')}`,
desc: t(`subPage.panel.tips.desc`),
tipsOkText: t(`subPage.panel.tips.ok`),
tipsCancelText: t(`subPage.panel.tips.cancel`),
}),
onOpened: () => swipe.value.close(),
popClass: 'auto-dialog',
Expand Down
4 changes: 3 additions & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export default {
panel: {
general: 'General',
tips: {
ok: 'View Document',
cancel: 'Cancel',
desc: 'Subscription Link Parameters Description',
title: 'Subscription Link Parameters',
content: '"target=SurgeMac"\n+ ShadowsocksR/External Proxy Program\n\n"includeUnsupportedProxy=true"\nIncludes protocols not supported by the official/store version',
Expand Down Expand Up @@ -223,7 +225,7 @@ export default {
},
content: {
label: 'Content',
placeholder: 'The content of the subscription',
placeholder: 'The content of the subscription: 1. Multiple single-line proxy protocols/JSON/URI 2. Complete Base64/YAML',
},
icon: {
label: 'Icon',
Expand Down
4 changes: 3 additions & 1 deletion src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export default {
panel: {
general: '通用订阅',
tips: {
ok: '查看文档',
cancel: '取消',
desc: '订阅链接参数说明',
title: '订阅链接参数',
content: '"target=SurgeMac"\n+ ShadowsocksR/External Proxy Program\n\n"includeUnsupportedProxy=true" 包含官方/商店版不支持的协议',
Expand Down Expand Up @@ -223,7 +225,7 @@ export default {
},
content: {
label: '内容',
placeholder: '填入订阅内容',
placeholder: '填入订阅内容: 1. 多个单行的代理协议/JSON/URI 2. 完整 Base64/YAML',
},
icon: {
label: '图标链接',
Expand Down

0 comments on commit d155c3c

Please sign in to comment.