diff options
Diffstat (limited to 'web')
| -rw-r--r-- | web/assets/js/subscription.js | 4 | ||||
| -rw-r--r-- | web/html/settings/panel/subscription/subpage.html | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/web/assets/js/subscription.js b/web/assets/js/subscription.js index d08bfd28..aa09e1c4 100644 --- a/web/assets/js/subscription.js +++ b/web/assets/js/subscription.js @@ -7,6 +7,7 @@ const data = { sId: el.getAttribute('data-sid') || '', + enabled: (el.getAttribute('data-enabled') || '').toLowerCase() === 'true', subUrl: el.getAttribute('data-sub-url') || '', subJsonUrl: el.getAttribute('data-subjson-url') || '', subClashUrl: el.getAttribute('data-subclash-url') || '', @@ -128,9 +129,10 @@ }, isActive() { const now = Date.now(); + const enabledOk = this.app.enabled; const expiryOk = !this.app.expireMs || this.app.expireMs >= now; const trafficOk = !this.app.totalByte || (this.app.uploadByte + this.app.downloadByte) <= this.app.totalByte; - return expiryOk && trafficOk; + return enabledOk && expiryOk && trafficOk; }, shadowrocketUrl() { const rawUrl = this.app.subUrl + '?flag=shadowrocket'; diff --git a/web/html/settings/panel/subscription/subpage.html b/web/html/settings/panel/subscription/subpage.html index 48f0ecfb..adfbea93 100644 --- a/web/html/settings/panel/subscription/subpage.html +++ b/web/html/settings/panel/subscription/subpage.html @@ -153,7 +153,10 @@ app.sId ]]</a-descriptions-item> <a-descriptions-item label='{{ i18n "subscription.status" }}'> - <template v-if="isUnlimited"> + <template v-if="!app.enabled"> + <a-tag color="red">{{ i18n "subscription.inactive" }}</a-tag> + </template> + <template v-else-if="isUnlimited"> <a-tag color="purple">{{ i18n "subscription.unlimited" }}</a-tag> </template> @@ -275,7 +278,7 @@ data-subclash-url="{{ .subClashUrl }}" data-download="{{ .download }}" data-upload="{{ .upload }}" data-used="{{ .used }}" data-total="{{ .total }}" data-remained="{{ .remained }}" data-expire="{{ .expire }}" data-lastonline="{{ .lastOnline }}" data-downloadbyte="{{ .downloadByte }}" data-uploadbyte="{{ .uploadByte }}" - data-totalbyte="{{ .totalByte }}" data-datepicker="{{ .datepicker }}"></template> + data-totalbyte="{{ .totalByte }}" data-datepicker="{{ .datepicker }}" data-enabled="{{ .enabled }}"></template> <textarea id="subscription-links" style="display:none">{{ range .result }}{{ . }} {{ end }}</textarea> |
