From 4c2a24b0708e421bfc938b22786598ca3b65401a Mon Sep 17 00:00:00 2001 From: ali rahimi Date: Tue, 26 Dec 2023 16:28:22 +0100 Subject: [PATCH] added datepicker option in setting page jalalian datepicker component was added translate files for datepicker updated --- sub/subService.go | 5 +++++ web/assets/js/model/setting.js | 1 + web/entity/entity.go | 1 + web/html/xui/client_bulk_modal.html | 7 ++++++- web/html/xui/client_modal.html | 3 +++ web/html/xui/form/client.html | 4 +++- web/html/xui/form/inbound.html | 4 +++- web/html/xui/inbound_modal.html | 3 +++ web/html/xui/inbounds.html | 4 ++++ web/html/xui/settings.html | 28 ++++++++++++++++++++++++++ web/service/setting.go | 6 ++++++ web/translation/translate.en_US.toml | 2 ++ web/translation/translate.es_ES.toml | 2 ++ web/translation/translate.fa_IR.toml | 2 ++ web/translation/translate.ru_RU.toml | 2 ++ web/translation/translate.vi_VN.toml | 2 ++ web/translation/translate.zh_Hans.toml | 2 ++ 17 files changed, 75 insertions(+), 3 deletions(-) diff --git a/sub/subService.go b/sub/subService.go index 332f8150..ddf9692b 100644 --- a/sub/subService.go +++ b/sub/subService.go @@ -20,6 +20,7 @@ type SubService struct { address string showInfo bool remarkModel string + datepicker string inboundService service.InboundService settingService service.SettingService } @@ -39,6 +40,10 @@ func (s *SubService) GetSubs(subId string, host string, showInfo bool) ([]string if err != nil { s.remarkModel = "-ieo" } + s.datepicker, err = s.settingService.GetDatepicker() + if err != nil { + s.datepicker = "gregorian" + } for _, inbound := range inbounds { clients, err := s.inboundService.GetClients(inbound) if err != nil { diff --git a/web/assets/js/model/setting.js b/web/assets/js/model/setting.js index 86bea983..3ddddb18 100644 --- a/web/assets/js/model/setting.js +++ b/web/assets/js/model/setting.js @@ -12,6 +12,7 @@ class AllSetting { this.expireDiff = ""; this.trafficDiff = ""; this.remarkModel = "-ieo"; + this.datepicker = "gregorian"; this.tgBotEnable = false; this.tgBotToken = ""; this.tgBotChatId = ""; diff --git a/web/entity/entity.go b/web/entity/entity.go index 69e5b2d4..5b09400c 100644 --- a/web/entity/entity.go +++ b/web/entity/entity.go @@ -47,6 +47,7 @@ type AllSetting struct { SubEncrypt bool `json:"subEncrypt" form:"subEncrypt"` SubShowInfo bool `json:"subShowInfo" form:"subShowInfo"` SubURI string `json:"subURI" form:"subURI"` + Datepicker string `json:"datepicker" form:"datepicker"` } func (s *AllSetting) CheckValid() error { diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index 75e9bf6b..c951bc8d 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -104,8 +104,10 @@ - + - + Expired diff --git a/web/html/xui/form/inbound.html b/web/html/xui/form/inbound.html index 6f0480c3..5da8ec56 100644 --- a/web/html/xui/form/inbound.html +++ b/web/html/xui/form/inbound.html @@ -54,9 +54,11 @@ - + diff --git a/web/html/xui/inbound_modal.html b/web/html/xui/inbound_modal.html index f7f9d727..ab42e09c 100644 --- a/web/html/xui/inbound_modal.html +++ b/web/html/xui/inbound_modal.html @@ -63,6 +63,9 @@ get client() { return inModal.inbound.clients[0]; }, + get datepicker() { + return app.datepicker; + }, get delayedExpireDays() { return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0; }, diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html index 2be031e5..8d1da2f4 100644 --- a/web/html/xui/inbounds.html +++ b/web/html/xui/inbounds.html @@ -446,6 +446,7 @@ {{template "component/themeSwitcher" .}} +{{template "component/persianDatepicker" .}}