diff --git a/web/html/inbounds.html b/web/html/inbounds.html index 2986b5b0..243e4aa6 100644 --- a/web/html/inbounds.html +++ b/web/html/inbounds.html @@ -841,7 +841,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; @@ -1110,7 +1110,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({ @@ -1162,7 +1162,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 = { @@ -1187,7 +1187,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); @@ -1242,14 +1242,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); @@ -1274,7 +1274,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) { @@ -1287,10 +1287,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) { @@ -1369,7 +1369,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() @@ -1397,7 +1397,7 @@ return clients.map(c => ({ ...c, - speedLimit: Number(c.speedLimit || 0), + speedLimit: Number(c.speedLimit ?? 0), })); }, resetClientTraffic(client, dbInboundId, confirmation = true) { @@ -1408,10 +1408,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() { @@ -1421,7 +1421,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) { @@ -1431,7 +1431,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) { @@ -1441,7 +1441,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) { @@ -1567,7 +1567,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); }, }); },