diff options
author | Simon Rettberg | 2013-11-16 16:32:43 +0100 |
---|---|---|
committer | Simon Rettberg | 2013-11-16 16:32:43 +0100 |
commit | 8102576e930a839540c0e8b2c9e18fdf37d30b24 (patch) | |
tree | 60248ead9b0221c38232ae1928f87595ae04cbf8 | |
parent | Fixed two stupid messups (diff) | |
download | slx-admin-8102576e930a839540c0e8b2c9e18fdf37d30b24.tar.gz slx-admin-8102576e930a839540c0e8b2c9e18fdf37d30b24.tar.xz slx-admin-8102576e930a839540c0e8b2c9e18fdf37d30b24.zip |
Notify about missing options/files/actions on dashboard
-rw-r--r-- | DB_SCRIBBLE | 1 | ||||
-rw-r--r-- | apis/exec.inc.php | 2 | ||||
-rw-r--r-- | modules/main.inc.php | 4 | ||||
-rw-r--r-- | modules/sysconfig.inc.php | 5 | ||||
-rw-r--r-- | templates/main-menu.html | 2 | ||||
-rw-r--r-- | templates/page-baseconfig.html | 2 | ||||
-rw-r--r-- | templates/page-main.html | 14 | ||||
-rw-r--r-- | templates/page-remote-tgz-list.html | 5 | ||||
-rw-r--r-- | templates/page-tgz-list.html | 14 |
9 files changed, 43 insertions, 6 deletions
diff --git a/DB_SCRIBBLE b/DB_SCRIBBLE index 34bfdb00..4f26bf52 100644 --- a/DB_SCRIBBLE +++ b/DB_SCRIBBLE @@ -44,6 +44,7 @@ INSERT INTO `setting` (`setting`, `defaultvalue`, `permissions`, `validator`, `d ('SLX_BIOS_CLOCK', 'off', 2, 'regex:/^(off|local|utc)$/', 'Legt fest, ob und wie die interne Uhr des Rechners im Bezug auf die Systemzeit des /MiniLinux/ gesetzt werden soll.\r\n*off* = Die interne Uhr des Rechners wird nicht verändert.\r\n*local* = Die interne Uhr wird auf die Lokalzeit gesetzt. Bevorzugt wenn z.B. noch eine native Windows-Installation auf dem PC vorhanden ist.\r\n*utc* = Die interne Uhr wird auf die /Koordinierte Weltzeit/ gesetzt. Dies ist die gängige Einstellung in einem reinen Linux-Umfeld.'), ('SLX_NET_DOMAIN', '', 2, '', 'DNS-Domäne, in die sich die Clients eingliedern, sofern der DHCP Server keine solche vorgibt.'), ('SLX_NTP_SERVER', '0.de.pool.ntp.org 1.de.pool.ntp.org', 2, '', 'Adresse des NTP-Zeitservers. Es können mehrere Server mit Leerzeichen getrennt angegeben werden.\r\nDie Server werden der Reihe nach angefragt, bis ein antwortender Server gefunden wird.'), +('SLX_ADDONS', 'vmware', 2, '', 'Zu ladende Addons. Zur Zeit steht nur vmware zur Verfügung.'), ('SLX_PROXY_BLACKLIST', '', 2, '', 'Adressen bzw. Adressbereiche, für die der Proxyserver nicht verwendet werden soll (z.B. der Adressbereich der Einrichtung). Gültige Angaben sind einzelne IP-Adressen, sowie IP-Bereiche in CIDR-Notation (z.B. 1.2.0.0/16). Mehrere Angaben können durch Leerzeichen getrennt werden.'), ('SLX_PROXY_IP', '', 2, '', 'Die Adresse des zu verwendenden Proxy Servers.'), ('SLX_PROXY_MODE', 'off', 2, 'regex:/^(off|on|auto|wpad)$/', 'Legt fest, ob zum Zugriff aufs Internet ein Proxy-Server benötigt wird.\r\n*off* = keinen Proxy benutzen.\r\n*on* = Proxy immer benutzen.\r\n*auto* = Proxy nur benutzen, wenn sich der Client-PC in einem privaten Adressbereich befindet.'), diff --git a/apis/exec.inc.php b/apis/exec.inc.php index 94a94a00..749ca86a 100644 --- a/apis/exec.inc.php +++ b/apis/exec.inc.php @@ -57,6 +57,8 @@ case 'ipxe': 'DEFAULT' => 'openslx' )); if (false === file_put_contents(CONFIG_TFTP_DIR . '/pxelinux.cfg/default', $conf)) die('Error writing PXE Menu'); + Database::exec("INSERT IGNORE INTO setting_global (setting, value) VALUES ('SLX_VM_NFS', :value)", array(':value' => "$ip:/srv/openslx/nfs")); + Database::exec("UPDATE setting_global SET value = :value WHERE setting = 'SLX_VM_NFS' AND value LIKE '%:/srv/openslx/nfs' LIMIT 1", array(':value' => "$ip:/srv/openslx/nfs")); break; default: die('Invalid exec type'); diff --git a/modules/main.inc.php b/modules/main.inc.php index 31aef55e..24f519c6 100644 --- a/modules/main.inc.php +++ b/modules/main.inc.php @@ -20,6 +20,8 @@ function render_module() if (preg_match("#inet $last/\d+.*scope#", $ip)) $ipxe = false; } } - Render::addTemplate('page-main', array('user' => User::getName(), 'ipxe' => $ipxe)); + $sysconfig = !file_exists(CONFIG_HTTP_DIR . '/default/config.tgz'); + $minilinux = !file_exists(CONFIG_HTTP_DIR . '/default/kernel') || !file_exists(CONFIG_HTTP_DIR . '/default/initramfs-stage31') || !file_exists(CONFIG_HTTP_DIR . '/default/stage32.sqfs'); + Render::addTemplate('page-main', array('user' => User::getName(), 'ipxe' => $ipxe, 'sysconfig' => $sysconfig, 'minilinux' => $minilinux)); } diff --git a/modules/sysconfig.inc.php b/modules/sysconfig.inc.php index 1a171a40..063ae65d 100644 --- a/modules/sysconfig.inc.php +++ b/modules/sysconfig.inc.php @@ -76,10 +76,13 @@ function list_configs() Message::addError('no-permission'); return; } + $current = '<none>'; + if (file_exists(CONFIG_HTTP_DIR . '/default/config.tgz')) $current = realpath(CONFIG_HTTP_DIR . '/default/config.tgz'); $files = array(); foreach (glob(CONFIG_TGZ_LIST_DIR . '/*.tgz') as $file) { $files[] = array( - 'file' => basename($file) + 'file' => basename($file), + 'current' => ($current === realpath($file)) ); } Render::addTemplate('page-tgz-list', array('files' => $files, 'token' => Session::get('token'))); diff --git a/templates/main-menu.html b/templates/main-menu.html index 799d92be..6e1ef51d 100644 --- a/templates/main-menu.html +++ b/templates/main-menu.html @@ -19,7 +19,7 @@ <li><a href="?do=minilinux">MiniLinux</a></li> <li><a href="?do=baseconfig">KonfigurationsVariablen</a></li> <li><a href="?do=sysconfig">SystemKonfiguration</a></li> - <li><a href="?do=printconfig">Drucken</a></li> + <li><a href="?do=ipxe">iPXE</a></li> <li class="divider"></li> <li class="dropdown-header">Nav header</li> <li><a href="#">1</a></li> diff --git a/templates/page-baseconfig.html b/templates/page-baseconfig.html index c7e4cd18..308461bb 100644 --- a/templates/page-baseconfig.html +++ b/templates/page-baseconfig.html @@ -9,7 +9,7 @@ <textarea name="setting[{{setting}}]" class="form-control" cols="30" rows="3">{{value}}</textarea> {{/big}} {{^big}} - <input type="text" name="setting[{{setting}}]" class="form-control" size="30" value="{{value}}"> + <input type="text" name="setting[{{setting}}]" class="form-control" size="30" value="{{value}}" placeholder="{{defaultvalue}}"> {{/big}} </div> <div class="col-md-6"> diff --git a/templates/page-main.html b/templates/page-main.html index 25f6cea6..6d35b9f3 100644 --- a/templates/page-main.html +++ b/templates/page-main.html @@ -1,11 +1,23 @@ <div class="jumbotron"> <h1>Willkommen, {{user}}</h1> - <p>Dies ist die bwLehrpool Konfigurationsoberfläche, {{user}}</p> + <p>Dies ist die bwLehrpool Konfigurationsoberfläche.</p> {{#ipxe}} <div class="alert alert-warning"> <p>Das iPXE-Modul des Servers ist veraltet oder nicht vorhanden.</p> <a class="btn btn-large btn-primary" href="?do=ipxe">iPXE compilieren</a> </div> {{/ipxe}} + {{#minilinux}} + <div class="alert alert-warning"> + <p>Wichtige Dateien der MiniLinux-Installation fehlen.</p> + <a class="btn btn-large btn-primary" href="?do=minilinux">MiniLinux herunterladen</a> + </div> + {{/minilinux}} + {{#sysconfig}} + <div class="alert alert-warning"> + <p>Es wurde noch keine Systemkonfiguration ausgewählt..</p> + <a class="btn btn-large btn-primary" href="?do=sysconfig">Systemkonfiguration festlegen</a> + </div> + {{/sysconfig}} </div> diff --git a/templates/page-remote-tgz-list.html b/templates/page-remote-tgz-list.html index 7cf08dfd..ef4435db 100644 --- a/templates/page-remote-tgz-list.html +++ b/templates/page-remote-tgz-list.html @@ -1,3 +1,8 @@ +<ol class="breadcrumb"> + <li><a href="?do=main">Start</a></li> + <li><a href="?do=sysconfig">SystemKonfiguration</a></li> + <li class="active">Zentral verfügbare Konfigurationen</li> +</ol> <div class="container"> {{#files}} <div class="panel panel-default"> diff --git a/templates/page-tgz-list.html b/templates/page-tgz-list.html index ac70d510..bcf5ffc0 100644 --- a/templates/page-tgz-list.html +++ b/templates/page-tgz-list.html @@ -1,6 +1,18 @@ +<ol class="breadcrumb"> + <li><a href="?do=main">Start</a></li> + <li class="active">SystemKonfiguration</li> +</ol> <div class="container"> {{#files}} - <div class="row well well-sm">{{file}} <a class="btn btn-primary" href="?do=sysconfig&action=activate&file={{file}}&token={{token}}">Aktivieren</a></div> + <div class="row well well-sm"> + {{file}} + {{^current}} + <a class="btn btn-primary" href="?do=sysconfig&action=activate&file={{file}}&token={{token}}">Aktivieren</a> + {{/current}} + {{#current}} + <span class="btn btn-success">Bereits aktiv</span> + {{/current}} + </div> {{/files}} {{^files}} <div class="row well well-sm">Keine Konfigurationspakete gefunden!</div> |