Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
This commit is contained in:
MHSanaeiandAlireza Ahmadi committed 2023-04-11 15:41:04 +03:30
1 parent 519f2b462e
commit 7412bf17a9
6 files changed
+121 -33

No files matched your search

+3 -3
View File
@@ -1636,7 +1636,7 @@ Inbound.VLESSSettings = class extends Inbound.Settings {
toJson() {
return {
clients: Inbound.VLESSSettings.toJsonArray(this.vlesses),
decryption: this.decryption,
decryption: 'none',
fallbacks: Inbound.VLESSSettings.toJsonArray(this.fallbacks),
};
}
@@ -1696,7 +1696,7 @@ Inbound.VLESSSettings.VLESS = class extends XrayCommonClass {
}
};
Inbound.VLESSSettings.Fallback = class extends XrayCommonClass {
constructor(name="", alpn=[], path='', dest='', xver=0) {
constructor(name="", alpn='', path='', dest='', xver=0) {
super();
this.name = name;
this.alpn = alpn;
@@ -1835,7 +1835,7 @@ Inbound.TrojanSettings.Trojan = class extends XrayCommonClass {
};
Inbound.TrojanSettings.Fallback = class extends XrayCommonClass {
constructor(name="", alpn=[], path='', dest='', xver=0) {
constructor(name="", alpn='', path='', dest='', xver=0) {
super();
this.name = name;
this.alpn = alpn;
+25
View File
@@ -39,6 +39,8 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) {
g.POST("/restartXrayService", a.restartXrayService)
g.POST("/installXray/:version", a.installXray)
g.POST("/logs/:count", a.getLogs)
g.POST("/getConfigJson", a.getConfigJson)
g.GET("/getDb", a.getDb)
}
func (a *ServerController) refreshStatus() {
@@ -117,3 +119,26 @@ func (a *ServerController) getLogs(c *gin.Context) {
}
jsonObj(c, logs, nil)
}
func (a *ServerController) getConfigJson(c *gin.Context) {
configJson, err := a.serverService.GetConfigJson()
if err != nil {
jsonMsg(c, I18n(c, "getLogs"), err)
return
}
jsonObj(c, configJson, nil)
}
func (a *ServerController) getDb(c *gin.Context) {
db, err := a.serverService.GetDb()
if err != nil {
jsonMsg(c, I18n(c, "getLogs"), err)
return
}
// Set the headers for the response
c.Header("Content-Type", "application/octet-stream")
c.Header("Content-Disposition", "attachment; filename=xui.db")
// Write the file contents to the response
c.Writer.Write(db)
}
+1 -1
View File
@@ -240,7 +240,7 @@
return infoModal.dbInbound.isEnable;
},
get subBase() {
return window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port:"") + "/sub/";
return window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port:"") + basePath + "sub/";
},
get tgBase() {
return "https://t.me/"
Loaded 3 of 6 files, more files were not shown because too many files have changed in this diff. Show more