mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 02:38:28 +00:00
Fix possible race-collision (#2846)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false, groups:false,, apiFailure:false, updateFtlInfo:false, getGroups:false, processGroupResult:false */
|
||||
/* exported initTable */
|
||||
|
||||
var table;
|
||||
|
||||
@@ -82,7 +83,7 @@ $(function () {
|
||||
|
||||
reloadClientSuggestions();
|
||||
utils.setBsSelectDefaults();
|
||||
initTable();
|
||||
getGroups();
|
||||
|
||||
$("#select").on("change", function () {
|
||||
$("#ip-custom").val("");
|
||||
@@ -90,12 +91,9 @@ $(function () {
|
||||
});
|
||||
});
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function initTable() {
|
||||
table = $("#clientsTable")
|
||||
.on("preXhr.dt", function () {
|
||||
getGroups();
|
||||
})
|
||||
.DataTable({
|
||||
table = $("#clientsTable").DataTable({
|
||||
processing: true,
|
||||
ajax: {
|
||||
url: "/api/clients",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* This file is copyright under the latest version of the EUPL.
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global apiFailure:false, utils:false */
|
||||
/* global apiFailure:false, utils:false, initTable:false */
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var groups = [];
|
||||
@@ -18,6 +18,8 @@ function getGroups() {
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
groups = data.groups;
|
||||
// Actually load table contents
|
||||
initTable();
|
||||
},
|
||||
error: function (data) {
|
||||
apiFailure(data);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false, groups:false,, getGroups:false, updateFtlInfo:false, apiFailure:false, processGroupResult:false */
|
||||
/* exported initTable */
|
||||
|
||||
var table;
|
||||
var GETDict = {};
|
||||
@@ -44,7 +45,7 @@ $(function () {
|
||||
});
|
||||
|
||||
utils.setBsSelectDefaults();
|
||||
initTable();
|
||||
getGroups();
|
||||
});
|
||||
|
||||
// Show a list of suggested domains based on the user's input
|
||||
@@ -91,12 +92,9 @@ function hideSuggestDomains() {
|
||||
$("#suggest_domains").slideUp("fast");
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function initTable() {
|
||||
table = $("#domainsTable")
|
||||
.on("preXhr.dt", function () {
|
||||
getGroups();
|
||||
})
|
||||
.DataTable({
|
||||
table = $("#domainsTable").DataTable({
|
||||
processing: true,
|
||||
ajax: {
|
||||
url: "/api/domains",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Please see LICENSE file for your rights under this license. */
|
||||
|
||||
/* global utils:false, groups:false, apiFailure:false, updateFtlInfo:false, getGroups:false, processGroupResult:false */
|
||||
/* exported initTable */
|
||||
|
||||
var table;
|
||||
var GETDict = {};
|
||||
@@ -17,7 +18,7 @@ $(function () {
|
||||
$("#btnAddBlock").on("click", { type: "block" }, addList);
|
||||
|
||||
utils.setBsSelectDefaults();
|
||||
initTable();
|
||||
getGroups();
|
||||
});
|
||||
|
||||
function format(data) {
|
||||
@@ -98,12 +99,9 @@ function format(data) {
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function initTable() {
|
||||
table = $("#listsTable")
|
||||
.on("preXhr.dt", function () {
|
||||
getGroups();
|
||||
})
|
||||
.DataTable({
|
||||
table = $("#listsTable").DataTable({
|
||||
processing: true,
|
||||
ajax: {
|
||||
url: "/api/lists",
|
||||
|
||||
Reference in New Issue
Block a user