mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-17 20:54:40 +03:00
Group Management of Subscription Clients (#2644)
* add group user with the same subscription id to all inbounds * code format compare * add await for reset client traffic * en language changed * added client traffic syncer job * handle exist email duplicate in sub group * multi reset and delete request for clients group * add client traffic syncer setting option * vi translate file updated * auto open qr-modal bug fixed
This commit is contained in:
@@ -70,6 +70,41 @@ class HttpUtil {
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
static async jsonPost(url, data) {
|
||||
let msg;
|
||||
try {
|
||||
const requestOptions = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(data),
|
||||
};
|
||||
const resp = await fetch(url, requestOptions);
|
||||
const response = await resp.json();
|
||||
|
||||
msg = this._respToMsg({data : response});
|
||||
} catch (e) {
|
||||
msg = new Msg(false, e.toString());
|
||||
}
|
||||
this._handleMsg(msg);
|
||||
return msg;
|
||||
}
|
||||
|
||||
static async postWithModalJson(url, data, modal) {
|
||||
if (modal) {
|
||||
modal.loading(true);
|
||||
}
|
||||
const msg = await this.jsonPost(url, data);
|
||||
if (modal) {
|
||||
modal.loading(false);
|
||||
if (msg instanceof Msg && msg.success) {
|
||||
modal.close();
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
class PromiseUtil {
|
||||
|
||||
Reference in New Issue
Block a user