From 5ef8a5a37ec7e6b7df710fa61b0324ab5a6617ab Mon Sep 17 00:00:00 2001 From: MHSanaei <33454419+MHSanaei@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:22:50 +0330 Subject: old design --- web/html/xui/inbound_info_modal.html | 119 ++++++++++------------------------- 1 file changed, 32 insertions(+), 87 deletions(-) (limited to 'web/html/xui/inbound_info_modal.html') diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html index 0e1b1415..737665d5 100644 --- a/web/html/xui/inbound_info_modal.html +++ b/web/html/xui/inbound_info_modal.html @@ -3,7 +3,7 @@ v-model="infoModal.visible" title='{{ i18n "pages.inbounds.details"}}' :closable="true" :mask-closable="true" - :class="siderDrawer.isDarkTheme ? darkClass : ''" + :class="siderDrawer.isDarkTheme ? darkClass : ''" :footer="null" width="600px" > @@ -44,7 +44,7 @@ - + tls: {{ i18n "enabled" }}
tls {{ i18n "domainName" }}: [[ inbound.serverName ? inbound.serverName : '' ]] @@ -57,20 +57,20 @@ - -
URL

[[ infoModal.link ]]

@@ -167,31 +106,39 @@ visible: false, inbound: new Inbound(), dbInbound: new DBInbound(), - settings: null, clientSettings: new Inbound.Settings(), clientStats: [], upStats: 0, downStats: 0, clipboard: null, link: null, - index: null, + index: 0, isExpired: false, - show(dbInbound, index) { + show(dbInbound, index=0) { this.index = index; this.inbound = dbInbound.toInbound(); this.dbInbound = new DBInbound(dbInbound); this.link = dbInbound.genLink(index); - this.settings = JSON.parse(this.inbound.settings); - this.clientSettings = this.settings.clients ? Object.values(this.settings.clients)[index] : null; + this.clientSettings = Object.values(JSON.parse(this.inbound.settings).clients)[index]; + this.clientStats = dbInbound.clientStats; this.isExpired = this.inbound.isExpiry(index); - this.clientStats = this.settings.clients ? this.dbInbound.clientStats.find(row => row.email === this.clientSettings.email) : []; + if(dbInbound.clientStats.length > 0) + { + for (const key in dbInbound.clientStats) { + if (Object.hasOwnProperty.call(dbInbound.clientStats, key)) { + if(dbInbound.clientStats[key]['email'] == this.clientSettings.email) + this.clientStats = dbInbound.clientStats[key]; + + } + } + } this.visible = true; infoModalApp.$nextTick(() => { if (this.clipboard === null) { this.clipboard = new ClipboardJS('#copy-url-link', { text: () => this.link, }); - this.clipboard.on('success', () => app.$message.success('{{ i18n "copied" }}')); + this.clipboard.on('success', () => app.$message.success('{{ i18n "copySuccess" }}')); } }); }, @@ -199,7 +146,6 @@ infoModal.visible = false; }, }; - const infoModalApp = new Vue({ delimiters: ['[[', ']]'], el: '#inbound-info-modal', @@ -210,33 +156,32 @@ }, get inbound() { return this.infoModal.inbound; - }, - get isEnable() { - if(infoModal.clientStats){ - return infoModal.clientStats.enable; - } - return infoModal.dbInbound.isEnable; } }, methods: { + setQrCode(elmentId,index) { + content = infoModal.inbound.genLink(infoModal.dbInbound.address,infoModal.dbInbound.remark,index) + new QRious({ + element: document.querySelector('#'+elmentId), + size: 260, + value: content, + }); + }, copyTextToClipboard(elmentId,content) { this.infoModal.clipboard = new ClipboardJS('#' + elmentId, { text: () => content, }); this.infoModal.clipboard.on('success', () => { - app.$message.success('{{ i18n "copied" }}') + app.$message.success('{{ i18n "copySuccess" }}') this.infoModal.clipboard.destroy(); }); }, statsColor(stats) { - if(!stats) return 'blue' if(stats['total'] === 0) return 'blue' else if(stats['total'] > 0 && (stats['down']+stats['up']) < stats['total']) return 'cyan' else return 'red' } }, - }); - {{end}} \ No newline at end of file -- cgit v1.2.3