From c980a06969c9595f0b0b7d5db301f2413506eb6f Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Fri, 8 Dec 2023 20:31:17 +0100 Subject: customizable remark #1300 --- web/html/xui/settings.html | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'web/html/xui/settings.html') diff --git a/web/html/xui/settings.html b/web/html/xui/settings.html index 24cef2af..f40b20a5 100644 --- a/web/html/xui/settings.html +++ b/web/html/xui/settings.html @@ -105,6 +105,28 @@ + + + + + + + + + + + [[ value ]] + + + [[ key ]] + + + + + @@ -272,6 +294,31 @@ saveBtnDisable: true, user: {}, lang: getLang(), + showAlert: false, + remarkModels: {i:'Inbound',e:'Email',o:'Other'}, + remarkSeparators: [' ','-','_','@',':','~','|',',','.','/'], + remarkSample: '', + get remarkModel() { + rm = this.allSetting.remarkModel; + return rm.length>1 ? rm.substring(1).split('') : []; + }, + set remarkModel(value) { + rs = this.allSetting.remarkModel[0]; + this.allSetting.remarkModel = rs + value.join(''); + this.changeRemarkSample(); + }, + get remarkSeparator() { + return this.allSetting.remarkModel.length > 1 ? this.allSetting.remarkModel.charAt(0) : '-'; + }, + set remarkSeparator(value) { + this.allSetting.remarkModel = value + this.allSetting.remarkModel.substring(1); + this.changeRemarkSample(); + }, + changeRemarkSample(){ + sample = [] + this.remarkModel.forEach(r => sample.push(this.remarkModels[r])); + this.remarkSample = sample.length == 0 ? '' : sample.join(this.remarkSeparator); + } }, methods: { loading(spinning = true) { @@ -284,6 +331,7 @@ if (msg.success) { this.oldAllSetting = new AllSetting(msg.obj); this.allSetting = new AllSetting(msg.obj); + app.changeRemarkSample(); this.saveBtnDisable = true; } await this.fetchUserSecret(); -- cgit v1.2.3