summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorSimon Rettberg2015-02-04 17:58:01 +0100
committerSimon Rettberg2015-02-04 17:58:01 +0100
commit43bc68c732338be2e82c5c516f20704e12d82a7c (patch)
tree3cd7b72884b70906e2898bcff643720d88d4cbac /templates
parentConfig.tgz improvements, automatic rebuilds etc. (diff)
downloadslx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.tar.gz
slx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.tar.xz
slx-admin-43bc68c732338be2e82c5c516f20704e12d82a7c.zip
Finish config module editing
Diffstat (limited to 'templates')
-rw-r--r--templates/sysconfig/_page.html34
-rw-r--r--templates/sysconfig/custom-fileselect.html3
-rw-r--r--templates/sysconfig/custom-upload.html1
3 files changed, 33 insertions, 5 deletions
diff --git a/templates/sysconfig/_page.html b/templates/sysconfig/_page.html
index 93169e6a..2f46f2cf 100644
--- a/templates/sysconfig/_page.html
+++ b/templates/sysconfig/_page.html
@@ -30,10 +30,10 @@
<td class="slx-nowrap">
<button
{{#needrebuild}}
- class="btn btn-primary btn-xs"
+ class="refconf btn btn-primary btn-xs"
{{/needrebuild}}
{{^needrebuild}}
- class="btn btn-default btn-xs"
+ class="refconf btn btn-default btn-xs"
{{/needrebuild}}
name="rebuild" value="{{configid}}" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></button>
</td>
@@ -88,10 +88,10 @@
<td class="slx-nowrap">
<button
{{#needrebuild}}
- class="btn btn-primary btn-xs"
+ class="refmod btn btn-primary btn-xs"
{{/needrebuild}}
{{^needrebuild}}
- class="btn btn-default btn-xs"
+ class="refmod btn btn-default btn-xs"
{{/needrebuild}}
name="rebuild" value="{{moduleid}}" title="{{lang_rebuild}}"><span class="glyphicon glyphicon-refresh"></span></button>
<a class="btn btn-success btn-xs" href="?do=SysConfig&amp;action=addmodule&amp;step={{moduletype}}_Start&amp;edit={{moduleid}}" title="{{lang_edit}}"><span class="glyphicon glyphicon-edit"></span></a>
@@ -187,4 +187,30 @@
$(e).addClass("slx-bold");
}
}
+
+ var statusChecks = 0;
+ function checkBuildStatus() {
+ var mods = [];
+ var confs = [];
+ $(".refmod.btn-primary").each(function (index) {
+ mods.push($(this).val());
+ });
+ $(".refconf.btn-primary").each(function (index) {
+ confs.push($(this).val());
+ });
+ if (mods.length === 0 && confs.length === 0) return;
+ if (++statusChecks < 10) setTimeout(checkBuildStatus, 200 + 50 * statusChecks);
+ console.log("POSTING");
+ $.post('?do=SysConfig', { mods: mods.join(), confs: confs.join(), token: TOKEN, action: 'status' }, function (data) {
+ if (typeof data === 'undefined') return;
+ if (typeof data.mods === 'object') updateButtonColor($(".refmod.btn-primary"), data.mods);
+ if (typeof data.confs === 'object') updateButtonColor($(".refconf.btn-primary"), data.confs);
+ }, 'json');
+ }
+ function updateButtonColor(list,ids) {
+ list.each(function() {
+ if (ids.indexOf($(this).val()) >= 0) $(this).removeClass('btn-primary').addClass('btn-default');
+ });
+ }
+ setTimeout(checkBuildStatus, 300);
// --></script> \ No newline at end of file
diff --git a/templates/sysconfig/custom-fileselect.html b/templates/sysconfig/custom-fileselect.html
index 0c2d88e9..000c8d10 100644
--- a/templates/sysconfig/custom-fileselect.html
+++ b/templates/sysconfig/custom-fileselect.html
@@ -1,9 +1,10 @@
<form role="form" method="post" action="?do=SysConfig&amp;action=addmodule&amp;step={{step}}">
<input type="hidden" name="modid" value="{{modid}}">
<input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="edit" value="{{edit}}">
<div class="input-group">
<span class="input-group-addon">{{lang_moduleName}}</span>
- <input type="text" name="title" class="form-control" placeholder="Mein Konfigurationsmodul" autofocus="autofocus">
+ <input type="text" name="title" value="{{title}}" class="form-control" placeholder="Mein Konfigurationsmodul" autofocus="autofocus">
</div>
<div class="pull-right">
<button type="submit" class="btn btn-primary">{{lang_next}} &raquo;</button>
diff --git a/templates/sysconfig/custom-upload.html b/templates/sysconfig/custom-upload.html
index 9ab71eaa..02f813f6 100644
--- a/templates/sysconfig/custom-upload.html
+++ b/templates/sysconfig/custom-upload.html
@@ -4,6 +4,7 @@
<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&amp;action=addmodule&amp;step={{step}}">
<input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="edit" value="{{edit}}">
<div class="input-group">
<span class="input-group-addon">{{lang_file}}</span>
<input class="form-control" type="file" name="modulefile">