Skip to content

Commit

Permalink
feat: 支持自定义订阅流量信息(后端 > 2.14.248)
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Mar 11, 2024
1 parent 0980fb8 commit 4b45ad2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
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.158",
"version": "2.14.159",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ export default {
placeholder:
'The User-Agent for downloading resource(s)',
},
subUserinfo: {
label: 'Subscription-Userinfo',
placeholder: 'Set subscription usage info manually',
},
},
commonOptions: {
label: 'Common Settings',
Expand Down
4 changes: 4 additions & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ export default {
label: 'User-Agent',
placeholder: '下载时使用的 UA,不填使用默认',
},
subUserinfo: {
label: '订阅流量信息',
placeholder: '手动设置订阅流量信息',
},
},
commonOptions: {
label: '常用配置',
Expand Down
29 changes: 29 additions & 0 deletions src/views/SubEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,23 @@
/>
</nut-form-item>

<nut-form-item
:label="$t(`editorPage.subConfig.basic.subUserinfo.label`)"
prop="subUserinfo"
>

<nut-input
:border="false"
class="nut-input-text"
v-model.trim="form.subUserinfo"
:placeholder="$t(`editorPage.subConfig.basic.subUserinfo.placeholder`)"
type="text"
input-align="right"
left-icon="tips"
@click-left-icon="subUserinfoTips"
/>
</nut-form-item>

<nut-form-item
:label="$t(`editorPage.subConfig.basic.source.mergeSources`)"
prop="mergeSources"
Expand Down Expand Up @@ -352,6 +369,7 @@
form.displayName = sourceData.displayName || sourceData['display-name'];
form.icon = sourceData.icon;
form.process = newProcess;
form.subUserinfo = sourceData.subUserinfo;
switch (editType) {
case 'collections':
Expand Down Expand Up @@ -604,6 +622,17 @@
lockScroll: false,
});
};
const subUserinfoTips = () => {
Dialog({
title: '手动设置订阅流量信息',
content: '格式:\n\nupload=1024; download=10240; total=102400; expire=4115721600',
popClass: 'auto-dialog',
okText: 'OK',
noCancelBtn: true,
closeOnPopstate: true,
lockScroll: false,
});
};
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit 4b45ad2

Please sign in to comment.