v2.7.2
This commit is contained in:
parent
752c30cb29
commit
95afbf53da
@ -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 @@
|
||||
<!-- 遍历 clients,保证 speedLimit 字段存在且是数字 -->
|
||||
return clients.map(c => ({
|
||||
...c, <!-- 保留原有字段 -->
|
||||
speedLimit: Number(c.speedLimit || 0), <!-- 如果没设置就默认为 0 -->
|
||||
speedLimit: Number(c.speedLimit ?? 0), <!-- 如果没设置就默认为 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);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user