feat: add frontend data reload option
This commit is contained in:
parent
090cec8242
commit
8772320cb1
2 changed files with 16 additions and 0 deletions
11
index.php
11
index.php
|
@ -102,6 +102,17 @@
|
||||||
}, 250);
|
}, 250);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function updateData() {
|
||||||
|
xmlHttp = new XMLHttpRequest();
|
||||||
|
params = "updateData=yes";
|
||||||
|
xmlHttp.open("POST", "src/server.php", true);
|
||||||
|
xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
||||||
|
xmlHttp.send(params);
|
||||||
|
flag = true;
|
||||||
|
return "UPDATED DATA FROM SERVER!"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
function isSameDay(a, b) {
|
function isSameDay(a, b) {
|
||||||
return a.toDateString() == b.toDateString();
|
return a.toDateString() == b.toDateString();
|
||||||
|
|
|
@ -189,3 +189,8 @@ function parseTOML()
|
||||||
$array = $parser::ParseFile(__DIR__ . "/../data.toml");
|
$array = $parser::ParseFile(__DIR__ . "/../data.toml");
|
||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($_POST['updateData'] != null && $_POST['updateData'] == "yes") {
|
||||||
|
updateRemoteData();
|
||||||
|
}
|
Loading…
Reference in a new issue