summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2020-11-18 10:02:37 +0100
committerSimon Rettberg2020-11-18 10:02:37 +0100
commite9b114120322f79ca9029a5120b85934b74eb3a0 (patch)
treed95b11f3d9b1f7e399e51220e60e6c516001154b
parent[statistics] Add shift + click selection to the checkboxes (diff)
downloadslx-admin-e9b114120322f79ca9029a5120b85934b74eb3a0.tar.gz
slx-admin-e9b114120322f79ca9029a5120b85934b74eb3a0.tar.xz
slx-admin-e9b114120322f79ca9029a5120b85934b74eb3a0.zip
[sysconfig] Show '?' for unused modules
Quick and dirty client-side hack; needs refactoring anyways once we have per-location module assignment.
-rw-r--r--modules-available/sysconfig/clientscript.js19
-rw-r--r--modules-available/sysconfig/lang/de/template-tags.json2
-rw-r--r--modules-available/sysconfig/lang/en/template-tags.json2
-rw-r--r--modules-available/sysconfig/templates/list-legend.html4
-rw-r--r--modules-available/sysconfig/templates/list-modules.html5
5 files changed, 23 insertions, 9 deletions
diff --git a/modules-available/sysconfig/clientscript.js b/modules-available/sysconfig/clientscript.js
index a9b85251..9dbb0745 100644
--- a/modules-available/sysconfig/clientscript.js
+++ b/modules-available/sysconfig/clientscript.js
@@ -3,7 +3,7 @@
(function() {
var boldItem = false;
- var revList = false;
+ var modToConf = false;
var $ct = $('#conftable').find('.confrow .title');
$ct.click(function () {
@@ -23,9 +23,8 @@
});
var $confirm = $('#delete-item-list');
$('.btn-del-module').click(function() {
- if (!revList) buildRevList();
var mid = $(this).val() + '';
- var list = revList[mid];
+ var list = modToConf[mid];
if (!list || !list.length) {
$confirm.append($msgs).addClass('hidden');
return;
@@ -42,6 +41,11 @@
$confirm.addClass('hidden');
});
+ buildRevList();
+ var mods = [];
+ $('#modtable .modrow').each(function() { mods.push($(this).data('id')) });
+ mods.forEach(function(e) { if (modToConf[e] === undefined) $('.modrow[data-id=' + e + '] .icon-unused').removeClass('hidden') });
+
function showpre(e, action) {
if (boldItem && action !== 'bold') return 'reset';
if (boldItem) {
@@ -54,14 +58,14 @@
}
function buildRevList() {
- revList = {};
+ modToConf = {};
$ct.each(function () {
var elem = $(this).parent();
var cid = elem.data('id') + '';
var list = (elem.data('modlist') + '').split(',');
for (var i = 0; i < list.length; ++i) {
- if (!revList[list[i]]) revList[list[i]] = [];
- revList[list[i]].push(cid);
+ if (!modToConf[list[i]]) modToConf[list[i]] = [];
+ modToConf[list[i]].push(cid);
}
});
}
@@ -70,9 +74,8 @@
action = showpre(e, action);
if (action === 'reset') return;
var $e = $(e);
- if (!revList) buildRevList();
var mid = $e.parent().data('id') + '';
- var list = revList[mid];
+ var list = modToConf[mid];
if (list && list.length > 0) $ct.each(function () {
var elem = $(this);
var cid = elem.parent().data('id') + '';
diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json
index 9637314e..b8452ed0 100644
--- a/modules-available/sysconfig/lang/de/template-tags.json
+++ b/modules-available/sysconfig/lang/de/template-tags.json
@@ -80,6 +80,8 @@
"lang_moduleConfiguration": "Konfigurationsmodule",
"lang_moduleName": "Modulname",
"lang_moduleTitle": "Titel",
+ "lang_moduleUnused": "Ungenutzt",
+ "lang_moduleUnusedLong": "Dieses Modul ist mit keiner Systemkonfiguration verkn\u00fcpft.",
"lang_mountOptionsNote": "Diese Einstellungen beziehen sich nur auf Linux und \u00e4hnliche Systeme (sowohl das MiniLinux als auch laufende VMs) und beeinflussen die Optionen, die beim Mounten des Verzeichnisses verwendet werden sollen. Sofern es im LDAP\/AD ein Nutzerattribut gibt, welches die passenden Optionen enth\u00e4lt, k\u00f6nnen Sie dieses hier angeben. Das Attribut wird dann vorrangig behandelt. Ist das Attribut leer oder nicht vorhanden, werden die Optionen verwendet, die Sie im Feld \"feste Mount-Optionen\" eingetragen haben. Sind beide Felder leer, werden verschiedene Optionen automatisch durchprobiert.",
"lang_name": "Name",
"lang_newConfiguration": "Neue Konfiguration",
diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json
index 89f6886b..a9da2086 100644
--- a/modules-available/sysconfig/lang/en/template-tags.json
+++ b/modules-available/sysconfig/lang/en/template-tags.json
@@ -80,6 +80,8 @@
"lang_moduleConfiguration": "Module Configuration",
"lang_moduleName": "Module Name",
"lang_moduleTitle": "Title",
+ "lang_moduleUnused": "Unused",
+ "lang_moduleUnusedLong": "This module is not attached to any system configuration.",
"lang_mountOptionsNote": "These settings are relevant for the MiniLinux and VMs containing non-Windows OSes. If you specify an LDAP user attribute, its contents will be used as mount options when mounting the user's home directory. If the attribute is not specified or its contents are empty, the mount attributes specified in the other field will be used. If you leave both fields empty, the clients will try to determine the options automatically.",
"lang_name": "Name",
"lang_newConfiguration": "New Configuration",
diff --git a/modules-available/sysconfig/templates/list-legend.html b/modules-available/sysconfig/templates/list-legend.html
index 809a0449..49974a5f 100644
--- a/modules-available/sysconfig/templates/list-legend.html
+++ b/modules-available/sysconfig/templates/list-legend.html
@@ -25,6 +25,10 @@
<span class="btn btn-danger btn-xs" title="{{lang_delete}}"><span class="glyphicon glyphicon-trash"></span></span>
{{lang_deleteLong}}
</p>
+ <p>
+ <span class="glyphicon glyphicon-question-sign" title="{{lang_moduleUnused}}"></span>
+ {{lang_moduleUnusedLong}}
+ </p>
{{#showLocationBadge}}
<p>
<span class="badge">+4</span>
diff --git a/modules-available/sysconfig/templates/list-modules.html b/modules-available/sysconfig/templates/list-modules.html
index 9284bb24..5bd19446 100644
--- a/modules-available/sysconfig/templates/list-modules.html
+++ b/modules-available/sysconfig/templates/list-modules.html
@@ -13,7 +13,10 @@
<tr data-id="{{id}}" class="modrow">
<td class="badge text-nowrap">{{moduleType}}</td>
<td class="title slx-pointer" width="100%" title="{{lang_lastEdited}} {{dateline_s}}">
- <table class="slx-ellipsis"><tr><td>{{title}}</td></tr></table>
+ <table class="slx-ellipsis"><tr><td>
+ <span class="glyphicon glyphicon-question-sign pull-right icon-unused hidden" title="{{lang_moduleUnused}}"></span>
+ {{title}}
+ </td></tr></table>
</td>
<td class="text-nowrap">
{{#allowDownload}}