mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-12 11:18:27 +00:00
fix urls + use the new buildURL func
This commit is contained in:
parent
1c9fc9422e
commit
b203067dfd
6 changed files with 23 additions and 33 deletions
|
@ -216,7 +216,7 @@ Reference syntax:
|
||||||
- CPU threshold notification
|
- CPU threshold notification
|
||||||
- Threshold for Expiration time and Traffic to report in advance
|
- Threshold for Expiration time and Traffic to report in advance
|
||||||
- Support client report menu if client's telegram username added to the user's configurations
|
- Support client report menu if client's telegram username added to the user's configurations
|
||||||
- Support telegram traffic report searched with UID (VMESS/VLESS) or Password (TROJAN) - anonymously
|
- Support telegram traffic report searched with UUID (VMESS/VLESS) or Password (TROJAN) - anonymously
|
||||||
- Menu based bot
|
- Menu based bot
|
||||||
- Search client by email ( only admin )
|
- Search client by email ( only admin )
|
||||||
- Check all inbounds
|
- Check all inbounds
|
||||||
|
|
|
@ -68,8 +68,8 @@
|
||||||
qrModal: qrModal,
|
qrModal: qrModal,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
copyToClipboard(elmentId,content) {
|
copyToClipboard(elmentId, content) {
|
||||||
this.qrModal.clipboard = new ClipboardJS('#'+elmentId, {
|
this.qrModal.clipboard = new ClipboardJS('#' + elmentId, {
|
||||||
text: () => content,
|
text: () => content,
|
||||||
});
|
});
|
||||||
this.qrModal.clipboard.on('success', () => {
|
this.qrModal.clipboard.on('success', () => {
|
||||||
|
@ -77,29 +77,25 @@
|
||||||
this.qrModal.clipboard.destroy();
|
this.qrModal.clipboard.destroy();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
setQrCode(elmentId,content) {
|
setQrCode(elmentId, content) {
|
||||||
new QRious({
|
new QRious({
|
||||||
element: document.querySelector('#'+elmentId),
|
element: document.querySelector('#' + elmentId),
|
||||||
size: 260,
|
size: 260,
|
||||||
value: content,
|
value: content,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
genSubLink(subID) {
|
genSubLink(subID) {
|
||||||
protocol = app.subSettings.tls ? "https://" : "http://";
|
const { domain: host, port, tls: isTLS, path: base } = app.subSettings;
|
||||||
hostName = app.subSettings.domain === "" ? window.location.hostname : app.subSettings.domain;
|
return buildURL({ host, port, isTLS, base, path: subID });
|
||||||
subPort = app.subSettings.port;
|
|
||||||
port = (subPort === 443 && app.subSettings.tls) || (subPort === 80 && !app.subSettings.tls) ? "" : ":" + String(subPort);
|
|
||||||
subPath = app.subSettings.path;
|
|
||||||
return protocol + hostName + port + subPath + subID;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated() {
|
updated() {
|
||||||
if (qrModal.client && qrModal.client.subId){
|
if (qrModal.client && qrModal.client.subId) {
|
||||||
qrModal.subId = qrModal.client.subId;
|
qrModal.subId = qrModal.client.subId;
|
||||||
this.setQrCode("qrCode-sub",this.genSubLink(qrModal.subId));
|
this.setQrCode("qrCode-sub", this.genSubLink(qrModal.subId));
|
||||||
}
|
}
|
||||||
qrModal.qrcodes.forEach((element,index) => {
|
qrModal.qrcodes.forEach((element, index) => {
|
||||||
this.setQrCode("qrCode-"+index, element.link);
|
this.setQrCode("qrCode-" + index, element.link);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -253,12 +253,8 @@
|
||||||
infoModal.visible = false;
|
infoModal.visible = false;
|
||||||
},
|
},
|
||||||
genSubLink(subID) {
|
genSubLink(subID) {
|
||||||
protocol = app.subSettings.tls ? "https://" : "http://";
|
const { domain: host, port, tls: isTLS, path: base } = app.subSettings;
|
||||||
hostName = app.subSettings.domain === "" ? window.location.hostname : app.subSettings.domain;
|
return buildURL({ host, port, isTLS, base, path: subID });
|
||||||
subPort = app.subSettings.port;
|
|
||||||
port = (subPort === 443 && app.subSettings.tls) || (subPort === 80 && !app.subSettings.tls) ? "" : ":" + String(subPort);
|
|
||||||
subPath = app.subSettings.path;
|
|
||||||
return protocol + hostName + port + subPath + subID;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
set multiDomain(value) {
|
set multiDomain(value) {
|
||||||
if (value) {
|
if (value) {
|
||||||
inModal.inbound.stream.tls.server = "";
|
inModal.inbound.stream.tls.server = "";
|
||||||
inModal.inbound.stream.tls.settings.domains = [{remark: "", domain: window.location.host.split(":")[0]}];
|
inModal.inbound.stream.tls.settings.domains = [{ remark: "", domain: window.location.hostname }];
|
||||||
} else {
|
} else {
|
||||||
inModal.inbound.stream.tls.server = "";
|
inModal.inbound.stream.tls.server = "";
|
||||||
inModal.inbound.stream.tls.settings.domains = [];
|
inModal.inbound.stream.tls.settings.domains = [];
|
||||||
|
|
|
@ -311,7 +311,7 @@
|
||||||
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
|
{ title: '{{ i18n "pages.inbounds.client" }}', width: 80, scopedSlots: { customRender: 'client' } },
|
||||||
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
|
{ title: '{{ i18n "pages.inbounds.traffic" }}↑|↓', width: 120, scopedSlots: { customRender: 'traffic' } },
|
||||||
{ title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
|
{ title: '{{ i18n "pages.inbounds.expireDate" }}', width: 70, scopedSlots: { customRender: 'expiryTime' } },
|
||||||
{ title: 'UID', width: 120, dataIndex: "id" },
|
{ title: 'UUID', width: 120, dataIndex: "id" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const innerTrojanColumns = [
|
const innerTrojanColumns = [
|
||||||
|
|
|
@ -523,7 +523,7 @@
|
||||||
this.loading(false);
|
this.loading(false);
|
||||||
if (msg.success) {
|
if (msg.success) {
|
||||||
this.user = {};
|
this.user = {};
|
||||||
window.location.replace(basePath + "logout")
|
window.location.replace(basePath + "logout");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async restartPanel() {
|
async restartPanel() {
|
||||||
|
@ -542,12 +542,10 @@
|
||||||
if (msg.success) {
|
if (msg.success) {
|
||||||
this.loading(true);
|
this.loading(true);
|
||||||
await PromiseUtil.sleep(5000);
|
await PromiseUtil.sleep(5000);
|
||||||
let protocol = "http://";
|
const { webCertFile, webKeyFile, webDomain: host, webPort: port, webBasePath: base } = this.allSetting;
|
||||||
if (this.allSetting.webCertFile !== "") {
|
const isTLS = webCertFile !== "" || webKeyFile !== "";
|
||||||
protocol = "https://";
|
const url = buildURL({ host, port, isTLS, base, path: "panel/settings" });
|
||||||
}
|
window.location.replace(url);
|
||||||
const { host } = window.location;
|
|
||||||
window.location.replace(protocol + host + this.allSetting.webBasePath + "panel/settings");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async fetchUserSecret() {
|
async fetchUserSecret() {
|
||||||
|
|
Loading…
Reference in a new issue