Skip to content

Commit 4cd16b6

Browse files
committed
feat: 忽略失败的远程选择支持开启通知(后端 >= 2.19.31)
1 parent 8a1d61c commit 4cd16b6

File tree

5 files changed

+71
-7
lines changed

5 files changed

+71
-7
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.15.16",
3+
"version": "2.15.17",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/locales/en.ts

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ export default {
114114
},
115115
ignoreFailedRemoteFile: {
116116
label: "Ignore failed remote file(s)",
117+
quiet: 'Enabled (without notification)',
118+
disabled: 'Disabled',
119+
enabled : 'Enabled (with notification)'
117120
},
118121
download: {
119122
label: "Enable download (filename: display name)",
@@ -320,6 +323,9 @@ export default {
320323
},
321324
ignoreFailedRemoteSub: {
322325
label: "Ignore failed remote subscription(s)",
326+
quiet: 'Enabled (without notification)',
327+
disabled: 'Disabled',
328+
enabled : 'Enabled (with notification)'
323329
},
324330
ua: {
325331
label: "User-Agent",

src/locales/zh.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ export default {
138138
remote: '远程',
139139
},
140140
ignoreFailedRemoteFile: {
141-
label: '忽略失败的远程文件'
141+
label: '忽略失败的远程文件',
142+
quiet: '启用(无通知)',
143+
disabled: '禁用',
144+
enabled : '启用(有通知)'
142145
},
143146
download: {
144147
label: '启用下载(文件名为显示名称)'
@@ -337,7 +340,10 @@ export default {
337340
placeholder: '可点击左侧或顶部图标, 从图标库填入图标链接,不要使用 jpg',
338341
},
339342
ignoreFailedRemoteSub: {
340-
label: '忽略失败的远程订阅'
343+
label: '忽略失败的远程订阅',
344+
quiet: '启用(无通知)',
345+
disabled: '禁用',
346+
enabled : '启用(有通知)'
341347
},
342348
ua: {
343349
label: 'User-Agent',

src/views/FileEditor.vue

+28-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,22 @@
310310
prop="ignoreFailedRemoteFile"
311311
class="ignore-failed-wrapper"
312312
>
313-
<div class="switch-wrapper">
313+
<!-- <div class="switch-wrapper">
314314
<nut-switch v-model="form.ignoreFailedRemoteFile" />
315+
</div> -->
316+
<div class="radio-wrapper">
317+
<nut-radiogroup direction="horizontal" v-model="form.ignoreFailedRemoteFile">
318+
<nut-radio shape="button" label="disabled">
319+
{{ $t(`filePage.ignoreFailedRemoteFile.disabled`) }}
320+
</nut-radio>
321+
<nut-radio shape="button" label="quiet">
322+
{{ $t(`filePage.ignoreFailedRemoteFile.quiet`) }}
323+
</nut-radio>
324+
<nut-radio shape="button" label="enabled">
325+
{{ $t(`filePage.ignoreFailedRemoteFile.enabled`) }}
326+
</nut-radio>
327+
328+
</nut-radiogroup>
315329
</div>
316330
</nut-form-item>
317331
</template>
@@ -526,7 +540,13 @@ watchEffect(() => {
526540
form.mergeSources = sourceData.mergeSources;
527541
form.content = sourceData.content;
528542
cmStore.setEditCode("FileEditer", sourceData.content);
529-
form.ignoreFailedRemoteFile = sourceData.ignoreFailedRemoteFile;
543+
let ignoreFailedRemoteFile = sourceData.ignoreFailedRemoteFile;
544+
if (ignoreFailedRemoteFile === true) {
545+
ignoreFailedRemoteFile = 'quiet';
546+
} else if (ignoreFailedRemoteFile === false || ignoreFailedRemoteFile == null) {
547+
ignoreFailedRemoteFile = 'disabled';
548+
}
549+
form.ignoreFailedRemoteFile = ignoreFailedRemoteFile;
530550
form.download = sourceData.download;
531551
const newProcess = JSON.parse(JSON.stringify(sourceData.process));
532552
form.process = newProcess;
@@ -635,6 +655,9 @@ const compare = () => {
635655
Toast.loading("生成中...", { id: "compare", cover: true, duration: 1500 });
636656
const data: any = JSON.parse(JSON.stringify(toRaw(form)));
637657
data.process = actionsToProcess(data.process, actionsList, ignoreList);
658+
if (data.ignoreFailedRemoteFile === "disabled"){
659+
data.ignoreFailedRemoteFile = false;
660+
}
638661
639662
// 过滤掉预览开关关闭的操作
640663
actionsChecked.forEach((item) => {
@@ -696,6 +719,9 @@ const submit = () => {
696719
const data: any = JSON.parse(JSON.stringify(toRaw(form)));
697720
data["display-name"] = data.displayName;
698721
data.process = actionsToProcess(data.process, actionsList, ignoreList);
722+
if (data.ignoreFailedRemoteFile === "disabled"){
723+
data.ignoreFailedRemoteFile = false;
724+
}
699725
700726
let res = null;
701727

src/views/SubEditor.vue

+28-2
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,22 @@
388388
prop="ignoreFailedRemoteSub"
389389
class="ignore-failed-wrapper"
390390
>
391-
<div class="switch-wrapper">
391+
<!-- <div class="switch-wrapper">
392392
<nut-switch v-model="form.ignoreFailedRemoteSub" />
393+
</div> -->
394+
<div class="radio-wrapper">
395+
<nut-radiogroup direction="horizontal" v-model="form.ignoreFailedRemoteSub">
396+
<nut-radio shape="button" label="disabled">
397+
{{ $t(`editorPage.subConfig.basic.ignoreFailedRemoteSub.disabled`) }}
398+
</nut-radio>
399+
<nut-radio shape="button" label="quiet">
400+
{{ $t(`editorPage.subConfig.basic.ignoreFailedRemoteSub.quiet`) }}
401+
</nut-radio>
402+
<nut-radio shape="button" label="enabled">
403+
{{ $t(`editorPage.subConfig.basic.ignoreFailedRemoteSub.enabled`) }}
404+
</nut-radio>
405+
406+
</nut-radiogroup>
393407
</div>
394408
</nut-form-item>
395409
</nut-form>
@@ -639,7 +653,13 @@ watchEffect(() => {
639653
const sourceData: any = toRaw(sub.value) || toRaw(collection.value);
640654
const newProcess = JSON.parse(JSON.stringify(sourceData.process));
641655
form.mergeSources = sourceData.mergeSources;
642-
form.ignoreFailedRemoteSub = sourceData.ignoreFailedRemoteSub;
656+
let ignoreFailedRemoteSub = sourceData.ignoreFailedRemoteSub;
657+
if (ignoreFailedRemoteSub === true) {
658+
ignoreFailedRemoteSub = 'quiet';
659+
} else if (ignoreFailedRemoteSub === false || ignoreFailedRemoteSub == null) {
660+
ignoreFailedRemoteSub = 'disabled';
661+
}
662+
form.ignoreFailedRemoteSub = ignoreFailedRemoteSub;
643663
form.passThroughUA = sourceData.passThroughUA;
644664
form.name = sourceData.name;
645665
form.displayName = sourceData.displayName || sourceData["display-name"];
@@ -799,6 +819,9 @@ const compare = () => {
799819
});
800820
const data: any = JSON.parse(JSON.stringify(toRaw(form)));
801821
data.process = actionsToProcess(data.process, actionsList, ignoreList);
822+
if (data.ignoreFailedRemoteSub === "disabled"){
823+
data.ignoreFailedRemoteSub = false;
824+
}
802825
data.tag = [
803826
...new Set(
804827
(data.tag || "")
@@ -901,6 +924,9 @@ const submit = () => {
901924
];
902925
data["display-name"] = data.displayName;
903926
data.process = actionsToProcess(data.process, actionsList, ignoreList);
927+
if (data.ignoreFailedRemoteSub === "disabled"){
928+
data.ignoreFailedRemoteSub = false;
929+
}
904930
905931
console.log('submit.....\n', data);
906932

0 commit comments

Comments
 (0)