diff options
| author | Simon Rettberg | 2025-05-08 18:19:28 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2025-05-08 18:19:28 +0200 |
| commit | bcd2fd613ec7a29b05ab90dc4739e974c2060811 (patch) | |
| tree | 73ca733cf13e61c993ed7c639b008f418106e5a6 /modules-available | |
| parent | index.php: Add comment to hostname redirect check stuff (diff) | |
| download | slx-admin-bcd2fd613ec7a29b05ab90dc4739e974c2060811.tar.gz slx-admin-bcd2fd613ec7a29b05ab90dc4739e974c2060811.tar.xz slx-admin-bcd2fd613ec7a29b05ab90dc4739e974c2060811.zip | |
Change non-modifying AJAX requests from POST to GET
Diffstat (limited to 'modules-available')
6 files changed, 11 insertions, 9 deletions
diff --git a/modules-available/dnbd3/templates/page-serverlist.html b/modules-available/dnbd3/templates/page-serverlist.html index bcb0d766..9ac2d9ec 100644 --- a/modules-available/dnbd3/templates/page-serverlist.html +++ b/modules-available/dnbd3/templates/page-serverlist.html @@ -482,7 +482,7 @@ document.addEventListener('DOMContentLoaded', function () { } inactiveCount = 0; } - $.ajax('?do=dnbd3&action=stats').done(function(elist) { + $.get('?do=dnbd3&action=stats').done(function(elist) { var speedSum = 0; for (var k in elist) { var e = elist[k]; @@ -571,4 +571,4 @@ document.addEventListener('DOMContentLoaded', function () { }; }); -//--></script>
\ No newline at end of file +//--></script> diff --git a/modules-available/eventlog/page.inc.php b/modules-available/eventlog/page.inc.php index 56fc97e2..540613dd 100644 --- a/modules-available/eventlog/page.inc.php +++ b/modules-available/eventlog/page.inc.php @@ -46,6 +46,7 @@ class Page_EventLog extends Page protected function doAjax() { // XXX Should go into rules.inc.php + User::load(); User::assertPermission('filter.rules.edit'); if (Request::any('show') === 'rules') { $type = Request::any('type', Request::REQUIRED, 'string'); @@ -62,6 +63,8 @@ class Page_EventLog extends Page ksort($output); Header('Content-Type: application/json'); echo json_encode($output); + } else { + echo "ERROR"; } } diff --git a/modules-available/eventlog/templates/page-filters-edit-rule.html b/modules-available/eventlog/templates/page-filters-edit-rule.html index 1ffd73c7..374b4ee6 100644 --- a/modules-available/eventlog/templates/page-filters-edit-rule.html +++ b/modules-available/eventlog/templates/page-filters-edit-rule.html @@ -158,8 +158,8 @@ return; } $.ajax('?do=eventlog&show=rules', { - data: {type: typeVal, token: TOKEN}, - method: 'POST', + data: {type: typeVal}, + method: 'GET', dataType: 'json' }).done(function (data) { typeSamples[typeVal] = data; diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index f07dca56..3a938ff9 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -286,7 +286,7 @@ class Page_Statistics extends Page } if ($action === 'json-lookup') { $reply = []; - foreach (Request::post('list', [], 'array') as $item) { + foreach (Request::any('list', [], 'array') as $item) { $name = PciId::getPciId(PciId::AUTO, $item, true); if ($name === false) { $name = '?????'; diff --git a/modules-available/statistics/templates/js-pciquery.html b/modules-available/statistics/templates/js-pciquery.html index 5d4df867..55683161 100644 --- a/modules-available/statistics/templates/js-pciquery.html +++ b/modules-available/statistics/templates/js-pciquery.html @@ -4,8 +4,7 @@ var doQuery = function() { if (missing && missing.length > 0) { $.ajax({ - url: '?do=statistics', dataType: "json", method: "POST", data: { - token: TOKEN, + url: '?do=statistics', dataType: "json", method: "GET", data: { action: 'json-lookup', list: missing.splice(0, 10) // Query 10 at a time max } @@ -21,4 +20,4 @@ } doQuery(); }); -</script>
\ No newline at end of file +</script> diff --git a/modules-available/systemstatus/templates/systeminfo.html b/modules-available/systemstatus/templates/systeminfo.html index 2489bcaa..3cb19861 100644 --- a/modules-available/systemstatus/templates/systeminfo.html +++ b/modules-available/systemstatus/templates/systeminfo.html @@ -117,7 +117,7 @@ setTimeout(updateSystem, 2500); return; } - $.post('?do=SystemStatus&action=SysPoll', {token: TOKEN}, function (data) { + $.get('?do=SystemStatus&action=SysPoll', function (data) { if (memCircle && data.MemPercent) memCircle.update(data.MemPercent); if (swapCircle && data.SwapPercent) swapCircle.update(data.SwapPercent); if (cpuCircle && data.CpuIdle) { |
