From ea7e5a3d15eac8baed1fe1c2c207118cc6350364 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 21 Mar 2017 03:38:38 +0100 Subject: Admin-panel: Redesigned config. Added helpboxes. --- .../locationinfo/lang/de/template-tags.json | 50 ++- .../locationinfo/lang/en/template-tags.json | 49 ++- modules-available/locationinfo/page.inc.php | 4 + .../locationinfo/templates/config.html | 472 ++++++++++++++++----- .../locationinfo/templates/location-info.html | 8 +- .../locationinfo/templates/server-settings.html | 83 ++-- 6 files changed, 484 insertions(+), 182 deletions(-) (limited to 'modules-available') diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json index 75a945ce..973509da 100644 --- a/modules-available/locationinfo/lang/de/template-tags.json +++ b/modules-available/locationinfo/lang/de/template-tags.json @@ -4,7 +4,7 @@ "lang_locationID": "ID", "lang_locationIsHidden": "Versteckt", "lang_locationIsHidden_title": "Wenn aktiv, dann liefert die API keine Informationen über diesen Raum.", - "lang_locationInUse": "In Benutzung / Gesamt", + "lang_locationInUse": "Rechner", "lang_locationSettings": "Einstellungen", "lang_locationConfig": "Config", "lang_pcID": "ID", @@ -28,37 +28,47 @@ "lang_sunday": "Sonntag", "lang_expertMode": "Experten Modus", "lang_expertMode_title": "Ermöglicht es dir Öffnungzeiten für jeden Tag zu Setzen.", + "lang_nameTooltip": "Legt den Namen des Servers fest.", + "lang_urlTooltip": "Server URL über den das backend versucht Kalender-daten zu holen.", + "lang_typeTooltip": "Legt fest um welchen Typ von Server es sich handelt.", "lang_language": "Sprache", - "lang_languageEn": "en", - "lang_languageDe": "de", - "lang_languagePt": "pt", + "lang_languageEn": "Englisch", + "lang_languageDe": "Deutsch", + "lang_languagePt": "Portugiesisch", + "lang_languageTooltip": "Die Sprache, welche vom Frontend benutzt wird.", "lang_mode": "Modus", "lang_mode1": "Kalender & Raum", "lang_mode2": "Kalender", "lang_mode3": "Raum", "lang_mode4": "Wechselnd", - "lang_ecoMode": "Eco modus (e-ink)", - "lang_daysToShow": "Tage im Kalender", - "lang_daysToShowTooltip": "[1-7] Zeigt die gewünschte Anzahl an Tagen im Kalender an.", - "lang_scale": "Skalierung", - "lang_scaleTooltip": "[10-90] Skaliert die Kalender breite in modus 1", + "lang_modeTooltip": "Die Anzeigemodi, welche das frontend unterstützt.", + "lang_ecoMode": "E-Ink modus", + "lang_ecoTooltip": "Anstelle der Farb-basierten PC-Status Bilder, werden Symbol-basierte PC Bilder verwendet.", + "lang_daysToShow": "Tage", + "lang_daysToShowTooltip": "Legt die gewünschte Anzahl an Tagen im Kalender fest.", + "lang_scale": "Kalender breite", + "lang_scaleTooltip": "[10-90] Legt die Kalenderbreite fest. (In Prozent)", "lang_switchTime": "Wechsel Zeit", - "lang_switchTimeTooltip": "[1-120] Die Zeit die vergeht bis ein wechsel erfolgt in modus 4 (in sekunden)", + "lang_switchTimeTooltip": "[1-120] Legt die Zeit fest, die vergeht bis ein wechsel erfolgt (in sekunden)", "lang_rotation": "Rotation", "lang_rotation0": "0°", "lang_rotation1": "90° ⟲", "lang_rotation2": "180°", "lang_rotation3": "90° ⟳", - "lang_vertical": "Vertikal", - "lang_calupdate": "Kalenderabfragrate", - "lang_calupdateTooltip": "Zeit nachdem der Kalender geupdated wird (in minutes)", - "lang_roomupdate": "Raumabfragrate", + "lang_rotationTooltip": "Rotiert den Raum.", + "lang_vertical": "Vertikaler Modus", + "lang_verticalTooltip": "Legt fest, ob der Kalender und der Raum übereinander angezeigt werden soll.", + "lang_updateRates": "Anfragraten", + "lang_calendar": "Kalender", + "lang_calupdateTooltip": "Zeit nachdem der Kalender geupdated wird (in minuten)", + "lang_room": "Raum", "lang_roomupdateTooltip": "Zeit nachder die Pcs geupdated werden (in sekunden)", - "lang_configupdate": "Einstellungsabfragrate", + "lang_config": "Einstellungen", "lang_configupdateTooltip": "Zeit nachder die Einstellungen geupdated werden (in minuten)", "lang_min": "min", "lang_sec": "sec", - "lang_autoScale": "Auto skalierung", + "lang_autoScale": "Auto Tage", + "lang_autoscaleTooltip": "Berechnet sich die optimale anzahl an Tagen, anhand der Bildschirmbreite, die der Kalender anzeigt.", "lang_deleteConfirmation": "Bist du sicher?", "lang_addServer": "Server", "lang_addServer_title": "Server hinzufügen", @@ -71,10 +81,14 @@ "lang_serverID": "Server ID", "lang_sID": "sID", "lang_server": "Server", - "lang_serverRoomId": "Server: Raum ID", + "lang_serverTooltip": "Legt fest, von welchem Server die Kalender Daten bezogen werden.", + "lang_roomId": "Raum ID", + "lang_roomIdTooltip": "Die ID vom Raum, welche der Server braucht, um die Kalender Daten abzurufen.", "lang_credentials": "Anmeldung", "lang_refresh_title": "Überprüft ob die Serververbindung gültig ist.", "lang_delete": "Löschen", "lang_refresh": "Aktualisieren", - "lang_general": "Allgemein" + "lang_general": "Allgemein", + "lang_server": "Server", + "lang_display": "Anzeige" } diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json index ec0bae12..b7de3131 100644 --- a/modules-available/locationinfo/lang/en/template-tags.json +++ b/modules-available/locationinfo/lang/en/template-tags.json @@ -5,7 +5,7 @@ "lang_locationID": "ID", "lang_locationIsHidden": "Hidden", "lang_locationIsHidden_title": "If checked the API doesn't return information about the room.", - "lang_locationInUse": "In use / total", + "lang_locationInUse": "Clients", "lang_locationSettings": "Settings", "lang_locationConfig": "Config", @@ -33,37 +33,47 @@ "lang_expertMode": "Expert mode", "lang_expertMode_title": "Allows you to set openingtimes for every day.", + "lang_nameTooltip": "Defines the name of the server.", + "lang_urlTooltip": "Server URL on which the backend trys to get the calendar data from.", + "lang_typeTooltip": "Defines on which type of server you want to connect to.", "lang_language": "Language", - "lang_languageEn": "en", - "lang_languageDe": "de", - "lang_languagePt": "pt", + "lang_languageEn": "English", + "lang_languageDe": "German", + "lang_languagePt": "Portugues", + "lang_languageTooltip": "The language the frontend uses.", "lang_mode": "Mode", "lang_mode1": "Calendar & Room", "lang_mode2": "Calendar", "lang_mode3": "Room", "lang_mode4": "Switching", - "lang_ecoMode": "Eco mode (e-ink)", - "lang_daysToShow": "Days to show", - "lang_daysToShowTooltip": "[1-7] Sets how many days the calendar shows", - "lang_scale": "Scale", - "lang_scaleTooltip": "[10-90] scales the calendar width in mode 1", + "lang_modeTooltip": "The display modes the frontend supports.", + "lang_ecoMode": "E-Ink mode", + "lang_ecoTooltip": "Symbolic based pc state pictures are used instead of the colour base ones.", + "lang_daysToShow": "Days", + "lang_daysToShowTooltip": "Defines the amount of days to show in the calendar", + "lang_scale": "Calendar width", + "lang_scaleTooltip": "[10-90] Defines the calendar width. (in percent)", "lang_switchTime": "Switchtime", - "lang_switchTimeTooltip": "[1-120] Sets the time between switching in mode 4 (in seconds)", + "lang_switchTimeTooltip": "[1-120] Sets the time between switching (in seconds)", "lang_rotation": "Rotation", "lang_rotation0": "0°", "lang_rotation1": "90° ⟲", "lang_rotation2": "180°", "lang_rotation3": "90° ⟳", - "lang_vertical": "Vertical", - "lang_calupdate": "Calendar update rate", + "lang_rotationTooltip": "Rotates the room.", + "lang_vertical": "Vertical mode", + "lang_verticalTooltip": "Defines whether the room and calendar are shown above each other.", + "lang_updateRates": "Update rates", + "lang_calendar": "Calendar", "lang_calupdateTooltip": "Time the calender querys for updates (in minutes)", - "lang_roomupdate": "Room update rate", + "lang_room": "Room", "lang_roomupdateTooltip": "Time the PCs in the room gets updated (in seconds)", - "lang_configupdate": "Config update", + "lang_config": "Config", "lang_configupdateTooltip": "Time interval the config gets updated (in minutes)", "lang_min": "min", "lang_sec": "sec", - "lang_autoScale": "Auto scale", + "lang_autoScale": "Auto Days", + "lang_autoscaleTooltip": "Calculates the optimum amount of days to show from the display width.", "lang_deleteConfirmation": "Are you sure?", "lang_addServer": "Server", "lang_addServer_title": "Add server", @@ -76,10 +86,15 @@ "lang_serverID": "Server ID", "lang_sID": "sID", "lang_server": "Server", - "lang_serverRoomId": "Server: Room ID", + "lang_serverTooltip": "Defines from which server the room queries the calendar data.", + "lang_roomId": "Room ID", + "lang_roomIdTooltip": "The ID of the room the server needs, for querying the calendar data.", "lang_credentials": "Login", "lang_refresh_title": "Checks if the server connection is valid.", "lang_delete": "Delete", "lang_refresh": "Refresh", - "lang_general": "General" + "lang_general": "General", + + "lang_server": "Server", + "lang_display": "Display" } diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php index ec024f48..9b6df0b6 100644 --- a/modules-available/locationinfo/page.inc.php +++ b/modules-available/locationinfo/page.inc.php @@ -101,6 +101,10 @@ class Page_LocationInfo extends Page $serverid = Request::post('serverid', 0, 'int'); $serverroomid = Request::post('serverroomid','', 'string'); + error_log("eco: " . $result['eco']); + error_log("vertical: " . $result['vertical']); + error_log("scaledaysauto: " . $result['scaledaysauto']); + Database::exec("INSERT INTO `location_info` (locationid, serverid, serverroomid, config) VALUES (:id, :serverid, :serverroomid, :config) ON DUPLICATE KEY UPDATE config=:config, serverid=:serverid, serverroomid=:serverroomid", array('id' => $locationid, 'config' => json_encode($result, true), 'serverid' => $serverid, 'serverroomid' => $serverroomid)); diff --git a/modules-available/locationinfo/templates/config.html b/modules-available/locationinfo/templates/config.html index 3168c6a2..1b42ff34 100644 --- a/modules-available/locationinfo/templates/config.html +++ b/modules-available/locationinfo/templates/config.html @@ -4,105 +4,269 @@ - -
-
- -
- -
-
- -
- - -



