From 101b12d912d241ef533080f980e61a6fb964141a Mon Sep 17 00:00:00 2001
From: Steffen Ritter
Date: Fri, 19 Jul 2019 11:52:33 +0200
Subject: [roomplanner] Make client tooltip more readable
---
modules-available/roomplanner/clientscript.js | 4 ++--
modules-available/roomplanner/js/grid.js | 12 +++++++++--
modules-available/roomplanner/js/init.js | 18 ++++++++--------
modules-available/roomplanner/style.css | 30 +++++++++++++++++++++++++++
4 files changed, 51 insertions(+), 13 deletions(-)
diff --git a/modules-available/roomplanner/clientscript.js b/modules-available/roomplanner/clientscript.js
index 823c212a..826935a3 100644
--- a/modules-available/roomplanner/clientscript.js
+++ b/modules-available/roomplanner/clientscript.js
@@ -48,9 +48,9 @@ function renderMachineEntry(item, escape) {
+ '
'
+ ' '
+ '
'
- + 'UUID: | ' + escape(item.machineuuid) + ' |
'
- + 'MAC: | ' + escape(item.macaddr) + ' |
'
+ 'IP: | ' + escape(item.clientip) + ' |
'
+ + 'MAC: | ' + escape(item.macaddr) + ' |
'
+ + 'UUID: | ' + escape(item.machineuuid) + ' |
'
+ '
'
+ '
'
+ '';
diff --git a/modules-available/roomplanner/js/grid.js b/modules-available/roomplanner/js/grid.js
index 697d7c3f..80789963 100644
--- a/modules-available/roomplanner/js/grid.js
+++ b/modules-available/roomplanner/js/grid.js
@@ -125,10 +125,18 @@ if (!roomplanner) var roomplanner = {
},
initTooltip: function(el) {
if ($(el).attr('itemtype') === 'pc') {
- var tip = "Rechnerdaten
";
+ var tip = '';
$(roomplanner.computerAttributes).each(function(i,key){
- tip += __(key)+": "+$(el).attr(key)+"
";
+ if (key === 'hostname') {
+ tip += '
' + $(el).attr(key) + '
';
+ return;
+ }
+ tip += '
';
+ tip += '
' + __(key) + ": " + '
';
+ tip += '
' + $(el).attr(key) + '
';
+ tip += '
';
});
+ tip += '
';
$(el).attr('title', tip).attr('data-toggle', 'tooltip');
$(el).tooltip({html: true, container: 'body'});
diff --git a/modules-available/roomplanner/js/init.js b/modules-available/roomplanner/js/init.js
index 7cada0dd..79f8e17e 100644
--- a/modules-available/roomplanner/js/init.js
+++ b/modules-available/roomplanner/js/init.js
@@ -6,10 +6,10 @@ function initRoomplanner() {
$('#drawarea').css('left',(-roomplanner.settings.scale*10)+'px');
roomplanner.computerAttributes = [
- "muuid",
- "mac_address",
- "ip",
- "hostname"
+ "hostname",
+ "ip",
+ "mac_address",
+ "muuid"
];
$("#loadButton").click(function() {
@@ -66,11 +66,11 @@ function initRoomplanner() {
}
var translation = {
- "muuid" : "Machine UUID",
- "mac_address" : "MAC Adresse",
- "ip" : "IP Adresse",
- "hostname": "Rechnername",
-
+ "muuid" : "UUID",
+ "mac_address" : "MAC",
+ "ip" : "IP",
+ "hostname": "Hostname",
+
"wall-horizontal" : "Wand (horizontal)",
"wall-vertical" : "Mauer (vertikal)",
"window-horizontal" : "Fenster",
diff --git a/modules-available/roomplanner/style.css b/modules-available/roomplanner/style.css
index f1dd994a..5e8bc25c 100644
--- a/modules-available/roomplanner/style.css
+++ b/modules-available/roomplanner/style.css
@@ -769,3 +769,33 @@ div.ui-draggable:hover > .pcHandle {
max-height : 600px;
}
+.tooltip > .tooltip-inner {
+ color: #FFFFFF;
+ text-align: left;
+ max-width: 500px;
+}
+
+div.table {
+ display: table;
+ border-collapse:collapse;
+ text-align: left;
+ margin-bottom: 10px;
+}
+
+div.tr {
+ display:table-row;
+ border-top: 1px solid #bbb;
+ border-bottom: 1px solid #bbb;
+}
+
+div.td {
+ display:table-cell;
+ padding: 2px;
+}
+
+div.tc {
+ display:table-caption;
+ font-weight: bold;
+ font-size: 16px;
+ padding-bottom: 5px;
+}
--
cgit v1.2.3-55-g7522