summaryrefslogblamecommitdiffstats
path: root/modules-available/locationinfo/templates/page-servers.html
blob: e295c4fd34dfe558218e5e7c890641c6ff070a4c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                             
 
                                
 






                                                                                  
                                                                          





                                                                         






                                                                                  
                                                                                                                                










                                                                                                                                                   




                                                                                                                                                

                                                                                                                                          



                                                                                               
                       
                               

                
 


                                                                        

















                                                                                                                                                                                                
 
                        




                                                                                          
 

                                                                 



                                                                           
                                                                                                  
                                                                                                                                     
                              


                      
 














































                                                                                                 
<h2>{{lang_serverTable}}</h2>

<p>{{lang_serverTableHints}}</p>

<table class="table table-hover">
	<thead>
	<tr>
		<th class="text-center slx-smallcol">{{lang_serverType}}</th>
		<th>{{lang_locationName}}</th>
		<th class="text-center slx-smallcol">{{lang_edit}}</th>
		<th class="text-center slx-smallcol">{{lang_checkConnection}}</th>
		<th class="text-center slx-smallcol">{{lang_showLog}}</th>
		<th class="text-center slx-smallcol">{{lang_delete}}</th>
	</tr>
	</thead>
	<tbody>
	{{#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 class="text-center">
					<button class="btn btn-xs {{^error}}btn-default{{/error}}{{#error}}btn-danger{{/error}}"
							data-server-edit="{{serverid}}" {{disabled}} {{perms.backend.edit.disabled}} type="button">
						<span class="glyphicon glyphicon-cog"></span>
					</button>
				</td>
				<td class="text-center">
					<button class="btn btn-xs btn-primary server-check" {{disabled}} {{perms.backend.check.disabled}}
							name="action" value="checkConnection" type="submit">
						<span class="glyphicon glyphicon-refresh"></span>
					</button>
				</td>
				<td class="text-center">
					<a href="?do=locationinfo&amp;show=backendlog&amp;serverid={{serverid}}" class="btn btn-xs btn-default">
						<span class="glyphicon glyphicon-list-alt"></span>
					</a>
				</td>
				<td class="text-center">
					<button type="button" class="btn btn-xs btn-danger" onclick="$('#del-serverid').val({{serverid}})"
							  data-toggle="modal" data-target="#deleteModal" {{perms.backend.edit.disabled}}>
						<span class="glyphicon glyphicon-trash"></span>
					</button>
				</td>
			</tr>
		</form>
		{{/serverlist}}
	</tbody>
</table>

<form method="post" action="?do=locationinfo">
	<input type="hidden" name="token" value="{{token}}">
	<input type="hidden" name="serverid" value="" id="del-serverid">
	<div class ="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title" id="myModalLabel">{{lang_delete}}</h4>
				</div>
				<div class="modal-body">
					<p>{{lang_deleteConfirmation}}</p>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button>
					<button type="submit" name="action" value="deleteServer" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span> {{lang_delete}}</button>
				</div>
			</div>
		</div>
	</div>
</form>

<div class="text-right">
	<button class="btn btn-sm btn-success" id="addServerButton" onclick="addServer()">
		<span 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">
				<a class="btn btn-default" data-dismiss="modal">{{lang_close}}</a>
				<button type="submit" id="myModalSubmitButton" class="btn btn-primary" form="">{{lang_save}}</button>
			</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>