{% extends "base.html" %}
{% block title %}{{lang.menu_links.servers.title}}{% endblock %}
{% block h2 %}{{lang.menu_links.servers.title}}{% endblock %}
{% block content %}
{% from 'include/input_macros.html' import input, checkbox, select, copy_to_clipboard %}
<script src="/inc/users.js"></script>
{% include 'include/del_confirm.html' %}
<input type="hidden" id="new-group" name="new-group" value="{{ group }}">
<input type="hidden" id="new-server-group-add" name="new-server-group-add" value="{{ group }}" >
<input type="hidden" id="new-sshgroup" name="new-sshgroup" value="{{ group }}" >
{{ input('new-telegram-group-add', type='hidden', value=group) }}
{{ input('new-slack-group-add', type='hidden', value=group) }}
{{ input('new-pd-group-add', type='hidden', value=group) }}
<div id="tabs">
	<ul>
		<li><a href="#users" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} {{lang.words.users}} - Roxy-WI">{{lang.words.users|title()}}</a></li>
		<li><a href="#servers" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} {{lang.words.servers}} - Roxy-WI">{{lang.words.servers|title()}}</a></li>
		<li><a href="#ssh" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} SSH {{lang.words.creds}} - Roxy-WI">SSH {{lang.words.creds}}</a></li>
		<li><a href="#settings" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} Roxy-WI {{lang.words.settings}} - Roxy-WI">{{lang.words.settings|title()}}</a></li>
		<li><a href="#backup" title="{{lang.words.servers|title()}}: {{lang.words.manage|title()}} {{lang.words.backup|title()}} configs - Roxy-WI" id="admin-tabs-backup">{{lang.words.backup|title()}}</a></li>
	</ul>
	<div id="users">
		{% include 'include/admin_users.html' %}
	</div>

	<div id="servers">
		{% include 'include/admin_servers.html' %}
	</div>

	<div id="ssh">
		{% include 'include/admin_ssh.html' %}
	</div>
	
	<div id="settings">
		{% include 'include/admin_settings.html' %}
	</div>

	<div id="backup">
		{% include 'include/admin_backup.html' %}
	</div>

</div>
{% include 'include/admins_dialogs.html' %}
{% include 'include/change_pass_form.html' %}
<script>
	$( function() {
		{% for user in users %}
			$("#role-{{user.0}}" ).selectmenu({
				  width: 100
			});	
		{% endfor %}
		{% for server in servers %}
			$("#slavefor-{{server.0}}" ).selectmenu({
			  width: 100
			});
			$("#credentials-{{server.0}}" ).selectmenu({
			  width: 150
			});
		{% endfor %}
		{% for ssh in sshs %}
			$("#sshgroup-{{ ssh.0}}" ).selectmenu({
				  width: 150
			});
		{% endfor %}
		{% for server in backups %}
			$("#backup-time-{{ server.id}}" ).selectmenu({
				width: 100
			});
			$("#backup-type-{{server.id}}" ).selectmenu({
				width: 130
			});
			$("#backup-credentials-{{server.id}}" ).selectmenu({
				width: 150
			});
		{% endfor %}
	});
</script>
<link href="/inc/css/servers.css" rel="stylesheet"/>
{% include 'include/intro/servers.html' %}
{% include 'include/intro/js_script.html' %}
{% endblock %}
