diff options
| author | Ho3ein <ho3ein.sanaei@gmail.com> | 2023-12-10 17:42:52 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-10 17:42:52 +0300 |
| commit | e3f1d3c892a1af48f27fdc36f273a55f38d13b40 (patch) | |
| tree | b11d0c1ed3c15c8f6f891a5e6df8e021d5db8ab6 /web/html/xui | |
| parent | 36cf7c0a8fda915b51e75958ce729fd9a61a5c90 (diff) | |
| parent | 9fbe80f87f950673058f0001b3704251fa8b9243 (diff) | |
huge changes
Diffstat (limited to 'web/html/xui')
36 files changed, 4937 insertions, 2364 deletions
diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index d5c60b76..e0295110 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -1,122 +1,207 @@ {{define "clientsBulkModal"}} -<a-modal id="client-bulk-modal" v-model="clientsBulkModal.visible" :title="clientsBulkModal.title" @ok="clientsBulkModal.ok" - :confirm-loading="clientsBulkModal.confirmLoading" :closable="true" :mask-closable="false" - :class="themeSwitcher.darkCardClass" - :ok-text="clientsBulkModal.okText" cancel-text='{{ i18n "close" }}'> +<a-modal id="client-bulk-modal" v-model="clientsBulkModal.visible" :title="clientsBulkModal.title" + @ok="clientsBulkModal.ok" :confirm-loading="clientsBulkModal.confirmLoading" :closable="true" :mask-closable="false" + :ok-text="clientsBulkModal.okText" cancel-text='{{ i18n "close" }}' :class="themeSwitcher.currentTheme"> <a-form layout="inline"> - <a-form-item label='{{ i18n "pages.client.method" }}'> - <a-select v-model="clientsBulkModal.emailMethod" buttonStyle="solid" style="width: 350px" :dropdown-class-name="themeSwitcher.darkCardClass"> - <a-select-option :value="0">Random</a-select-option> - <a-select-option :value="1">Random+Prefix</a-select-option> - <a-select-option :value="2">Random+Prefix+Num</a-select-option> - <a-select-option :value="3">Random+Prefix+Num+Postfix</a-select-option> - <a-select-option :value="4">Prefix+Num+Postfix [ BE CAREFUL! ]</a-select-option> - </a-select> - </a-form-item><br /> - <a-form-item v-if="clientsBulkModal.emailMethod>1"> - <span slot="label">{{ i18n "pages.client.first" }}</span> - <a-input-number v-model="clientsBulkModal.firstNum" :min="1"></a-input-number> - </a-form-item> - <a-form-item v-if="clientsBulkModal.emailMethod>1"> - <span slot="label">{{ i18n "pages.client.last" }}</span> - <a-input-number v-model="clientsBulkModal.lastNum" :min="clientsBulkModal.firstNum"></a-input-number> - </a-form-item> - <a-form-item v-if="clientsBulkModal.emailMethod>0"> - <span slot="label">{{ i18n "pages.client.prefix" }}</span> - <a-input v-model="clientsBulkModal.emailPrefix" style="width: 120px"></a-input> - </a-form-item> - <a-form-item v-if="clientsBulkModal.emailMethod>2"> - <span slot="label">{{ i18n "pages.client.postfix" }}</span> - <a-input v-model="clientsBulkModal.emailPostfix" style="width: 120px"></a-input> - </a-form-item> - <a-form-item v-if="clientsBulkModal.emailMethod < 2"> - <span slot="label">{{ i18n "pages.client.clientCount" }}</span> - <a-input-number v-model="clientsBulkModal.quantity" :min="1" :max="100"></a-input-number> - </a-form-item> - <a-form-item v-if="app.subSettings.enable"> - <span slot="label"> - Subscription + <table width="100%" class="ant-table-tbody"> + <tr> + <td>{{ i18n "pages.client.method" }}</td> + <td> + <a-form-item> + <a-select v-model="clientsBulkModal.emailMethod" buttonStyle="solid" style="width: 250px" + :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option :value="0">Random</a-select-option> + <a-select-option :value="1">Random+Prefix</a-select-option> + <a-select-option :value="2">Random+Prefix+Num</a-select-option> + <a-select-option :value="3">Random+Prefix+Num+Postfix</a-select-option> + <a-select-option :value="4">Prefix+Num+Postfix</a-select-option> + </a-select> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.emailMethod>1"> + <td>{{ i18n "pages.client.first" }}</td> + <td> + <a-form-item> + <a-input-number v-model="clientsBulkModal.firstNum" :min="1"></a-input-number> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.emailMethod>1"> + <td>{{ i18n "pages.client.last" }}</td> + <td> + <a-form-item> + <a-input-number v-model="clientsBulkModal.lastNum" + :min="clientsBulkModal.firstNum"></a-input-number> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.emailMethod>0"> + <td>{{ i18n "pages.client.prefix" }}</td> + <td> + <a-form-item> + <a-input v-model="clientsBulkModal.emailPrefix" style="width: 250px"></a-input> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.emailMethod>2"> + <td>{{ i18n "pages.client.postfix" }}</td> + <td> + <a-form-item> + <a-input v-model="clientsBulkModal.emailPostfix" style="width: 250px"></a-input> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.emailMethod < 2"> + <td>{{ i18n "pages.client.clientCount" }}</td> + <td> + <a-form-item> + <a-input-number v-model="clientsBulkModal.quantity" :min="1" :max="100"></a-input-number> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.inbound.canEnableTlsFlow()"> + <td>Flow</td> + <td> + <a-form-item> + <a-select v-model="clientsBulkModal.flow" style="width: 250px" + :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option value="" selected>{{ i18n "none" }}</a-select-option> + <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option> + </a-select> + </a-form-item> + </td> + </tr> + <tr v-if="app.subSettings.enable"> + <td>Subscription <a-tooltip> <template slot="title"> <span>{{ i18n "pages.inbounds.subscriptionDesc" }}</span> </template> + <a-icon @click="client.subId = RandomUtil.randomLowerAndNum(16)" type="sync"></a-icon> + </a-tooltip> + </td> + <td> + <a-form-item> + <a-input v-model.trim="clientsBulkModal.subId" style="width: 250px"></a-input> + </a-form-item> + </td> + </tr> + <tr v-if="app.tgBotEnable"> + <td>Telegram ID + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.inbounds.telegramDesc" }}</span> + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </td> + <td> + <a-form-item> + <a-input v-model.trim="clientsBulkModal.tgId" style="width: 250px"></a-input> + </a-form-item> + </td> + </tr> + <tr> + <td> + <label> + <span>{{ i18n "pages.inbounds.IPLimit" }}</span> + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.inbounds.IPLimitDesc" }}</span> + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </label> + </td> + <td> + <a-form-item> + <a-input-number v-model="clientsBulkModal.limitIp" min="0"></a-input-number> + </a-form-item> + </td> + </tr> + <tr> + <td v-if="clientsBulkModal.inbound.xtls"> + <label>Flow</label> + </td> + <td v-if="clientsBulkModal.inbound.xtls"> + <a-form-item> + <a-select v-model="clientsBulkModal.flow" style="width: 200px" + :dropdown-class-name="themeSwitcher.currentTheme"> + <a-select-option value="">{{ i18n "none" }}</a-select-option> + <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option> + </a-select> + </a-form-item> + </td> + </tr> + <tr> + <td> + <span>{{ i18n "pages.inbounds.totalFlow" }}</span>(GB) + <a-tooltip> + <template slot="title"> + 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span> + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </td> + <td> + <a-form-item> + <a-input-number v-model="clientsBulkModal.totalGB" :min="0"></a-input-number> + </a-form-item> + </td> + </tr> + <tr> + <td>{{ i18n "pages.client.delayedStart" }}</td> + <td> + <a-form-item> + <a-switch v-model="clientsBulkModal.delayedStart" + @click="clientsBulkModal.expiryTime=0"></a-switch> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.delayedStart"> + <td>{{ i18n "pages.client.expireDays" }}</td> + <td> + <a-form-item> + <a-input-number v-model.number="delayedExpireDays" :min="0"></a-input-number> + </a-form-item> + </td> + </tr> + <tr v-else> + <td> + <span>{{ i18n "pages.inbounds.expireDate" }}</span> + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span> + </template> + <a-icon type="question-circle" theme="filled"></a-icon> + </a-tooltip> + </td> + <td> + <a-form-item> + <a-date-picker :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss" + :dropdown-class-name="themeSwitcher.currentTheme" v-model="clientsBulkModal.expiryTime" + style="width: 250px;"></a-date-picker> + </a-form-item> + </td> + </tr> + <tr v-if="clientsBulkModal.expiryTime != 0"> + <td> + <span>{{ i18n "pages.client.renew" }}</span> + <a-tooltip> + <template slot="title"> + <span>{{ i18n "pages.client.renewDesc" }}</span> + </template> <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> - </span> - <a-input v-model.trim="clientsBulkModal.subId"></a-input> - </a-form-item> - <a-form-item v-if="app.tgBotEnable"> - <span slot="label"> - Telegram ID - <a-tooltip> - <template slot="title"> - <span>{{ i18n "pages.inbounds.telegramDesc" }}</span> - </template> - <a-icon type="question-circle" theme="filled"></a-icon> - </a-tooltip> - </span> - <a-input v-model.trim="clientsBulkModal.tgId"></a-input> - </a-form-item> - <br> - <a-form-item> - <span slot="label"> - <span>{{ i18n "pages.inbounds.IPLimit" }}</span> - <a-tooltip> - <template slot="title"> - <span>{{ i18n "pages.inbounds.IPLimitDesc" }}</span> - </template> - <a-icon type="question-circle" theme="filled"></a-icon> - </a-tooltip> - </span> - <a-input-number v-model="clientsBulkModal.limitIp" min="0"></a-input-number> - </a-form-item> - <br> - <a-form-item v-if="clientsBulkModal.inbound.xtls" label="Flow"> - <a-select v-model="clientsBulkModal.flow" style="width: 200px" :dropdown-class-name="themeSwitcher.darkCardClass"> - <a-select-option value="">{{ i18n "none" }}</a-select-option> - <a-select-option v-for="key in XTLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option> - </a-select> - </a-form-item> - <a-form-item v-if="clientsBulkModal.inbound.canEnableTlsFlow()" label="Flow" layout="inline"> - <a-select v-model="clientsBulkModal.flow" style="width: 200px" :dropdown-class-name="themeSwitcher.darkCardClass"> - <a-select-option value="" selected>{{ i18n "none" }}</a-select-option> - <a-select-option v-for="key in TLS_FLOW_CONTROL" :value="key">[[ key ]]</a-select-option> - </a-select> - </a-form-item> - <a-form-item> - <span slot="label"> - <span>{{ i18n "pages.inbounds.totalFlow" }}</span> (GB) - <a-tooltip> - <template slot="title"> - 0 <span>{{ i18n "pages.inbounds.meansNoLimit" }}</span> - </template> - <a-icon type="question-circle" theme="filled"></a-icon> - </a-tooltip> - </span> - <a-input-number v-model="clientsBulkModal.totalGB" :min="0"></a-input-number> - </a-form-item> - <br> - <a-form-item label='{{ i18n "pages.client.delayedStart" }}'> - <a-switch v-model="clientsBulkModal.delayedStart" @click="clientsBulkModal.expiryTime=0"></a-switch> - </a-form-item> - <br> - <a-form-item label='{{ i18n "pages.client.expireDays" }}' v-if="clientsBulkModal.delayedStart"> - <a-input-number v-model="delayedExpireDays" :min="0"></a-input-number> - </a-form-item> - <a-form-item v-else> - <span slot="label"> - <span>{{ i18n "pages.inbounds.expireDate" }}</span> - <a-tooltip> - <template slot="title"> - <span>{{ i18n "pages.inbounds.leaveBlankToNeverExpire" }}</span> - </template> - <a-icon type="question-circle" theme="filled"></a-icon> - </a-tooltip> - </span> - <a-date-picker :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss" - :dropdown-class-name="themeSwitcher.darkCardClass" - v-model="clientsBulkModal.expiryTime" style="width: 300px;"></a-date-picker> - </a-form-item> + </td> + <td> + <a-form-item> + <a-input-number v-model.number="clientsBulkModal.reset" :min="0"></a-input-number> + </a-form-item> + </td> + </tr> + </table> </a-form> </a-modal> <script> @@ -142,6 +227,7 @@ tgId: "", flow: "", delayedStart: false, + reset: 0, ok() { clients = []; method = clientsBulkModal.emailMethod; @@ -170,6 +256,7 @@ if (clientsBulkModal.inbound.xtls) { newClient.flow = clientsBulkModal.flow; } + newClient.reset = clientsBulkModal.reset; clients.push(newClient); } ObjectUtil.execute(clientsBulkModal.confirm, clients, clientsBulkModal.dbInbound.id); @@ -199,6 +286,7 @@ this.dbInbound = new DBInbound(dbInbound); this.inbound = dbInbound.toInbound(); this.delayedStart = false; + this.reset = 0; }, newClient(protocol) { switch (protocol) { diff --git a/web/html/xui/client_modal.html b/web/html/xui/client_modal.html index e7c23098..1bc48a6a 100644 --- a/web/html/xui/client_modal.html +++ b/web/html/xui/client_modal.html @@ -1,8 +1,11 @@ {{define "clientsModal"}} <a-modal id="client-modal" v-model="clientModal.visible" :title="clientModal.title" @ok="clientModal.ok" :confirm-loading="clientModal.confirmLoading" :closable="true" :mask-closable="false" - :class="themeSwitcher.darkCardClass" + :class="themeSwitcher.currentTheme" :ok-text="clientModal.okText" cancel-text='{{ i18n "close" }}'> + <template v-if="isEdit"> + <a-tag v-if="isExpiry || isTrafficExhausted" color="red" style="margin-bottom: 10px;display: block;text-align: center;">Account is (Expired|Traffic Ended) And Disabled</a-tag> + </template> {{template "form/client"}} </a-modal> <script> @@ -35,7 +38,7 @@ this.isEdit = isEdit; this.dbInbound = new DBInbound(dbInbound); this.inbound = dbInbound.toInbound(); - this.clients = this.getClients(this.inbound.protocol, this.inbound.settings); + this.clients = this.inbound.clients; this.index = index === null ? this.clients.length : index; this.delayedStart = false; if (isEdit) { @@ -48,16 +51,7 @@ } this.clientStats = this.dbInbound.clientStats.find(row => row.email === this.clients[this.index].email); this.confirm = confirm; - }, - getClients(protocol, clientSettings) { - switch (protocol) { - case Protocols.VMESS: return clientSettings.vmesses; - case Protocols.VLESS: return clientSettings.vlesses; - case Protocols.TROJAN: return clientSettings.trojans; - case Protocols.SHADOWSOCKS: return clientSettings.shadowsockses; - default: return null; - } - }, + }, getClientId(protocol, client) { switch (protocol) { case Protocols.TROJAN: return client.password; @@ -109,8 +103,11 @@ get isExpiry() { return this.clientModal.isEdit && this.client.expiryTime >0 ? (this.client.expiryTime < new Date().getTime()) : false; }, - get statsColor() { - return usageColor(clientStats.up + clientStats.down, app.trafficDiff, this.client.totalGB); + get delayedStart() { + return this.clientModal.delayedStart; + }, + set delayedStart(value) { + this.clientModal.delayedStart = value; }, get delayedExpireDays() { return this.client && this.client.expiryTime < 0 ? this.client.expiryTime / -86400000 : 0; @@ -151,7 +148,7 @@ this.$confirm({ title: '{{ i18n "pages.inbounds.resetTraffic"}}', content: '{{ i18n "pages.inbounds.resetTrafficContent"}}', - class: themeSwitcher.darkCardClass, + class: themeSwitcher.currentTheme, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', onOk: async () => { diff --git a/web/html/xui/common_sider.html b/web/html/xui/common_sider.html index 58072f82..f91b9fbb 100644 --- a/web/html/xui/common_sider.html +++ b/web/html/xui/common_sider.html @@ -11,6 +11,10 @@ <a-icon type="setting"></a-icon> <span>{{ i18n "menu.settings"}}</span> </a-menu-item> +<a-menu-item key="{{ .base_path }}panel/xray"> + <a-icon type="tool"></a-icon> + <span>{{ i18n "menu.xray"}}</span> +</a-menu-item> <!--<a-menu-item key="{{ .base_path }}panel/clients">--> <!-- <a-icon type="laptop"></a-icon>--> <!-- <span>Client</span>--> @@ -26,7 +30,7 @@ <a-layout-sider :theme="themeSwitcher.currentTheme" id="sider" collapsible breakpoint="md" collapsed-width="0"> <a-menu :theme="themeSwitcher.currentTheme" mode="inline" selected-keys=""> <a-menu-item mode="inline"> - <a-icon type="bg-colors"></a-icon> + <a-icon type="bulb" :theme="themeSwitcher.isDarkTheme ? 'filled' : 'outlined'"></a-icon> <theme-switch /> </a-menu-item> </a-menu> @@ -38,14 +42,14 @@ <a-drawer id="sider-drawer" placement="left" :closable="false" @close="siderDrawer.close()" :visible="siderDrawer.visible" - :wrap-class-name="themeSwitcher.darkDrawerClass" + :wrap-class-name="themeSwitcher.currentTheme" :wrap-style="{ padding: 0 }"> <div class="drawer-handle" @click="siderDrawer.change()" slot="handle"> <a-icon :type="siderDrawer.visible ? 'close' : 'menu-fold'"></a-icon> </div> <a-menu :theme="themeSwitcher.currentTheme" mode="inline" selected-keys=""> <a-menu-item mode="inline"> - <a-icon type="bg-colors"></a-icon> + <a-icon type="bulb" :theme="themeSwitcher.isDarkTheme ? 'filled' : 'outlined'"></a-icon> <theme-switch /> </a-menu-item> </a-menu> diff --git a/web/html/xui/component/password.html b/web/html/xui/component/password.html index ebea3be6..13dbfb51 100644 --- a/web/html/xui/component/password.html +++ b/web/html/xui/component/password.html @@ -4,12 +4,12 @@ :placeholder="placeholder" @input="$emit('input', $event.target.value)"> <template v-if="icon" #prefix> - <a-icon :type="icon" :style="'font-size: 16px;' + themeSwitcher.textStyle" /> + <a-icon :type="icon" style="font-size: 16px;" /> </template> <template #addonAfter> <a-icon :type="showPassword ? 'eye-invisible' : 'eye'" @click="toggleShowPassword" - :style="'font-size: 16px;' + themeSwitcher.textStyle" /> + style="font-size: 16px;" /> </template> </a-input> </template> diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/setting.html index 568f03de..82c0ae75 100644 --- a/web/html/xui/component/setting.html +++ b/web/html/xui/component/setting.html @@ -13,10 +13,10 @@ </a-col> <a-col :lg="24" :xl="12"> <template v-if="type === 'text'"> - <a-input :value="value" @input="$emit('input', $event.target.value)"></a-input> + <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" @change="value => $emit('input', value)" :min="min" style="width: 100%;"></a-input-number> + <a-input-number :value="value" :step="step" @change="value => $emit('input', value)" :min="min" style="width: 100%;"></a-input-number> </template> <template v-else-if="type === 'switch'"> <a-switch :checked="value" @change="value => $emit('input', value)"></a-switch> @@ -29,7 +29,7 @@ {{define "component/setting"}} <script> Vue.component('setting-list-item', { - props: ["type", "title", "desc", "value", "min"], + props: ["type", "title", "desc", "value", "min", "step", "placeholder"], template: `{{template "component/settingListItem"}}`, }); </script> diff --git a/web/html/xui/component/themeSwitch.html b/web/html/xui/component/themeSwitch.html index 7cbedecf..4d5412e2 100644 --- a/web/html/xui/component/themeSwitch.html +++ b/web/html/xui/component/themeSwitch.html @@ -1,8 +1,6 @@ {{define "component/themeSwitchTemplate"}} <template> - <a-switch :default-checked="themeSwitcher.isDarkTheme" - checked-children="☀" - un-checked-children="🌙" + <a-switch size="small" :default-checked="themeSwitcher.isDarkTheme" @change="themeSwitcher.toggleTheme()"> </a-switch> </template> @@ -10,39 +8,17 @@ {{define "component/themeSwitcher"}} <script> - const colors = { - dark: { - bg: "#242c3a", - text: "hsla(0,0%,100%,.65)" - }, - light: { - bg: '#f0f2f5', - text: "rgba(0, 0, 0, 0.7)", - } - } - function createThemeSwitcher() { const isDarkTheme = localStorage.getItem('dark-mode') === 'true'; const theme = isDarkTheme ? 'dark' : 'light'; return { isDarkTheme, - bgStyle: `background: ${colors[theme].bg};`, - textStyle: `color: ${colors[theme].text};`, - darkClass: isDarkTheme ? 'ant-dark' : '', - darkCardClass: isDarkTheme ? 'ant-card-dark' : '', - darkDrawerClass: isDarkTheme ? 'ant-drawer-dark' : '', get currentTheme() { return this.isDarkTheme ? 'dark' : 'light'; }, contacts: admin@thfree.ru |
