diff options
-rw-r--r-- | modules/minilinux.inc.php | 3 | ||||
-rw-r--r-- | templates/minilinux/filelist.html | 34 |
2 files changed, 29 insertions, 8 deletions
diff --git a/modules/minilinux.inc.php b/modules/minilinux.inc.php index 17cb7c86..8080b76d 100644 --- a/modules/minilinux.inc.php +++ b/modules/minilinux.inc.php @@ -38,7 +38,8 @@ class Page_MiniLinux extends Page $file['uid'] = 'dlid' . $count++; $local = CONFIG_HTTP_DIR . '/' . $system['id'] . '/' . $file['name']; if (!file_exists($local) || filesize($local) !== $file['size'] || md5_file($local) !== substr($file['md5'], 0, 32)) { - $file['changed'] = true; + $file['fileChanged'] = true; + $system['systemChanged'] = true; } $taskId = Property::getDownloadTask($file['md5']); if ($taskId !== false) { diff --git a/templates/minilinux/filelist.html b/templates/minilinux/filelist.html index fdc3f14e..6c9871b8 100644 --- a/templates/minilinux/filelist.html +++ b/templates/minilinux/filelist.html @@ -1,17 +1,32 @@ -<div class="container"> - {{#systems}} <div class="panel panel-default"> <div class="panel-heading"> <h4>{{title}}</h4> </div> <div class="panel-body" id="download-{{id}}"> + {{#systemChanged}} + <p> + Mindestens eine Komponente von <b>{{title}}</b> kann aktualisiert werden. Für einen reibungslosen Betrieb + wird empfohlen, alle Komponenten auf dem aktuellen Stand zu halten. + </p> + <p><span class="btn btn-primary" onclick="slxUpdateAll(this, 'download-{{id}}')">Aktualisieren</span></p> + {{/systemChanged}} + {{^systemChanged}} + <p>Das System ist auf dem aktuellen Stand.</p> + {{/systemChanged}} <ul class="list-group"> {{#files}} <li class="list-group-item" id="{{uid}}"> - {{name}} - {{#changed}}<span class="btn btn-success btn-sm" onclick="slxUpdate('{{uid}}', '{{id}}', '{{name}}')">Aktualisieren</span>{{/changed}} - {{^changed}}<span class="btn btn-default btn-sm" onclick="slxUpdate('{{uid}}', '{{id}}', '{{name}}')">Erneut herunterladen</span>{{/changed}} + <div class="row"> + <div class="col-sm-2">{{name}}</div> + <div class="col-xs-2"> + {{^fileChanged}}<span class="glyphicon glyphicon-ok"></span> <b>Aktuell</b>{{/fileChanged}} + {{#fileChanged}}<span class="glyphicon glyphicon-exclamation-sign"></span> <b>Veraltet</b>{{/fileChanged}} + </div> + <div class="col-xs-2"> + {{#fileChanged}}<span class="btn btn-primary btn-xs update-button" onclick="slxUpdate('{{uid}}', '{{id}}', '{{name}}')">Aktualisieren</span>{{/fileChanged}} + </div> + </div> {{{download}}} </li> {{/files}} @@ -22,11 +37,11 @@ {{^systems}} <div class="row well well-sm">Keine Konfigurationspakete gefunden!</div> {{/systems}} -</div> <script type="text/javascript"> function slxUpdate(uid, id, name) { + $('#' + uid).html(''); $('#' + uid).load('?do=MiniLinux', { action : "download", token : TOKEN, id : id, name : name }, function(response, status, xhr) { @@ -38,5 +53,10 @@ function slxUpdate(uid, id, name) } }); } +function slxUpdateAll(t, uid) +{ + $(t).hide(0); + $('#' + uid).find('.update-button').click(); +} tmInit(); -</script>
\ No newline at end of file +</script> |