return $ok;
}
+
+ public static function getrescanAction()
+ {
+ $mtime = filemtime(Config::main()->get('cache'));
+
+ return array('modified' => date ("d. F Y H:i:s", $mtime));
+ }
+
+ public static function rescanAction()
+ {
+ $mtime = filemtime(Config::main()->get('cache'));
+ if ($mtime > time()-10)
+ return array('info' => 'Rescan läuft gerade und kann nicht erneut getriggert werden.');
+
+ if (($f = fopen(Config::main()->get('rescan_file'), 'w')) !== false) {
+ fwrite($f, time());
+ fclose($f);
+ return true;
+ }
+
+ return false;
+ }
}
return false;
}
+function submit_rescan() {
+ $.post('index.php',
+ 'action=rescan',
+ function(data){
+ if (data) {
+ if (data.info)
+ response(data.info);
+ else
+ response('Rescan wurde getriggert.<br>Die Medienliste wird neu aufgebaut.');
+ }
+ });
+
+ return false;
+}
+
function submit_admin() {
$.post('index.php',
'action=admin&' + $('div.w3-container#admin form').serialize());
<h3 class="w3-padding-64"><b><?=Config::main()->get('title')?></b></h3>
</div>
<div class="w3-bar-block" style="padding-top:5px;">
- <a href="#" onclick="open_page('home')" class="w3-bar-item w3-button w3-hover-white">Home</a>
+ <a href="/admin/" onclick="open_page('home')" class="w3-bar-item w3-button w3-hover-white">Home</a>
<a href="#" onclick="open_page('datetime')" class="w3-bar-item w3-button w3-hover-white">Date/Time</a>
<a href="#" onclick="open_page('wifi')" class="w3-bar-item w3-button w3-hover-white">WiFi</a>
<a href="#" onclick="open_page('shares')" class="w3-bar-item w3-button w3-hover-white">Shares</a>
+ <a href="#" onclick="open_page('rescan')" class="w3-bar-item w3-button w3-hover-white">Rescan</a>
<a href="#" onclick="open_page('admin')" class="w3-bar-item w3-button w3-hover-white">Admin</a>
<a href="#" onclick="open_page('halt')" class="w3-bar-item w3-button w3-hover-white">Shutdown</a>
</div>
<?php echo Template::html('wifi'); ?>
<?php echo Template::html('shares'); ?>
<?php echo Template::html('admin'); ?>
+<?php echo Template::html('rescan'); ?>
<?php echo Template::html('halt'); ?>
<?php echo Template::html('response'); ?>
--- /dev/null
+<!-- Rescan -->
+<div class="w3-container" id="rescan" style="margin-top:75px" style="display:none;">
+ <h1 class="w3-xxxlarge w3-text-blue"><b>Rescan.</b></h1>
+ <hr style="width:50px;border:5px solid blue" class="w3-round">
+ <form>
+ <div class="w3-section">
+ <label>Letzter kompletter Rescan</label>
+ <input class="w3-input w3-border" name="modified" requiblue="" type="text" readonly>
+ </div>
+ <button type="submit" class="w3-button w3-block w3-padding-large w3-blue w3-margin-bottom" onclick="return submit_rescan()">Rescan</button>
+ </form>
+</div>