Browse Source

some changes

Co-Authored-By: Alireza Ahmadi <[email protected]>
MHSanaei 1 year ago
parent
commit
6b5535e60a

+ 2 - 2
web/html/xui/inbound_client_table.html

@@ -40,7 +40,7 @@
     <a-switch v-model="client.enable" @change="switchEnableClient(record.id,client)"></a-switch>
 </template>   
 <template slot="online" slot-scope="text, client, index">
-    <template v-if="isClientOnline(client.email)">
+    <template v-if="client.enable && isClientOnline(client.email)">
         <a-tag color="green">{{ i18n "online" }}</a-tag>
     </template>
     <template v-else>
@@ -52,7 +52,7 @@
         <template slot="title">
             <template v-if="!isClientEnabled(record, client.email)">{{ i18n "depleted" }}</template>
             <template v-else-if="!client.enable">{{ i18n "disabled" }}</template>
-            <template v-else-if="isClientOnline(client.email)">{{ i18n "online" }}</template>
+            <template v-else-if="client.enable && isClientOnline(client.email)">{{ i18n "online" }}</template>
         </template>
     <a-badge :class="isClientOnline(client.email)? 'online-animation' : ''" :color="client.enable ? statsExpColor(record, client.email) : themeSwitcher.isDarkTheme ? '#2c3950' : '#bcbcbc'">
     </a-badge>

+ 2 - 2
web/html/xui/inbounds.html

@@ -133,7 +133,7 @@
                                                 <a-icon type="export"></a-icon>
                                                 {{ i18n "pages.inbounds.export" }}
                                             </a-menu-item>
-                                            <a-menu-item key="subs">
+                                            <a-menu-item key="subs" v-if="subSettings.enable">
                                                 <a-icon type="export"></a-icon>
                                                 {{ i18n "pages.inbounds.export" }} - {{ i18n "pages.settings.subSettings" }}
                                             </a-menu-item>
@@ -221,7 +221,7 @@
                                                 <a-icon type="export"></a-icon>
                                                 {{ i18n "pages.inbounds.export"}}
                                             </a-menu-item>
-                                            <a-menu-item key="subs">
+                                            <a-menu-item key="subs" v-if="subSettings.enable">
                                                 <a-icon type="export"></a-icon>
                                                 {{ i18n "pages.inbounds.export"}} - {{ i18n "pages.settings.subSettings" }}
                                             </a-menu-item>

+ 4 - 5
web/html/xui/index.html

@@ -313,7 +313,7 @@
             </a-form-item>
             <a-form-item>
                 <a-button type="primary" style="margin-bottom: 10px;"
-                :href="'data:application/text;charset=utf-8,' + encodeURIComponent(logModal.logs.join('\n'))" download="x-ui.log">
+                :href="'data:application/text;charset=utf-8,' + encodeURIComponent(logModal.logs)" download="x-ui.log">
                     {{ i18n "download" }} x-ui.log
                 </a-button>
             </a-form-item>
@@ -446,16 +446,15 @@
 
     const logModal = {
         visible: false,
-        logs: [],
-        formattedLogs: '',
+        logs: '',
         rows: 20,
         level: 'info',
         syslog: false,
         loading: false,
         show(logs) {
             this.visible = true;
-            this.logs = logs || []; 
-            this.formattedLogs = this.logs.length > 0 ? this.formatLogs(this.logs) : "No Record...";
+            this.logs = logs; 
+            this.formattedLogs = this.logs?.length > 0 ? this.formatLogs(this.logs) : "No Record...";
         },
         formatLogs(logs) {
             let formattedLogs = '';

+ 4 - 4
xray/log_writer.go

@@ -31,13 +31,13 @@ func (lw *LogWriter) Write(m []byte) (n int, err error) {
 			// Map the level to the appropriate logger function
 			switch level {
 			case "Debug":
-				logger.Debug(msgBody)
+				logger.Debug("XRAY: " + msgBody)
 			case "Info":
-				logger.Info(msgBody)
+				logger.Info("XRAY: " + msgBody)
 			case "Warning":
-				logger.Warning(msgBody)
+				logger.Warning("XRAY: " + msgBody)
 			case "Error":
-				logger.Error(msgBody)
+				logger.Error("XRAY: " + msgBody)
 			default:
 				logger.Debug("XRAY: " + msg)
 			}