- -
-
- -
-
-
- -
-
- {{lang_vertical}}
- {{lang_ecoMode}}
- {{lang_autoScale}} -
- -
-
- -
- -
-
- -
- -



- -
- 50 % - -

- -
- 20 {{lang_sec}} - -

- -
-
-
- {{lang_min}} -
-
-
- {{lang_sec}} -
-
-
- {{lang_min}} -
-
- -



+
+
{{lang_server}}
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
{{lang_display}}
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ + +
+
+ +
+
+
+ +
+
+
+ + +
+
{{lang_mode}}
+
+
+ +
+
+
+ +
+
+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ 50 % + +
+
+ +
+
+
+ +
+
+
+ +
+
+ 20 {{lang_sec}} + +
+
+ +
+
+
+ +
+
+
+ +
+
{{lang_updateRates}}
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+
+
@@ -110,8 +274,30 @@ diff --git a/modules-available/locationinfo/templates/location-info.html b/modules-available/locationinfo/templates/location-info.html index d494ebdc..86d30260 100644 --- a/modules-available/locationinfo/templates/location-info.html +++ b/modules-available/locationinfo/templates/location-info.html @@ -95,11 +95,11 @@ } cb.addEventListener("click", function() { cbClick(this, {{locationid}}); }); - {{lang_openingTime}} + - {{lang_locationSettings}} + diff --git a/modules-available/locationinfo/templates/server-settings.html b/modules-available/locationinfo/templates/server-settings.html index b42f4c15..f885c0c1 100644 --- a/modules-available/locationinfo/templates/server-settings.html +++ b/modules-available/locationinfo/templates/server-settings.html @@ -15,9 +15,12 @@
-
+
+
+ +
@@ -26,9 +29,12 @@
-
+
+
+ +
@@ -37,14 +43,15 @@
-
- - {{#backendList}} -
+
+
@@ -71,8 +78,17 @@ if (type == "") { type = $('#input-type-{{id}}').val(); } + loadCredentials(); - function loadCredentials() { + initalizeBootstrap(); + + function initalizeBootstrap() { + $('#help-name').tooltip(); + $('#help-url').tooltip(); + $('#help-type').tooltip(); + } + + function loadCredentials(useValue = true) { // {{name}} name of auth {{type}} type of auth (string, int etc.) {{value}} value from the db {{#backendList}} if (type == "{{typ}}") { @@ -81,33 +97,44 @@ if ("{{type}}" == "string") { $("#credentials-list").append('
\ -
\ -
\ - \ -
'); +
\ +
\ +
\ +
\ + '); } else if ("{{type}}" == "int") { $("#credentials-list").append('
\ -
\ -
\ - \ -
'); +
\ +
\ +
\ +
\ + '); } else if ("{{type}}" == "bool") { $("#credentials-list").append('
\ -
\ -
\ - \ -
'); - $('#bs-{{uid}}').bootstrapSwitch(); +
\ +
\ +
\ +
\ + '); + $('#bs-{{uid}}').bootstrapSwitch({ + size: "small" + }); } else if ("{{type}}" == "array") { $("#credentials-list").append('
\ -
\ -
\ - \ {{#array}}\ \ {{/array}}\ - \ -
'); + \ +
\ + '); + } + + $('#help-{{uid}}').tooltip(); + if (!useValue) { + $('#input-{{uid}}').val(""); } {{/credentials}} {{^credentials}} @@ -122,7 +149,7 @@ type = value; $('#credentials-div').fadeOut('fast', function() { $('#credentials-list').empty(); - loadCredentials(); + loadCredentials(false); }); } -- cgit v1.2.3-55-g7522