mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Always use document.body.dataset.apiurl instead of the intermediate const apiUrl
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -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 utils:false, apiUrl: false, NProgress:false */
|
||||
/* global utils:false, NProgress:false */
|
||||
|
||||
var _isLoginPage = true;
|
||||
|
||||
@@ -91,7 +91,7 @@ function doLogin(password) {
|
||||
NProgress.start();
|
||||
utils.disableAll();
|
||||
$.ajax({
|
||||
url: apiUrl + "/auth",
|
||||
url: document.body.dataset.apiurl + "/auth",
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
processData: false,
|
||||
@@ -163,7 +163,7 @@ function showDNSfailure() {
|
||||
$(function () {
|
||||
// Check if we need to login at all
|
||||
$.ajax({
|
||||
url: apiUrl + "/auth",
|
||||
url: document.body.dataset.apiurl + "/auth",
|
||||
})
|
||||
.done(function (data) {
|
||||
// If we are already logged in, redirect to dashboard
|
||||
@@ -182,7 +182,7 @@ $(function () {
|
||||
|
||||
// Get information about HTTPS port and DNS status
|
||||
$.ajax({
|
||||
url: apiUrl + "/info/login",
|
||||
url: document.body.dataset.apiurl + "/info/login",
|
||||
}).done(function (data) {
|
||||
if (data.dns === false) showDNSfailure();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user