diff options
| author | Shishkevich D. <135337715+shishkevichd@users.noreply.github.com> | 2025-03-06 13:17:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-06 13:17:25 +0300 |
| commit | c13db7922edd401c57a3077090af3816aed25373 (patch) | |
| tree | a3a9c7df2c429eb6612f512571b0501cab94de1a | |
| parent | d6d05a9b4d575fdcd43417cddb3a6e6c7cc2119c (diff) | |
Pretty Panel and Xray settings (#2726)
* chore: refactor `setting-list-item` component
* chore: remove padding
* chore: replace settings list with settings collapse panels
* chore: add missing translations
* chore: fix translation
| -rw-r--r-- | web/html/xui/component/setting.html | 50 | ||||
| -rw-r--r-- | web/html/xui/settings.html | 822 | ||||
| -rw-r--r-- | web/html/xui/xray.html | 470 | ||||
| -rw-r--r-- | web/translation/translate.en_US.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.es_ES.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.fa_IR.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.id_ID.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.ja_JP.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.pt_BR.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.ru_RU.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.tr_TR.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.uk_UA.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.vi_VN.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.zh_CN.toml | 12 | ||||
| -rw-r--r-- | web/translation/translate.zh_TW.toml | 12 |
15 files changed, 841 insertions, 645 deletions
diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/setting.html index 8adc000c..bc2c6e42 100644 --- a/web/html/xui/component/setting.html +++ b/web/html/xui/component/setting.html @@ -1,26 +1,18 @@ {{define "component/settingListItem"}} -<a-list-item style="padding: 20px"> - <a-row v-if="type === 'textarea'"> - <a-col> - <a-list-item-meta :title="title" :description="desc"/> - <a-textarea class="ant-setting-textarea" :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10 }"></a-textarea> - <!--a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10, maxRows: 30 }"></a-textarea--> - </a-col> - </a-row> - <a-row v-else> +<a-list-item :style="{ padding: padding }"> + <a-row> <a-col :lg="24" :xl="12"> - <a-list-item-meta :title="title" :description="desc"/> + <a-list-item-meta> + <template #title> + <slot name="title"></slot> + </template> + <template #description> + <slot name="description"></slot> + </template> + </a-list-item-meta> </a-col> <a-col :lg="24" :xl="12"> - <template v-if="type === 'text'"> - <a-input :value="value" @input="$emit('input', $event.target.value)" :placeholder="placeholder"></a-input> - </template> - <template v-else-if="type === 'number'"> - <a-input-number :value="value" :step="step" @change="value => $emit('input', value)" :min="min" :max="max" style="width: 100%;"></a-input-number> - </template> - <template v-else-if="type === 'switch'"> - <a-switch :checked="value" @change="value => $emit('input', value)"></a-switch> - </template> + <slot name="control"></slot> </a-col> </a-row> </a-list-item> @@ -28,9 +20,21 @@ {{define "component/setting"}} <script> - Vue.component('setting-list-item', { - props: ["type", "title", "desc", "value", "min", "max" , "step", "placeholder"], - template: `{{template "component/settingListItem"}}`, - }); + Vue.component('a-setting-list-item', { + props: ["title", "description", "paddings"], + template: `{{ template "component/settingListItem" }}`, + computed: { + padding() { + switch (this.paddings) { + case "small": + return "10px 20px !important" + break; + default: + return "20px !important" + break; + } + } + } + }) </script> {{end}} diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 923a040c..1cccd28d 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -108,16 +108,17 @@ </a-row> </a-card> <a-tabs default-active-key="1"> - <a-tab-pane key="1" tab='{{ i18n "pages.settings.panelSettings"}}'> - <a-list item-layout="horizontal"> - <a-list-item> - <a-row style="padding: 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.remarkModel"}}'> - <template slot="description">{{ i18n "pages.settings.sampleRemark"}}: <i>#[[ remarkSample ]]</i></template> - </a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> + <a-tab-pane key="1" tab='{{ i18n "pages.settings.panelSettings" }}' style="padding-top: 20px;"> + <a-collapse> + <a-collapse-panel header='{{ i18n "pages.xray.generalConfigs"}}'> + <a-setting-list-item paddings="small"> + <template #title> + {{ i18n "pages.settings.remarkModel"}} + </template> + <template #description> + {{ i18n "pages.settings.sampleRemark"}}: <i>#[[ remarkSample ]]</i> + </template> + <template #control> <a-input-group style="width: 100%;"> <a-select style="padding-right: .5rem; min-width: 80%; width: auto;" mode="multiple" @@ -129,350 +130,523 @@ <a-select-option v-for="key in remarkSeparators" :value="key">[[ key ]]</a-select-option> </a-select> </a-input-group> - </a-col> - </a-row> - </a-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningIP"}}' desc='{{ i18n "pages.settings.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.panelListeningDomain"}}' desc='{{ i18n "pages.settings.panelListeningDomainDesc"}}' v-model="allSetting.webDomain"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.panelPort"}}' desc='{{ i18n "pages.settings.panelPortDesc"}}' v-model="allSetting.webPort" :min="1" :max="65531"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.publicKeyPath"}}' desc='{{ i18n "pages.settings.publicKeyPathDesc"}}' v-model="allSetting.webCertFile"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.privateKeyPath"}}' desc='{{ i18n "pages.settings.privateKeyPathDesc"}}' v-model="allSetting.webKeyFile"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.panelUrlPath"}}' desc='{{ i18n "pages.settings.panelUrlPathDesc"}}' v-model="allSetting.webBasePath"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.sessionMaxAge" }}' desc='{{ i18n "pages.settings.sessionMaxAgeDesc" }}' v-model="allSetting.sessionMaxAge" :min="60"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.pageSize" }}' desc='{{ i18n "pages.settings.pageSizeDesc" }}' v-model="allSetting.pageSize" :min="0" :step="5"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.expireTimeDiff" }}' desc='{{ i18n "pages.settings.expireTimeDiffDesc" }}' v-model="allSetting.expireDiff" :min="0"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.trafficDiff" }}' desc='{{ i18n "pages.settings.trafficDiffDesc" }}' v-model="allSetting.trafficDiff" :min="0"></setting-list-item> - <setting-list-item type="switch" title='{{ i18n "pages.settings.externalTrafficInformEnable"}}' desc='{{ i18n "pages.settings.externalTrafficInformEnableDesc"}}' v-model="allSetting.externalTrafficInformEnable"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.externalTrafficInformURI"}}' desc='{{ i18n "pages.settings.externalTrafficInformURIDesc"}}' v-model="allSetting.externalTrafficInformURI" placeholder="(http|https)://domain[:port]/path/"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.timeZone"}}' desc='{{ i18n "pages.settings.timeZoneDesc"}}' v-model="allSetting.timeLocation"></setting-list-item> - <a-list-item> - <a-row style="padding: 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.datepicker"}}'> - <template slot="description">{{ i18n "pages.settings.datepickerDescription"}}</template> - </a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-select style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme" v-model="datepicker"> - <a-select-option v-for="item in datepickerList" :value="item.value"> - <span v-text="item.name"></span> - </a-select-option> - </a-select> - </template> - </a-col> - </a-row> - </a-list-item> - <a-list-item> - <a-row style="padding: 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title="Language"></a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-select ref="selectLang" - v-model="lang" - @change="setLang(lang)" - :dropdown-class-name="themeSwitcher.currentTheme" - style="width: 100%"> - <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> - <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> - </a-select-option> - </a-select> - </template> - </a-col> - </a-row> - </a-list-item> - </a-list> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.panelListeningIP"}}</template> + <template #description>{{ i18n "pages.settings.panelListeningIPDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.webListen"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.panelListeningDomain"}}</template> + <template #description>{{ i18n "pages.settings.panelListeningDomainDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.webDomain"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.panelPort"}}</template> + <template #description>{{ i18n "pages.settings.panelPortDesc"}}</template> + <template #control> + <a-input-number :min="1" :min="65531" v-model="allSetting.webPort" style="width: 100%;"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.panelUrlPath"}}</template> + <template #description>{{ i18n "pages.settings.panelUrlPathDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.webBasePath"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.sessionMaxAge" }}</template> + <template #description>{{ i18n "pages.settings.sessionMaxAgeDesc" }}</template> + <template #control> + <a-input-number :min="60" v-model="allSetting.sessionMaxAge" style="width: 100%;"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.pageSize" }}</template> + <template #description>{{ i18n "pages.settings.pageSizeDesc" }}</template> + <template #control> + <a-input-number :min="0" step="5" v-model="allSetting.pageSize" style="width: 100%;"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.language"}}</template> + <template #control> + <a-select ref="selectLang" + v-model="lang" + @change="setLang(lang)" + :dropdown-class-name="themeSwitcher.currentTheme" + style="width: 100%"> + <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> + <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> + </a-select-option> + </a-select> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.notifications" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.expireTimeDiff" }}</template> + <template #description>{{ i18n "pages.settings.expireTimeDiffDesc" }}</template> + <template #control> + <a-input-number :min="0" v-model="allSetting.expireDiff" style="width: 100%;"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.trafficDiff" }}</template> + <template #description>{{ i18n "pages.settings.trafficDiffDesc" }}</template> + <template #control> + <a-input-number :min="0" v-model="allSetting.trafficDiff" style="width: 100%;"></a-input> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.certs" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.publicKeyPath"}}</template> + <template #description>{{ i18n "pages.settings.publicKeyPathDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.webCertFile"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.privateKeyPath"}}</template> + <template #description>{{ i18n "pages.settings.privateKeyPathDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.webKeyFile"></a-input> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.externalTraffic" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.externalTrafficInformEnable"}}</template> + <template #description>{{ i18n "pages.settings.externalTrafficInformEnableDesc"}}</template> + <template #control> + <a-switch v-model="allSetting.externalTrafficInformEnable"></a-switch> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.externalTrafficInformURI"}}</template> + <template #description>{{ i18n "pages.settings.externalTrafficInformURIDesc"}}</template> + <template #control> + <a-input type="text" placeholder="(http|https)://domain[:port]/path/" v-model="allSetting.externalTrafficInformURI"></a-input> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.dateAndTime" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.timeZone"}}</template> + <template #description>{{ i18n "pages.settings.timeZoneDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.timeLocation"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.datepicker"}}</template> + <template #description>{{ i18n "pages.settings.datepickerDescription"}}</template> + <template #control> + <a-select style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme" v-model="datepicker"> + <a-select-option v-for="item in datepickerList" :value="item.value"> + <span v-text="item.name"></span> + </a-select-option> + </a-select> + </template> + </a-setting-list-item> + </a-collapse-panel> + </a-collapse> </a-tab-pane> - <a-tab-pane key="2" tab='{{ i18n "pages.settings.securitySettings"}}' style="padding-top: 20px;"> + <a-tab-pane key="2" tab='{{ i18n "pages.settings.securitySettings" }}' style="padding-top: 20px;"> <a-collapse> <a-collapse-panel header='{{ i18n "pages.settings.security.admin"}}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.oldUsername"}}</template> + <template #control> + <a-input autocomplete="username" v-model="user.oldUsername"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.currentPassword"}}</template> + <template #control> + <password-input autocomplete="current-password" v-model="user.oldPassword"></password-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.newUsername"}}</template> + <template #control> + <a-input v-model="user.newUsername"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.newPassword"}}</template> + <template #control> + <password-input autocomplete="new-password" v-model="user.newPassword"></password-input> + </template> + </a-setting-list-item> <a-list-item> - <a-row style="padding: 0 20px; padding-bottom: 10px;"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.oldUsername"}}'></a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-input autocomplete="username" v-model="user.oldUsername"></a-input> - </template> - </a-col> - </a-row> - <a-row style="padding: 10px 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.currentPassword"}}'></a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <password-input autocomplete="current-password" v-model="user.oldPassword"></password-input> - </template> - </a-col> - </a-row> - <a-row style="padding: 10px 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.newUsername"}}'></a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-input v-model="user.newUsername"></a-input> - </template> - </a-col> - </a-row> - <a-row style="padding: 10px 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.newPassword"}}'></a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <password-input autocomplete="new-password" v-model="user.newPassword"></password-input> - </template> - </a-col> - </a-row> - <a-space direction="horizontal" style="padding: 0 20px; padding-top: 20px;"> + <a-space direction="horizontal" style="padding: 0 20px;"> <a-button type="primary" @click="updateUser">{{ i18n "confirm" }}</a-button> </a-space> </a-list-item> </a-collapse-panel> <a-collapse-panel header='{{ i18n "pages.settings.security.secret"}}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.security.loginSecurity" }}</template> + <template #description>{{ i18n "pages.settings.security.loginSecurityDesc" }}</template> + <template #control> + <a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch> + <a-icon style="margin-left: 1rem;" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" @click="getNewSecret"></a-icon> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.security.secretToken" }}</template> + <template #description>{{ i18n "pages.settings.security.secretTokenDesc" }}</template> + <template #control> + <a-textarea type="text" :disabled="!allSetting.secretEnable" v-model="user.loginSecret"></a-textarea> + </template> + </a-setting-list-item> <a-list-item> - <a-row style="padding: 0 20px; padding-bottom: 10px;"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.security.loginSecurity" }}' - description='{{ i18n "pages.settings.security.loginSecurityDesc" }}'> - </a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch> - <a-icon style="margin-left: 1rem;" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" @click="getNewSecret"></a-icon> - </template> - </a-col> - </a-row> - <a-row style="padding: 10px 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.security.secretToken" }}' - description='{{ i18n "pages.settings.security.secretTokenDesc" }}'> - </a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-textarea type="text" :disabled="!allSetting.secretEnable" v-model="user.loginSecret"></a-textarea> - </template> - </a-col> - </a-row> - <a-space direction="horizontal" style="padding: 0 20px; padding-top: 20px;"> + <a-space direction="horizontal" style="padding: 0 20px;"> <a-button type="primary" :loading="this.changeSecret" @click="updateSecret">{{ i18n "confirm" }}</a-button> </a-space> </a-list-item> </a-collapse-panel> </a-collapse> - <!-- - <a-divider>{{ i18n "pages.settings.security.secret"}}</a-divider> - <a-form style="padding: 0 20px;"> - <a-list-item> - <a-row> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title='{{ i18n "pages.settings.security.loginSecurity" }}' - description='{{ i18n "pages.settings.security.loginSecurityDesc" }}'> - </a-list-item-meta> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-switch @change="toggleToken(allSetting.secretEnable)" v-model="allSetting.secretEnable"></a-switch> - <a-icon style="margin-left: 1rem;" v-if="allSetting.secretEnable" :spin="this.changeSecret" type="sync" @click="getNewSecret"></a-icon> - </template> - </a-col> - </a-row> - </a-list-item> - - <a-button type="primary" :loading="this.changeSecret" @click="updateSecret">{{ i18n "confirm" }}</a-button> - </a-form> --> </a-tab-pane> - <a-tab-pane key="3" tab='{{ i18n "pages.settings.TGBotSettings"}}'> - <a-list item-layout="horizontal"> - <setting-list-item type="switch" title='{{ i18n "pages.settings.telegramBotEnable" }}' desc='{{ i18n "pages.settings.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.telegramToken"}}' desc='{{ i18n "pages.settings.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.telegramChatId"}}' desc='{{ i18n "pages.settings.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.telegramNotifyTime"}}' desc='{{ i18n "pages.settings.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item> - <setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyBackup" }}' desc='{{ i18n "pages.settings.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item> - <setting-list-item type="switch" title='{{ i18n "pages.settings.tgNotifyLogin" }}' desc='{{ i18n "pages.settings.tgNotifyLoginDesc" }}' v-model="allSetting.tgBotLoginNotify"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.settings.tgNotifyCpu" }}' desc='{{ i18n "pages.settings.tgNotifyCpuDesc" }}' v-model="allSetting.tgCpu" :min="0" :max="100"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.telegramProxy"}}' desc='{{ i18n "pages.settings.telegramProxyDesc"}}' v-model="allSetting.tgBotProxy" placeholder="socks5://user:pass@host:port"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.settings.telegramAPIServer"}}' desc='{{ i18n "pages.settings.telegramAPIServerDesc"}}' v-model="allSetting.tgBotAPIServer" placeholder="https://api.example.com"></setting-list-item> - <a-list-item> - <a-row style="padding: 20px"> - <a-col :lg="24" :xl="12"> - <a-list-item-meta title="Telegram Bot Language" /> - </a-col> - <a-col :lg="24" :xl="12"> - <template> - <a-select ref="selectBotLang" v-model="allSetting.tgLang" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%"> - <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> - <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> - </a-select-option> - </a-select> - </template> - </a-col> - </a-row> - </a-list-item> - </a-list> + <a-tab-pane key="3" tab='{{ i18n "pages.settings.TGBotSettings" }}' style="padding-top: 20px;"> + <a-collapse> + <a-collapse-panel header='{{ i18n "pages.xray.generalConfigs"}}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramBotEnable" }}</template> + <template #description>{{ i18n "pages.settings.telegramBotEnableDesc" }}</template> + <template #control> + <a-switch v-model="allSetting.tgBotEnable"></a-switch> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramToken"}}</template> + <template #description>{{ i18n "pages.settings.telegramTokenDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.tgBotToken"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramChatId"}}</template> + <template #description>{{ i18n "pages.settings.telegramChatIdDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.tgBotChatId"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramBotLanguage"}}</template> + <template #control> + <a-select ref="selectBotLang" v-model="allSetting.tgLang" :dropdown-class-name="themeSwitcher.currentTheme" style="width: 100%"> + <a-select-option :value="l.value" :label="l.value" v-for="l in supportLangs"> + <span role="img" :aria-label="l.name" v-text="l.icon"></span> <span v-text="l.name"></span> + </a-select-option> + </a-select> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.notifications" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramNotifyTime"}}</template> + <template #description>{{ i18n "pages.settings.telegramNotifyTimeDesc"}}</template> + <template #control> + <a-input type="text" v-model="allSetting.tgRunTime"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.tgNotifyBackup" }}</template> + <template #description>{{ i18n "pages.settings.tgNotifyBackupDesc" }}</template> + <template #control> + <a-switch v-model="allSetting.tgBotBackup"></a-switch> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.tgNotifyLogin" }}</template> + <template #description>{{ i18n "pages.settings.tgNotifyLoginDesc" }}</template> + <template #control> + <a-switch v-model="allSetting.tgBotLoginNotify"></a-switch> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.tgNotifyCpu" }}</template> + <template #description>{{ i18n "pages.settings.tgNotifyCpuDesc" }}</template> + <template #control> + <a-input-number :min="0" :min="100" v-model="allSetting.tgCpu"></a-switch> + </template> + </a-setting-list-item> + </a-collapse-panel> + <a-collapse-panel header='{{ i18n "pages.settings.proxyAndServer" }}'> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramProxy"}}</template> + <template #description>{{ i18n "pages.settings.telegramProxyDesc"}}</template> + <template #control> + <a-input type="text" placeholder="socks5://user:pass@host:port" v-model="allSetting.tgBotProxy"></a-input> + </template> + </a-setting-list-item> + <a-setting-list-item paddings="small"> + <template #title>{{ i18n "pages.settings.telegramAPIServer"}}</template> + <template #description>{{ i18n "pages.settings.telegramAPIServerDesc"}}</template> + <template #control> + <a-input type="text" placeholder="https://api.example.com" v-model="allSetting.tgBotAPIServer"></a-input> + </template> + </a-setting-list-item> + </a-collapse-panel> + </a-collapse> </a-tab-pane> - <a-tab-pane k
|
