ver 0.7.0

This commit is contained in:
mariano
2026-06-24 12:16:04 +02:00
parent 9582554dfe
commit fcf8f54747
6 changed files with 13 additions and 94 deletions
+8 -2
View File
@@ -8,7 +8,8 @@
if (!serverId || !resultBox) return;
var xhr = new XMLHttpRequest();
xhr.open('POST', '/plugins/urbackup/front/server_test.ajax.php', true);
var pluginUrl = (window.CFG_GLPI && CFG_GLPI.root_doc ? CFG_GLPI.root_doc : '') + '/plugins/urbackup';
xhr.open('POST', pluginUrl + '/front/server_test.ajax.php', true);
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.setRequestHeader('X-Glpi-Csrf-Token', getAjaxCsrfToken());
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
@@ -39,7 +40,12 @@
resultBox.innerHTML = '<span class="text-danger fw-bold"><i class="ti ti-x"></i> API connection failed</span><br><small class="text-muted">Network error</small>';
};
xhr.send('id=' + encodeURIComponent(serverId));
var csrfToken = getAjaxCsrfToken();
var params = 'id=' + encodeURIComponent(serverId);
if (csrfToken) {
params += '&_glpi_csrf_token=' + encodeURIComponent(csrfToken);
}
xhr.send(params);
}
function initApiStatusCheck() {