diff --git a/package.json b/package.json index 98c153e90..dfbde36b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.38", + "version": "2.14.40", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index 4e1aa60e8..d7e8c579b 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -37,7 +37,10 @@
+ + + {{ flow }} + + +
+ + + ++ + + {{ flow }} + + +
+ @@ -222,65 +243,8 @@ }); const flow = computed(() => { - if (props.type === 'sub') { - const urlList = Object.keys(flows.value); - if (props.sub.source === 'local') return t('subPage.subItem.local'); - if (isFlowFetching.value && !urlList.includes(props.sub.url)) - return t('subPage.subItem.loading'); - - const target = toRaw(flows.value[props.sub.url]); - if (!target) { - return { - firstLine: t('subPage.subItem.noRecord'), - secondLine: ``, - }; - } - - if (target.status === 'success') { - const { - expires, - total, - usage: { upload, download }, - } = target.data; - - let secondLine: string; - if (isSimpleMode.value) { - secondLine = !expires - ? '' - : `${dayjs.unix(expires).format('YYYY-MM-DD')}`; - return { - firstLine: `${getString(upload + download, total, 'B')}`, - secondLine, - }; - } else { - secondLine = !expires - ? t('subPage.subItem.noExpiresInfo') - : `${t('subPage.subItem.expires')}:${dayjs - .unix(expires) - .format('YYYY-MM-DD')}`; - return { - firstLine: `${t('subPage.subItem.flow')}:${getString( - upload + download, - total, - 'B' - )}`, - secondLine, - }; - } - } else if (target?.status === 'failed') { - if (target.error.code === 'NO_FLOW_INFO') { - return { - firstLine: t('subPage.subItem.noFlowInfo'), - secondLine: ``, - }; - } else { - return { - firstLine: `${target.error?.type}`, - secondLine: `${target.error?.message}`, - }; - } - } - } + if (props.file.source === 'remote') return t('filePage.source.remote'); + return t('filePage.source.local'); }); const closePreview = () => { diff --git a/src/locales/en.ts b/src/locales/en.ts index bfeec594b..2c22ccace 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -68,6 +68,12 @@ export default { content: { placeholder: 'The content of the file' }, + url: { + label: 'URL', + placeholder: 'URL (please separate multiple urls with a new line)', + isEmpty: 'URL cannot be empty', + isIllegal: 'Invalid URL', + }, copyNotify: { succeed: 'Successfully copied link!\nIf you use it internally, just {path}', failed: 'Failed to copy file link!\n{e}', @@ -77,6 +83,13 @@ export default { desc: 'After adding you can enjoy the love of YM Peng', btn: 'Create File Now', }, + source: { + local: 'Local', + remote: 'Remote', + }, + ignoreFailedRemoteFile: { + label: 'Ignore failed remote file(s)' + }, }, // subscription management page subPage: { @@ -120,7 +133,7 @@ export default { }, }, copyNotify: { - succeed: 'Successfully copied link!\nYou can paste in Proxy Tool now!', + succeed: 'Successfully copied link!', failed: 'Failed to copy subscription link!\n{e}', }, copyConfigNotify: { @@ -214,7 +227,7 @@ export default { ua: { label: 'User-Agent', placeholder: - 'The User-Agent for downloading the original subscription', + 'The User-Agent for downloading resource(s)', }, }, commonOptions: { diff --git a/src/locales/zh.ts b/src/locales/zh.ts index e65311f97..6d03d3ed5 100644 --- a/src/locales/zh.ts +++ b/src/locales/zh.ts @@ -68,6 +68,12 @@ export default { content: { placeholder: '填入文件内容' }, + url: { + label: '链接', + placeholder: '链接(多个链接请换行)', + isEmpty: '链接不能为空', + isIllegal: '链接格式非法', + }, copyNotify: { succeed: '复制文件链接成功\n如果你只在内部使用, 仅需 {path}', failed: '复制文件链接失败\n{e}', @@ -77,6 +83,13 @@ export default { desc: '添加后开始使用文件', btn: '立即添加', }, + source: { + local: '本地', + remote: '远程', + }, + ignoreFailedRemoteFile: { + label: '忽略失败的远程文件' + }, }, // 订阅管理页 subPage: { @@ -213,7 +226,7 @@ export default { }, ua: { label: 'User-Agent', - placeholder: '下载订阅使用的 UA,不填使用默认', + placeholder: '下载时使用的 UA,不填使用默认', }, }, commonOptions: { @@ -497,7 +510,7 @@ export default { }, }, copyNotify: { - succeed: '复制 Gist 链接成功\n可以前往代理工具使用咯~', + succeed: '复制 Gist 链接成功', failed: '复制 Gist 链接失败\n{e}', }, addArtForm: { diff --git a/src/views/FileEditor.vue b/src/views/FileEditor.vue index 8eadeff96..b7fc78364 100644 --- a/src/views/FileEditor.vue +++ b/src/views/FileEditor.vue @@ -53,7 +53,49 @@ type="text" /> +