diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-03-24 17:13:13 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-24 17:13:13 +0300 |
| commit | 77be5cf7d8043e14f22206cae43151590be4f229 (patch) | |
| tree | f16d1d72238638a65d25df65188c731abd06dada /web/html | |
| parent | 17f64462d21f84f353308ac084640467ed7eb54c (diff) | |
| parent | c9d768a086a6353caac6db187b0b0bf8b805456b (diff) | |
Merge pull request #74 from MHSanaei/dev
Dev
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/common/qrcode_modal.html | 18 | ||||
| -rw-r--r-- | web/html/xui/client_bulk_modal.html | 12 | ||||
| -rw-r--r-- | web/html/xui/inbound_info_modal.html | 12 | ||||
| -rw-r--r-- | web/html/xui/index.html | 47 | ||||
| -rw-r--r-- | web/html/xui/setting.html | 4 |
5 files changed, 60 insertions, 33 deletions
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html index e535b401..f492dabb 100644 --- a/web/html/common/qrcode_modal.html +++ b/web/html/common/qrcode_modal.html @@ -1,9 +1,10 @@ {{define "qrcodeModal"}} <a-modal id="qrcode-modal" v-model="qrModal.visible" :title="qrModal.title" - :closable="true" width="300px" :ok-text="qrModal.okText" + :closable="true" :class="siderDrawer.isDarkTheme ? darkClass : ''" - cancel-text='{{ i18n "close" }}' :ok-button-props="{attrs:{id:'qr-modal-ok-btn'}}"> - <a-tag color="green" style="margin-bottom: 10px;display: block;text-align: center;" >{{ i18n "pages.inbounds.clickOnQRcode" }}</a-tag> + :footer="null" + width="300px"> + <a-tag color="green" style="margin-bottom: 10px;display: block;text-align: center;" >{{ i18n "pages.inbounds.clickOnQRcode" }}</a-tag> <canvas @click="copyToClipboard()" id="qrCode" style="width: 100%; height: 100%;"></canvas> </a-modal> @@ -14,17 +15,15 @@ content: '', inbound: new Inbound(), dbInbound: new DBInbound(), - okText: '', copyText: '', qrcode: null, clipboard: null, visible: false, - show: function (title='', content='', dbInbound=new DBInbound(),okText='{{ i18n "copy" }}', copyText='') { + show: function (title='', content='', dbInbound=new DBInbound(), copyText='') { this.title = title; this.content = content; this.dbInbound = dbInbound; this.inbound = dbInbound.toInbound(); - this.okText = okText; if (ObjectUtil.isEmpty(copyText)) { this.copyText = content; } else { @@ -32,13 +31,6 @@ } this.visible = true; qrModalApp.$nextTick(() => { - this.clipboard = new ClipboardJS('#qr-modal-ok-btn', { - text: () => this.copyText, - }); - this.clipboard.on('success', () => { - app.$message.success('{{ i18n "copied" }}') - this.clipboard.destroy(); - }); if (this.qrcode === null) { this.qrcode = new QRious({ element: document.querySelector('#qrCode'), diff --git a/web/html/xui/client_bulk_modal.html b/web/html/xui/client_bulk_modal.html index 19fd4b18..2024fa1d 100644 --- a/web/html/xui/client_bulk_modal.html +++ b/web/html/xui/client_bulk_modal.html @@ -7,10 +7,11 @@ <a-form-item label='{{ i18n "pages.client.method" }}'> <a-select v-model="clientsBulkModal.emailMethod" buttonStyle="solid" style="width: 350px" :dropdown-class-name="siderDrawer.isDarkTheme ? 'ant-card-dark' : ''"> <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">Random_Prefix+Num@Telegram Username</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">Random+Prefix+Num@Telegram Username</a-select-option> + <a-select-option :value="5">Prefix+Num+Postfix [ BE CAREFUL! ]</a-select-option> </a-select> </a-form-item><br /> <a-form-item v-if="clientsBulkModal.emailMethod>1"> @@ -91,11 +92,12 @@ start=0; end=clientsBulkModal.quantity; } - prefix = (method>0 && clientsBulkModal.emailPrefix.length>0) ? "_" + clientsBulkModal.emailPrefix : ""; + prefix = (method>0 && clientsBulkModal.emailPrefix.length>0) ? clientsBulkModal.emailPrefix : ""; useNum=(method>1); postfix = (method>2 && clientsBulkModal.emailPostfix.length>0) ? (method == 4 ? "@" : "") + clientsBulkModal.emailPostfix : ""; for (let i = start; i < end; i++) { newClient = clientsBulkModal.newClient(clientsBulkModal.dbInbound.protocol); + if(method==5) newClient.email = ""; newClient.email += useNum ? prefix + i.toString() + postfix : prefix + postfix; newClient._totalGB = clientsBulkModal.totalGB; newClient._expiryTime = clientsBulkModal.expiryTime; diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 0e1b1415..6de729f9 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -59,13 +59,11 @@ </table> <template v-if="infoModal.clientSettings"> <a-divider>{{ i18n "pages.inbounds.client" }}</a-divider> - <table style="margin-bottom: 10px; width: 100%;"> - <tr> - <th v-for="col in Object.keys(infoModal.clientSettings).slice(0, 3)">[[ col ]]</th> - </tr> - <tr> - <td v-for="col in Object.values(infoModal.clientSettings).slice(0, 3)"><a-tag color="green">[[ col ]]</a-tag></td> - </table> + <table style="margin-bottom: 10px;"> + <tr v-for="col,index in Object.keys(infoModal.clientSettings).slice(0, 3)"> + <td>[[ col ]]</td> + <td><a-tag color="green">[[ infoModal.clientSettings[col] ]]</a-tag></td> + </table> <table style="margin-bottom: 10px; width: 100%;"> <tr><th>{{ i18n "usage" }}</th><th>{{ i18n "pages.inbounds.totalFlow" }}</th><th>{{ i18n "pages.inbounds.expireDate" }}</th><th>{{ i18n "enable" }}</th></tr> <tr> diff --git a/web/html/xui/index.html b/web/html/xui/index.html index b8a1e4b5..a591a3c0 100644 --- a/web/html/xui/index.html +++ b/web/html/xui/index.html @@ -84,16 +84,18 @@ </template> <a-icon type="question-circle" theme="filled"></a-icon> </a-tooltip> - <a-tag color="green" @click="openSelectV2rayVersion">[[ status.xray.version ]]</a-tag> - <a-tag color="blue" @click="stopXrayService">{{ i18n "pages.index.stopXray" }}</a-tag> - <a-tag color="blue" @click="restartXrayService">{{ i18n "pages.index.restartXray" }}</a-tag> - <a-tag color="blue" @click="openSelectV2rayVersion">{{ i18n "pages.index.xraySwitch" }}</a-tag> + <a-tag color="green" style="cursor: pointer;" @click="openSelectV2rayVersion">[[ status.xray.version ]]</a-tag> + <a-tag color="blue" style="cursor: pointer;" @click="stopXrayService">{{ i18n "pages.index.stopXray" }}</a-tag> + <a-tag color="blue" style="cursor: pointer;" @click="restartXrayService">{{ i18n "pages.index.restartXray" }}</a-tag> + <a-tag color="blue" style="cursor: pointer;" @click="openSelectV2rayVersion">{{ i18n "pages.index.xraySwitch" }}</a-tag> + <a-tag color="blue" style="cursor: pointer;" @click="openLogs">Logs</a-tag> + <a-tag color="green">3x-ui v{{ .cur_ver }}</a-tag> </a-card> </a-col> <a-col :sm="24" :md="12"> <a-card hoverable :class="siderDrawer.isDarkTheme ? darkClass : ''"> {{ i18n "pages.index.operationHours" }}: - <a-tag color="#87d068">[[ formatSecond(status.uptime) ]]</a-tag> + <a-tag color="green">[[ formatSecond(status.uptime) ]]</a-tag> <a-tooltip> <template slot="title"> {{ i18n "pages.index.operationHoursDesc" }} @@ -177,7 +179,7 @@ <a-modal id="version-modal" v-model="versionModal.visible" title='{{ i18n "pages.index.xraySwitch" }}' :closable="true" @ok="() => versionModal.visible = false" :class="siderDrawer.isDarkTheme ? darkClass : ''" - ok-text='{{ i18n "confirm" }}' cancel-text='{{ i18n "cancel"}}'> + footer=""> <h2>{{ i18n "pages.index.xraySwitchClick"}}</h2> <h2>{{ i18n "pages.index.xraySwitchClickDesk"}}</h2> <template v-for="version, index in versionModal.versions"> @@ -187,6 +189,17 @@ </a-tag> </template> </a-modal> + <a-modal id="log-modal" v-model="logModal.visible" title="X-UI logs" + :closable="true" @ok="() => logModal.visible = false" @cancel="() => logModal.visible = false" + :class="siderDrawer.isDarkTheme ? darkClass : ''" + width="800px" + footer=""> + <table style="margin: 0px; width: 100%; background-color: black; color: hsla(0,0%,100%,.65);"> + <tr v-for="log , index in logModal.logs"> + <td style="vertical-align: top;">[[ index ]]</td><td>[[ log ]]</td> + </tr> + </table> + </a-modal> </a-layout> {{template "js" .}} <script> @@ -280,6 +293,18 @@ }, }; + const logModal = { + visible: false, + logs: '', + show(logs) { + this.visible = true; + this.logs = logs; + }, + hide() { + this.visible = false; + }, + }; + const app = new Vue({ delimiters: ['[[', ']]'], el: '#app', @@ -287,6 +312,7 @@ siderDrawer, status: new Status(), versionModal, + logModal, spinning: false, loadingTip: '{{ i18n "loading"}}', }, @@ -346,6 +372,15 @@ return; } }, + async openLogs(){ + this.loading(true); + const msg = await HttpUtil.post('server/logs'); + this.loading(false); + if (!msg.success) { + return; + } + logModal.show(msg.obj); + } }, async mounted() { while (true) { diff --git a/web/html/xui/setting.html b/web/html/xui/setting.html index 0c0f9682..057dae95 100644 --- a/web/html/xui/setting.html +++ b/web/html/xui/setting.html @@ -40,7 +40,7 @@ <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'"> <setting-list-item type="text" title='{{ i18n "pages.setting.panelListeningIP"}}' desc='{{ i18n "pages.setting.panelListeningIPDesc"}}' v-model="allSetting.webListen"></setting-list-item> - <setting-list-item type="text" title='{{ i18n "pages.setting.panelPort"}}' desc='{{ i18n "pages.setting.panelPortDesc"}}' v-model.number="allSetting.webPort"></setting-list-item> + <setting-list-item type="number" title='{{ i18n "pages.setting.panelPort"}}' desc='{{ i18n "pages.setting.panelPortDesc"}}' v-model.number="allSetting.webPort"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.setting.publicKeyPath"}}' desc='{{ i18n "pages.setting.publicKeyPathDesc"}}' v-model="allSetting.webCertFile"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.setting.privateKeyPath"}}' desc='{{ i18n "pages.setting.privateKeyPathDesc"}}' v-model="allSetting.webKeyFile"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.setting.panelUrlPath"}}' desc='{{ i18n "pages.setting.panelUrlPathDesc"}}' v-model="allSetting.webBasePath"></setting-list-item> @@ -117,7 +117,7 @@ <a-list item-layout="horizontal" :style="siderDrawer.isDarkTheme ? 'color: hsla(0,0%,100%,.65);': 'background: white;'"> <setting-list-item type="switch" title='{{ i18n "pages.setting.telegramBotEnable" }}' desc='{{ i18n "pages.setting.telegramBotEnableDesc" }}' v-model="allSetting.tgBotEnable"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.setting.telegramToken"}}' desc='{{ i18n "pages.setting.telegramTokenDesc"}}' v-model="allSetting.tgBotToken"></setting-list-item> - <setting-list-item type="number" title='{{ i18n "pages.setting.telegramChatId"}}' desc='{{ i18n "pages.setting.telegramChatIdDesc"}}' v-model.number="allSetting.tgBotChatId"></setting-list-item> + <setting-list-item type="text" title='{{ i18n "pages.setting.telegramChatId"}}' desc='{{ i18n "pages.setting.telegramChatIdDesc"}}' v-model="allSetting.tgBotChatId"></setting-list-item> <setting-list-item type="text" title='{{ i18n "pages.setting.telegramNotifyTime"}}' desc='{{ i18n "pages.setting.telegramNotifyTimeDesc"}}' v-model="allSetting.tgRunTime"></setting-list-item> <setting-list-item type="switch" title='{{ i18n "pages.setting.tgNotifyBackup" }}' desc='{{ i18n "pages.setting.tgNotifyBackupDesc" }}' v-model="allSetting.tgBotBackup"></setting-list-item> <setting-list-item type="number" title='{{ i18n "pages.setting.tgNotifyExpireTimeDiff" }}' desc='{{ i18n "pages.setting.tgNotifyExpireTimeDiffDesc" }}' v-model="allSetting.tgExpireDiff" :min="0"></setting-list-item> |
