Move repo download /update in to ajax backend code + added a button to check for updates
This commit is contained in:
parent
8e43a369fa
commit
5829a900e3
|
@ -2,14 +2,6 @@ Icon="NerdPack.png"
|
|||
Menu="NetworkServices"
|
||||
Title="Nerd Pack"
|
||||
---
|
||||
<?php
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php';
|
||||
|
||||
get_content_from_github($pkg_repo, $repo_file);
|
||||
get_content_from_github($pkg_desc, $desc_file);
|
||||
?>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="/plugins/tablesorter/css/tablesorter.css">
|
||||
<link type="text/css" rel="stylesheet" href="/plugins/tablesorter/css/tablesorter-<?=$display["theme"];?>.css">
|
||||
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
|
||||
|
@ -35,7 +27,7 @@ get_content_from_github($pkg_desc, $desc_file);
|
|||
</tbody>
|
||||
</table>
|
||||
|
||||
<button title="reset filters" type="button" class="reset">Reset</button>
|
||||
<input onclick="packageQuery(1)" value="Check for Updates" type="button"><input class="reset" value="Reset" type="button" title="reset filters">
|
||||
: <input id="btnApply" type="button" value="Apply"><input type="button" value="Done" onClick="done()">
|
||||
<input type="hidden" name="#file" value="NerdPack/NerdPack.cfg">
|
||||
</form>
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<?php
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php';
|
||||
|
||||
// Only download repo update if the current one is 1 hour old or more
|
||||
if (!is_file($repo_file) || !empty($_GET['force']) || (filemtime($repo_file) < (time() - 3600))) {
|
||||
get_content_from_github($pkg_repo, $repo_file);
|
||||
get_content_from_github($pkg_desc, $desc_file);
|
||||
}
|
||||
|
||||
$pkgs_array = [];
|
||||
|
||||
|
|
|
@ -81,9 +81,10 @@ $(function(){
|
|||
});
|
||||
|
||||
//list all available packages in a table
|
||||
function packageQuery() {
|
||||
function packageQuery(force) {
|
||||
$("#tblPackages tbody").html("<tr><td colspan=\"6\"><br><i class=\"fa fa-spinner fa-spin icon\"></i><em>Please wait, retrieving plugin information ...</em></td><tr>");
|
||||
$.getJSON("/plugins/NerdPack/include/PackageQuery.php", {force: force}, function(data) {
|
||||
$("#tblPackages tbody").empty();
|
||||
$.getJSON("/plugins/NerdPack/include/PackageQuery.php", function(data) {
|
||||
for (var i in data) {
|
||||
var Update;
|
||||
if (data[i].downloadeq == data[i].downloaded && data[i].installeq == data[i].installed)
|
||||
|
|
Loading…
Reference in New Issue
Block a user