Skip to content

Commit fa108be

Browse files
committed
feat: 配置改版, 支持前端配置和缓存配置(后端>=2.21.0)
1 parent 4af0447 commit fa108be

File tree

12 files changed

+374
-38
lines changed

12 files changed

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

src/assets/icons/concurrency.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading

src/hooks/useHostAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export const useHostAPI = () => {
173173
.map(i => i.split('='))
174174
.find(i => i[0] === 'timeout');
175175
if (timeout) {
176-
const value = parseInt(timeout[1], 10);
176+
const value = Number(timeout[1]);
177177
if (!isNaN(value)) {
178178
if (value > 0) {
179179
console.log(`设置超时 ${value}`)

src/locales/en.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,13 @@ export default {
597597
githubProxy: "Please input GitHub Proxy",
598598
defaultUserAgent: "Please input Default User-Agent",
599599
defaultProxy: "Please input Default Proxy/Policy",
600-
defaultTimeout: "Default Timeout (in milliseconds, default: 8000)",
600+
defaultTimeout: "Default Timeout (in ms, default: 8000)",
601601
cacheThreshold: "Cache Threshold (in KB, default: 1024)",
602+
resourceCacheTtl: 'Resource Cache TTL, default: 3600(s)',
603+
headersCacheTtl: 'Headers Cache TTL, default: 60(s)',
604+
scriptCacheTtl: 'Script Cache TTL, default: 172800(s)',
605+
concurrency: 'Concurrency Limit(default: 3)',
606+
apiCheckTimeout: 'API Check Timeout, default: 3000(ms)',
602607
noGithubUser: "Not set GitHub username",
603608
noGistToken: "Not set Gist Token",
604609
noGithubProxy: "Not set GitHub Proxy",
@@ -636,7 +641,10 @@ export default {
636641
failed: "Sort failed",
637642
},
638643
},
639-
config: "Configuration",
644+
requestConfig: "Request Configuration",
645+
cacheConfig: "Cache Configuration",
646+
frontEndConfig: "Front-End Configuration",
647+
githubConfig: 'GitHub Configuration',
640648
storage: {
641649
gist: {
642650
label: "Gist",

src/locales/zh.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,11 @@ export default {
594594
defaultProxy: '请输入默认代理/策略',
595595
defaultTimeout: '默认超时(单位: 毫秒, 默认: 8000)',
596596
cacheThreshold: '缓存阈值(单位: KB, 默认: 1024)',
597+
resourceCacheTtl: '资源缓存(单位: 秒, 默认: 3600)',
598+
headersCacheTtl: '响应头缓存(单位: 秒, 默认: 60)',
599+
scriptCacheTtl: '脚本缓存(单位: 秒, 默认: 172800)',
600+
concurrency: '并发数(默认: 3)',
601+
apiCheckTimeout: 'API 检测超时(单位: 毫秒, 默认: 3000)',
597602
noGithubUser: '未配置 GitHub 用户名',
598603
noGistToken: '未配置 GitHub 令牌',
599604
noGithubProxy: '未配置 GitHub 加速代理',
@@ -631,7 +636,10 @@ export default {
631636
save: '保存',
632637
clear: '清空',
633638
},
634-
config: '配置',
639+
requestConfig: "请求配置",
640+
cacheConfig: "缓存配置",
641+
frontEndConfig: "前端配置",
642+
githubConfig: 'GitHub 配置',
635643
storage: {
636644
gist: {
637645
label: 'Gist 同步',

src/store/global.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ export const useGlobalStore = defineStore('globalStore', {
3131
savedPositions: {},
3232
defaultIconCollection: localStorage.getItem('defaultIconCollection') || '',
3333
defaultIconCollections: [
34-
{
35-
text: "cc63/ICON",
36-
value: "https://raw.githubusercontent.com/cc63/ICON/main/icons.json",
37-
},
3834
{
3935
text: "Koolson/QureColor",
4036
value:
@@ -66,6 +62,10 @@ export const useGlobalStore = defineStore('globalStore', {
6662
value:
6763
"https://raw.githubusercontent.com/Twoandz9/TheMagic-Icons/main/TheRaw.json",
6864
},
65+
{
66+
text: "cc63/ICON",
67+
value: "https://raw.githubusercontent.com/cc63/ICON/main/icons.json",
68+
},
6969
{
7070
text: "lige47/QuanX-icon-rule",
7171
value:

src/store/settings.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const useSettingsStore = defineStore("settingsStore", {
2121
defaultProxy: "",
2222
defaultTimeout: "",
2323
cacheThreshold: "",
24+
resourceCacheTtl: "",
25+
headersCacheTtl: "",
26+
scriptCacheTtl: "",
2427
syncTime: 0,
2528
theme: {
2629
auto: true,
@@ -112,6 +115,9 @@ export const useSettingsStore = defineStore("settingsStore", {
112115
this.defaultUserAgent = res.data.data.defaultUserAgent || "";
113116
this.defaultTimeout = res.data.data.defaultTimeout || "";
114117
this.cacheThreshold = res.data.data.cacheThreshold || "";
118+
this.resourceCacheTtl = res.data.data.resourceCacheTtl || "";
119+
this.headersCacheTtl = res.data.data.headersCacheTtl || "";
120+
this.scriptCacheTtl = res.data.data.scriptCacheTtl || "";
115121
this.avatarUrl = res.data.data.avatarUrl || "";
116122
this.artifactStore = res.data.data.artifactStore || "";
117123
this.artifactStoreStatus = res.data.data.artifactStoreStatus || "";

0 commit comments

Comments
 (0)