summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/templates/page-servers.html
diff options
context:
space:
mode:
authorSimon Rettberg2017-06-10 16:15:22 +0200
committerSimon Rettberg2017-06-10 16:15:22 +0200
commita0b42aa257d0a6c56cd4a099aa0a2cea4a8dc2c9 (patch)
tree3e1655c828e0cb6f069b8c17ddf260237e0f4ce2 /modules-available/locationinfo/templates/page-servers.html
parent[inc/Util] Add randomUuid() function (diff)
downloadslx-admin-a0b42aa257d0a6c56cd4a099aa0a2cea4a8dc2c9.tar.gz
slx-admin-a0b42aa257d0a6c56cd4a099aa0a2cea4a8dc2c9.tar.xz
slx-admin-a0b42aa257d0a6c56cd4a099aa0a2cea4a8dc2c9.zip
[locationinfo] Started rewrite for panel-based approach
Diffstat (limited to 'modules-available/locationinfo/templates/page-servers.html')
-rw-r--r--modules-available/locationinfo/templates/page-servers.html113
1 files changed, 113 insertions, 0 deletions
diff --git a/modules-available/locationinfo/templates/page-servers.html b/modules-available/locationinfo/templates/page-servers.html
new file mode 100644
index 00000000..2dfe63e1
--- /dev/null
+++ b/modules-available/locationinfo/templates/page-servers.html
@@ -0,0 +1,113 @@
+<div>
+ <h1>{{lang_mainHeader}}</h1>
+
+ <h4>{{lang_serverTable}}</h4>
+
+ <table class="table table-hover">
+ <tr>
+ <th width="1">{{lang_serverType}}</th>
+ <th>{{lang_locationName}}</th>
+ <th width="1"></th>
+ <th width="1"></th>
+ </tr>
+ {{#serverlist}}
+ <form method="post" action="?do=locationinfo">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="serverid" value="{{serverid}}">
+ <tr>
+ <td nowrap>{{typename}}</td>
+ <td nowrap>{{servername}}</td>
+
+ <td align="center" nowrap>
+ <button class="btn btn-sm {{^autherror}}btn-success{{/autherror}}{{#autherror}}btn-danger{{/autherror}}"
+ data-server-edit="{{serverid}}" {{disabled}} type="button">
+ <span style="margin-right: 5px;" class="glyphicon glyphicon-cog"></span>
+ {{lang_locationSettings}}
+ </button>
+ <button class="btn btn-sm btn-primary server-check" {{disabled}} name="action" value="checkConnection"
+ type="submit">
+ <span style="margin-right: 5px;" class="glyphicon glyphicon-refresh"></span>
+ {{lang_checkConnection}}
+ </button>
+ </td>
+ <td align="center" nowrap>
+ <button class="btn btn-sm btn-danger server-delete" type="submit" name="action" value="deleteServer">
+ <span style="margin-right: 5px;" class="glyphicon glyphicon-remove"></span>
+ {{lang_delete}}
+ </button>
+ </td>
+ </tr>
+ </form>
+ {{/serverlist}}
+ </table>
+
+ <div>
+ <button class="btn btn-sm btn-success" id="addServerButton" onclick="addServer()">
+ <span style="margin-right: 5px;" class="glyphicon glyphicon-plus"></span>
+ {{lang_addServer}}
+ </button>
+ </div>
+
+ <div class="modal fade" id="myModal" tabindex="-1" role="dialog">
+ <div class="modal-dialog">
+
+ <div class="modal-content">
+ <div class="modal-header" id="myModalHeader"></div>
+ <div class="modal-body" id="myModalBody"></div>
+ <div class="modal-footer">
+ <button type="submit" id="myModalSubmitButton" class="btn btn-primary" form="">{{lang_save}}</button>
+
+ <a class="btn btn-primary" data-dismiss="modal">{{lang_close}}</a>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</div>
+<script type="text/javascript"><!--
+
+ document.addEventListener("DOMContentLoaded", function () {
+
+ /**
+ * Confirm deleting a server.
+ */
+ $('.server-delete').click(function(ev) {
+ var del = confirm("{{lang_deleteConfirmation}}");
+ if (!del) ev.preventDefault();
+ });
+
+ /**
+ * Animate refresh icon while page is loading
+ */
+ $('.server-check').click(function() {
+ $(this).find('.glyphicon').addClass('slx-rotation');
+ });
+
+ $('button[data-server-edit]').click(function() {
+ var id = $(this).data('server-edit');
+ loadServerSettingsModal(id);
+ });
+
+ });
+
+ /**
+ * Loads the settings modal of a server.
+ *
+ * @param serverid The id of the server.
+ */
+ function loadServerSettingsModal(serverid) {
+ $('#myModalHeader').text("{{lang_locationSettings}}").css("font-weight", "Bold");
+ $('#myModal .modal-dialog').css('width', '');
+ $('#myModal').modal('show');
+ $('#myModalBody').load("?do=locationinfo&action=serverSettings&id=" + serverid);
+ }
+
+ // ########### Server Table ###########
+
+ /**
+ * Loads a new / empty server settings modal.
+ */
+ function addServer() {
+ loadServerSettingsModal(0);
+ }
+//--></script>