From 8a2cb5a9fa7adee5cbca1e8801d5fc3852381aa0 Mon Sep 17 00:00:00 2001 From: xream Date: Sun, 10 Mar 2024 23:09:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=89=A9=E4=BD=99=E9=87=8D=E7=BD=AE=E5=A4=A9=E6=95=B0(?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=20>=202.14.246=20=E4=B8=94=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=86=20resetDay)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/ArtifactsListItem.vue | 2 +- src/components/FileListItem.vue | 2 +- src/components/SubListItem.vue | 29 +++++++++++++++++++--------- src/locales/en.ts | 4 +++- src/locales/zh.ts | 6 ++++-- src/types/store/subsStore.d.ts | 3 ++- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 5bf577f6a..bcb1f50be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.14.156", + "version": "2.14.157", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/components/ArtifactsListItem.vue b/src/components/ArtifactsListItem.vue index 6848d69de..f77f64031 100644 --- a/src/components/ArtifactsListItem.vue +++ b/src/components/ArtifactsListItem.vue @@ -537,7 +537,7 @@ watch(isSyncOpen, async () => { flex-shrink: 0; width: 56px; height: 56px; - margin-right: 20px; + margin-right: 15px; border-radius: 12px; img { diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index 9792fc226..9054c10de 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -397,7 +397,7 @@ flex-shrink: 0; width: 56px; height: 56px; - margin-right: 20px; + margin-right: 15px; border-radius: 12px; img { diff --git a/src/components/SubListItem.vue b/src/components/SubListItem.vue index df7552665..0839cbda3 100644 --- a/src/components/SubListItem.vue +++ b/src/components/SubListItem.vue @@ -116,10 +116,12 @@

@@ -273,7 +275,7 @@ const collectionDetail = computed(() => { const sub = subsStore.getOneSub(name); return sub?.displayName || sub?.["display-name"] || sub.name; }); - return `${t("subPage.collectionItem.contain")}:${displayNameList.join( + return `${t("subPage.collectionItem.contain")}: ${displayNameList.join( "、" )}`; } @@ -302,6 +304,7 @@ const flow = computed(() => { }; } else if (target.status === "success") { const { + remainingDays, expires, total, usage: { upload, download }, @@ -316,22 +319,30 @@ const flow = computed(() => { } let secondLine: string; if (isSimpleMode.value) { - secondLine = !expires + secondLine = remainingDays ? `${remainingDays}${t( + "subPage.subItem.remainingDaysUnit" + )}` : '' + const expiresInfo = !expires ? "" : `${dayjs.unix(expires).format("YYYY-MM-DD")}`; + secondLine = secondLine ? `${secondLine} | ${expiresInfo}` : expiresInfo; return { firstLine: `${getString(upload + download, total, "B")}`, secondLine, progress }; } else { - secondLine = !expires + secondLine = remainingDays ? `${t("subPage.subItem.remainingDays")}: ${remainingDays}${t( + "subPage.subItem.remainingDaysUnit" + )}` : '' + const expiresInfo = !expires ? t("subPage.subItem.noExpiresInfo") - : `${t("subPage.subItem.expires")}:${dayjs + : `${t("subPage.subItem.expires")}: ${dayjs .unix(expires) .format("YYYY-MM-DD")}`; + secondLine = secondLine ? `${secondLine} | ${expiresInfo}` : expiresInfo; return { - firstLine: `${t("subPage.subItem.flow")}:${getString( + firstLine: `${t("subPage.subItem.flow")}: ${getString( upload + download, total, "B" @@ -568,7 +579,7 @@ const onClickRefresh = async () => { flex-shrink: 0; width: 56px; height: 56px; - margin-right: 20px; + margin-right: 15px; border-radius: 12px; img { diff --git a/src/locales/en.ts b/src/locales/en.ts index 5ceff1e11..065d6dedd 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -122,6 +122,8 @@ export default { loading: 'Loading...', flow: 'Usage / Total', expires: 'Expires', + remainingDays: 'Remaining Reset Days', + remainingDaysUnit: '', noRecord: 'Refresh to get usage', noFlow: 'No flow', noFlowInfo: 'No flow info', @@ -217,7 +219,7 @@ export default { }, url: { label: 'URL', - placeholder: 'Subscription URL (please separate multiple subscriptions with a new line). Supported parameters: validCheck - error will be reported when expired or there is no remaining traffic, noFlow - do not query for flow, noCache - do not use cache. For example: http://a.com?token=1#noFlow&noCache', + placeholder: 'Subscription URL (please separate multiple subscriptions with a new line). Supported parameters: validCheck - error will be reported when expired or there is no remaining traffic, resetDay - the day when monthly data usage resets, noFlow - do not query for flow, noCache - do not use cache. For example: http://a.com?token=1#noFlow&noCache or http://a.com?token=1#resetDay=15', isEmpty: 'URL cannot be empty', isIllegal: 'Invalid URL', }, diff --git a/src/locales/zh.ts b/src/locales/zh.ts index 03b2770d4..ad65df104 100644 --- a/src/locales/zh.ts +++ b/src/locales/zh.ts @@ -120,7 +120,9 @@ export default { local: '本地订阅', loading: '加载中...', flow: '已用/总流量', - expires: '到期时间', + expires: '到期', + remainingDays: '重置', + remainingDaysUnit: ' 天', noRecord: '刷新后可获取流量情况', noFlow: '不查询流量', noFlowInfo: '无流量信息', @@ -217,7 +219,7 @@ export default { }, url: { label: '链接', - placeholder: '订阅链接(多个订阅请换行) 支持参数: validCheck 过期或无剩余流量时报错, noFlow 不查询流量, noCache 不使用缓存. 例: http://a.com?token=1#noFlow&noCache', + placeholder: '订阅链接(多个订阅请换行) 支持参数: validCheck 过期或无剩余流量时报错, resetDay 每月流量重置日, noFlow 不查询流量, noCache 不使用缓存. 例: http://a.com?token=1#noFlow&noCache 或 http://a.com?token=1#resetDay=15', isEmpty: '订阅链接不能为空', isIllegal: '订阅链接格式非法', }, diff --git a/src/types/store/subsStore.d.ts b/src/types/store/subsStore.d.ts index 4117ab4ea..56679b5bd 100644 --- a/src/types/store/subsStore.d.ts +++ b/src/types/store/subsStore.d.ts @@ -61,7 +61,8 @@ interface Artifacts { interface Flow { status: 'success' | 'noFlow'; data: { - expires: number; + remainingDays?: number; + expires?: number; total: number; usage: { upload: number;