|
|
@@ -23,6 +23,11 @@ $(function () {
|
|
|
})
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ $('.statusmodal').on('shown.bs.modal', function () {
|
|
|
+ labelID = $('.statusmodal #labelID').html();
|
|
|
+ refreshESLStatus(labelID);
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
@@ -71,3 +76,34 @@ function LoadConfig() {
|
|
|
})
|
|
|
.catch(err => toastr.error(err.url, `${err.status} (${err.statusText})`));
|
|
|
}
|
|
|
+
|
|
|
+function OpenESLDetails(labelID) {
|
|
|
+ $('.statusmodal #labelID').html(labelID);
|
|
|
+ $('.statusmodal').modal('show');
|
|
|
+}
|
|
|
+
|
|
|
+function fillStatusApList(ESLstatus) {
|
|
|
+ $('#esl_rssi_list').html('');
|
|
|
+ for (let [ap, rssi] of Object.entries(ESLstatus)) {
|
|
|
+ let ap_rssi = `<div class="ml-4"><span class="badge badge-primary">${ap}</span><span class="ml-2 badge text-inverse badge-warning">${rssi}</span></div>`;
|
|
|
+ $('#esl_rssi_list').append(ap_rssi);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function refreshESLStatus(labelID) {
|
|
|
+ AjaxReq(`${BASEURL}/admin/config`, {
|
|
|
+ method: 'POST',
|
|
|
+ body: JSON.stringify({"method": "geteslstatus", "label_id": labelID})
|
|
|
+ })
|
|
|
+ .then(json => {
|
|
|
+ $('#esl_rssi').html(json.value.status.rssi);
|
|
|
+ fillStatusApList(json.value.rssi);
|
|
|
+ toastr.success(json.err);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ if (err.url !== undefined)
|
|
|
+ toastr.error(err.url, `${err.status} (${err.statusText})`);
|
|
|
+ else
|
|
|
+ toastr.error(err);
|
|
|
+ });
|
|
|
+}
|