diff options
| author | Sanaei <ho3ein.sanaei@gmail.com> | 2025-09-09 02:22:43 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-09 03:32:05 +0300 |
| commit | fe9f0d1d0e86f55a97e3905358888f595b9bd08b (patch) | |
| tree | 2210606a64b38e89edf4197268957913efbb7f06 /web/html | |
| parent | 18d74d54caa5f55b8d9048b49ad28b42be31b322 (diff) | |
api (#3434)
Diffstat (limited to 'web/html')
| -rw-r--r-- | web/html/form/protocol/vless.html | 2 | ||||
| -rw-r--r-- | web/html/inbounds.html | 34 | ||||
| -rw-r--r-- | web/html/index.html | 26 | ||||
| -rw-r--r-- | web/html/modals/client_modal.html | 6 | ||||
| -rw-r--r-- | web/html/modals/inbound_info_modal.html | 4 | ||||
| -rw-r--r-- | web/html/modals/inbound_modal.html | 8 | ||||
| -rw-r--r-- | web/html/modals/qrcode_modal.html | 2 | ||||
| -rw-r--r-- | web/html/xray.html | 2 |
8 files changed, 42 insertions, 42 deletions
diff --git a/web/html/form/protocol/vless.html b/web/html/form/protocol/vless.html index baa5a285..140b9c1a 100644 --- a/web/html/form/protocol/vless.html +++ b/web/html/form/protocol/vless.html @@ -30,7 +30,7 @@ <a-input v-model.trim="inbound.settings.decryption"></a-input> </a-form-item> <a-form-item label="encryption"> - <a-input v-model="inbound.settings.encryption" disabled></a-input> + <a-input v-model="inbound.settings.encryption"></a-input> </a-form-item> <a-form-item label=" "> <a-space> diff --git a/web/html/inbounds.html b/web/html/inbounds.html index 81ef1b39..830c940f 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -830,7 +830,7 @@ }, async getDBInbounds() { this.refreshing = true; - const msg = await HttpUtil.post('/panel/inbound/list'); + const msg = await HttpUtil.get('/panel/api/inbounds/list'); if (!msg.success) { this.refreshing = false; return; @@ -845,7 +845,7 @@ }, 500); }, async getOnlineUsers() { - const msg = await HttpUtil.post('/panel/inbound/onlines'); + const msg = await HttpUtil.post('/panel/api/inbounds/onlines'); if (!msg.success) { return; } @@ -1099,7 +1099,7 @@ streamSettings: baseInbound.stream.toString(), sniffing: baseInbound.sniffing.toString(), }; - await this.submit('/panel/inbound/add', data, inModal); + await this.submit('/panel/api/inbounds/add', data, inModal); }, openAddInbound() { inModal.show({ @@ -1148,7 +1148,7 @@ } data.sniffing = inbound.sniffing.toString(); - await this.submit('/panel/inbound/add', data, inModal); + await this.submit('/panel/api/inbounds/add', data, inModal); }, async updateInbound(inbound, dbInbound) { const data = { @@ -1171,7 +1171,7 @@ } data.sniffing = inbound.sniffing.toString(); - await this.submit(`/panel/inbound/update/${dbInbound.id}`, data, inModal); + await this.submit(`/panel/api/inbounds/update/${dbInbound.id}`, data, inModal); }, openAddClient(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -1226,14 +1226,14 @@ id: dbInboundId, settings: '{"clients": [' + clients.toString() + ']}', }; - await this.submit(`/panel/inbound/addClient`, data, modal); + await this.submit(`/panel/api/inbounds/addClient`, data, modal); }, async updateClient(client, dbInboundId, clientId) { const data = { id: dbInboundId, settings: '{"clients": [' + client.toString() + ']}', }; - await this.submit(`/panel/inbound/updateClient/${clientId}`, data, clientModal); + await this.submit(`/panel/api/inbounds/updateClient/${clientId}`, data, clientModal); }, resetTraffic(dbInboundId) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); @@ -1258,7 +1258,7 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/panel/inbound/del/' + dbInboundId), + onOk: () => this.submit('/panel/api/inbounds/del/' + dbInboundId), }); }, delClient(dbInboundId, client,confirmation = true) { @@ -1271,10 +1271,10 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`), + onOk: () => this.submit(`/panel/api/inbounds/${dbInboundId}/delClient/${clientId}`), }); } else { - this.submit(`/panel/inbound/${dbInboundId}/delClient/${clientId}`); + this.submit(`/panel/api/inbounds/${dbInboundId}/delClient/${clientId}`); } }, getSubGroupClients(dbInbounds, currentClient) { @@ -1353,7 +1353,7 @@ switchEnable(dbInboundId,state) { dbInbound = this.dbInbounds.find(row => row.id === dbInboundId); dbInbound.enable = state; - this.submit(`/panel/inbound/update/${dbInboundId}`, dbInbound); + this.submit(`/panel/api/inbounds/update/${dbInboundId}`, dbInbound); }, async switchEnableClient(dbInboundId, client) { this.loading() @@ -1383,10 +1383,10 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/panel/inbound/' + dbInboundId + '/resetClientTraffic/' + client.email), + onOk: () => this.submit('/panel/api/inbounds/' + dbInboundId + '/resetClientTraffic/' + client.email), }) } else { - this.submit('/panel/inbound/' + dbInboundId + '/resetClientTraffic/' + client.email); + this.submit('/panel/api/inbounds/' + dbInboundId + '/resetClientTraffic/' + client.email); } }, resetAllTraffic() { @@ -1396,7 +1396,7 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/panel/inbound/resetAllTraffics'), + onOk: () => this.submit('/panel/api/inbounds/resetAllTraffics'), }); }, resetAllClientTraffics(dbInboundId) { @@ -1406,7 +1406,7 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "reset"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/panel/inbound/resetAllClientTraffics/' + dbInboundId), + onOk: () => this.submit('/panel/api/inbounds/resetAllClientTraffics/' + dbInboundId), }) }, delDepletedClients(dbInboundId) { @@ -1416,7 +1416,7 @@ class: themeSwitcher.currentTheme, okText: '{{ i18n "delete"}}', cancelText: '{{ i18n "cancel"}}', - onOk: () => this.submit('/panel/inbound/delDepletedClients/' + dbInboundId), + onOk: () => this.submit('/panel/api/inbounds/delDepletedClients/' + dbInboundId), }) }, isExpiry(dbInbound, index) { @@ -1542,7 +1542,7 @@ value: '', okText: '{{ i18n "pages.inbounds.import" }}', confirm: async (dbInboundText) => { - await this.submit('/panel/inbound/import', {data: dbInboundText}, promptModal); + await this.submit('/panel/api/inbounds/import', {data: dbInboundText}, promptModal); }, }); }, diff --git a/web/html/index.html b/web/html/index.html index 42b8a032..5d5c3b1d 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -746,7 +746,7 @@ ${dateTime} }, async getStatus() { try { - const msg = await HttpUtil.post('/server/status'); + const msg = await HttpUtil.get('/panel/api/server/status'); if (msg.success) { if (!this.loadingStates.fetched) { this.loadingStates.fetched = true; @@ -763,7 +763,7 @@ ${dateTime} }, async openSelectV2rayVersion() { this.loading(true); - const msg = await HttpUtil.post('server/getXrayVersion'); + const msg = await HttpUtil.get('/panel/api/server/getXrayVersion'); this.loading(false); if (!msg.success) { return; @@ -780,7 +780,7 @@ ${dateTime} onOk: async () => { versionModal.hide(); this.loading(true, '{{ i18n "pages.index.dontRefresh"}}'); - await HttpUtil.post(`/server/installXray/${version}`); + await HttpUtil.post(`/panel/api/server/installXray/${version}`); this.loading(false); }, }); @@ -798,9 +798,9 @@ ${dateTime} onOk: async () => { versionModal.hide(); this.loading(true, '{{ i18n "pages.index.dontRefresh"}}'); - const url = isSingleFile - ? `/server/updateGeofile/${fileName}` - : `/server/updateGeofile`; + const url = isSingleFile + ? `/panel/api/server/updateGeofile/${fileName}` + : `/panel/api/server/updateGeofile`; await HttpUtil.post(url); this.loading(false); }, @@ -808,7 +808,7 @@ ${dateTime} }, async stopXrayService() { this.loading(true); - const msg = await HttpUtil.post('server/stopXrayService'); + const msg = await HttpUtil.post('/panel/api/server/stopXrayService'); this.loading(false); if (!msg.success) { return; @@ -816,7 +816,7 @@ ${dateTime} }, async restartXrayService() { this.loading(true); - const msg = await HttpUtil.post('server/restartXrayService'); + const msg = await HttpUtil.post('/panel/api/server/restartXrayService'); this.loading(false); if (!msg.success) { return; @@ -824,7 +824,7 @@ ${dateTime} }, async openLogs(){ logModal.loading = true; - const msg = await HttpUtil.post('server/logs/'+logModal.rows,{level: logModal.level, syslog: logModal.syslog}); + const msg = await HttpUtil.post('/panel/api/server/logs/'+logModal.rows,{level: logModal.level, syslog: logModal.syslog}); if (!msg.success) { return; } @@ -834,7 +834,7 @@ ${dateTime} }, async openXrayLogs(){ xraylogModal.loading = true; - const msg = await HttpUtil.post('server/xraylogs/'+xraylogModal.rows,{filter: xraylogModal.filter, showDirect: xraylogModal.showDirect, showBlocked: xraylogModal.showBlocked, showProxy: xraylogModal.showProxy}); + const msg = await HttpUtil.post('/panel/api/server/xraylogs/'+xraylogModal.rows,{filter: xraylogModal.filter, showDirect: xraylogModal.showDirect, showBlocked: xraylogModal.showBlocked, showProxy: xraylogModal.showProxy}); if (!msg.success) { return; } @@ -844,7 +844,7 @@ ${dateTime} }, async openConfig() { this.loading(true); - const msg = await HttpUtil.post('server/getConfigJson'); + const msg = await HttpUtil.get('/panel/api/server/getConfigJson'); this.loading(false); if (!msg.success) { return; @@ -855,7 +855,7 @@ ${dateTime} backupModal.show(); }, exportDatabase() { - window.location = basePath + 'server/getDb'; + window.location = basePath + 'panel/api/server/getDb'; }, importDatabase() { const fileInput = document.createElement('input'); @@ -868,7 +868,7 @@ ${dateTime} formData.append('db', dbFile); backupModal.hide(); this.loading(true); - const uploadMsg = await HttpUtil.post('server/importDB', formData, { + const uploadMsg = await HttpUtil.post('/panel/api/server/importDB', formData, { headers: { 'Content-Type': 'multipart/form-data', } diff --git a/web/html/modals/client_modal.html b/web/html/modals/client_modal.html index 623e720d..8b57b8b2 100644 --- a/web/html/modals/client_modal.html +++ b/web/html/modals/client_modal.html @@ -121,7 +121,7 @@ }, methods: { async getDBClientIps(email) { - const msg = await HttpUtil.post(`/panel/inbound/clientIps/${email}`); + const msg = await HttpUtil.post(`/panel/api/inbounds/clientIps/${email}`); if (!msg.success) { document.getElementById("clientIPs").value = msg.obj; return; @@ -139,7 +139,7 @@ }, async clearDBClientIps(email) { try { - const msg = await HttpUtil.post(`/panel/inbound/clearClientIps/${email}`); + const msg = await HttpUtil.post(`/panel/api/inbounds/clearClientIps/${email}`); if (!msg.success) { return; } @@ -156,7 +156,7 @@ cancelText: '{{ i18n "cancel"}}', onOk: async () => { iconElement.disabled = true; - const msg = await HttpUtil.postWithModal('/panel/inbound/' + dbInboundId + '/resetClientTraffic/' + email); + const msg = await HttpUtil.postWithModal('/panel/api/inbounds/' + dbInboundId + '/resetClientTraffic/' + email); if (msg.success) { this.clientModal.clientStats.up = 0; this.clientModal.clientStats.down = 0; diff --git a/web/html/modals/inbound_info_modal.html b/web/html/modals/inbound_info_modal.html index 4110c244..0f29d318 100644 --- a/web/html/modals/inbound_info_modal.html +++ b/web/html/modals/inbound_info_modal.html @@ -492,7 +492,7 @@ </a-modal> <script> function refreshIPs(email) { - return HttpUtil.post(`/panel/inbound/clientIps/${email}`).then((msg) => { + return HttpUtil.post(`/panel/api/inbounds/clientIps/${email}`).then((msg) => { if (msg.success) { try { return JSON.parse(msg.obj).join(', '); @@ -613,7 +613,7 @@ }); }, clearClientIps() { - HttpUtil.post(`/panel/inbound/clearClientIps/${this.infoModal.clientStats.email}`) + HttpUtil.post(`/panel/api/inbounds/clearClientIps/${this.infoModal.clientStats.email}`) .then((msg) => { if (!msg.success) { return; diff --git a/web/html/modals/inbound_modal.html b/web/html/modals/inbound_modal.html index 60771c25..176f2eee 100644 --- a/web/html/modals/inbound_modal.html +++ b/web/html/modals/inbound_modal.html @@ -132,7 +132,7 @@ }, async getNewX25519Cert() { inModal.loading(true); - const msg = await HttpUtil.post('/server/getNewX25519Cert'); + const msg = await HttpUtil.get('/panel/api/server/getNewX25519Cert'); inModal.loading(false); if (!msg.success) { return; @@ -146,7 +146,7 @@ }, async getNewmldsa65() { inModal.loading(true); - const msg = await HttpUtil.post('/server/getNewmldsa65'); + const msg = await HttpUtil.get('/panel/api/server/getNewmldsa65'); inModal.loading(false); if (!msg.success) { return; @@ -160,7 +160,7 @@ }, async getNewEchCert() { inModal.loading(true); - const msg = await HttpUtil.post('/server/getNewEchCert', { sni: inModal.inbound.stream.tls.sni }); + const msg = await HttpUtil.post('/panel/api/server/getNewEchCert', { sni: inModal.inbound.stream.tls.sni }); inModal.loading(false); if (!msg.success) { return; @@ -174,7 +174,7 @@ }, async getNewVlessEnc() { inModal.loading(true); - const msg = await HttpUtil.post('/server/getNewVlessEnc'); + const msg = await HttpUtil.get('/panel/api/server/getNewVlessEnc'); inModal.loading(false); if (!msg.success) { diff --git a/web/html/modals/qrcode_modal.html b/web/html/modals/qrcode_modal.html index e67dc640..ef438b74 100644 --- a/web/html/modals/qrcode_modal.html +++ b/web/html/modals/qrcode_modal.html @@ -151,7 +151,7 @@ methods: { async getStatus() { try { - const msg = await HttpUtil.post('/server/status'); + const msg = await HttpUtil.get('/panel/api/server/status'); if (msg.success) { this.serverStatus = msg.obj; } diff --git a/web/html/xray.html b/web/html/xray.html index b6e40858..919989a4 100644 --- a/web/html/xray.html +++ b/web/html/xray.html @@ -420,7 +420,7 @@ }, async restartXray() { this.loading(true); - const msg = await HttpUtil.post("server/restartXrayService"); + const msg = await HttpUtil.post("/panel/api/server/restartXrayService"); this.loading(false); if (msg.success) { await PromiseUtil.sleep(500); |
