haproxy-wi/app/templates/include/admins_dialogs.html

359 lines
12 KiB
HTML

{% if page != "servers.py" %}
<div id="user-add-table" style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
{% include 'include/admin_add_user.html' %}
<tr>
<td class="padding20">
Role
<span class="need-field">*</span>
</td>
<td>
<select id="new-role" name="new-role">
<option disabled selected>Select a role</option>
{% for role in roles %}
<option value="{{ role.name }}">{{ role.name }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td class="padding20">
Group
<span class="need-field">*</span>
</td>
<td>
<select id="new-group" name="new-group">
<option disabled selected>Select a group</option>
{% for group in groups %}
<option value="{{ group.group_id }}">{{ group.name }}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
</div>
<div id="group-add-table" style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
<tr>
<td class="padding20">
New group name
<span class="need-field">*</span>
</td>
<td>
{{ input('new-group-add', autofocus='autofocus') }}
</td>
</tr>
<td class="padding20">Description</td>
<td>{{ input('new-desc', size="40") }}</td>
</tr>
</table>
</div>
{% else %}
<div id="user-add-table" style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
{% include 'include/admin_add_user.html' %}
<td class="padding20">
Role
<span class="need-field">*</span>
</td>
<td>
<select id="new-role" name="new-role">
<option disabled selected>Select a role</option>
{% for role in roles %}
{% if role.name != "superAdmin" %}
<option value="{{ role.name }}">{{ role.name }}</option>
{% endif %}
{% endfor %}
</select>
</td>
</tr>
</table>
</div>
{% endif %}
<div id="server-add-table" title="Add a new server " style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
{% include 'include/admin_add_server.html' %}
<tr>
<td class="padding20">
Credentials
<span class="need-field">*</span>
</td>
<td>
<select id="credentials" required>
<option disabled selected>Select credentials</option>
{% for ssh in sshs %}
<option value="{{ssh.id}}">{{ssh.name}}</option>
{% endfor %}
</select>
</td>
</tr>
{% if page != "servers.py" %}
<tr>
<td class="padding20">
Group
<span class="need-field">*</span>
</td>
<td>
<select id="new-server-group-add" name="new-server-group-add">
<option disabled selected value="0">Select a group</option>
{% for group in groups %}
<option value="{{ group.group_id }}">{{ group.name }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
</table>
</div>
<div id="ssh-add-table" style="display: none;">
<table>
{% include 'include/tr_validate_tips.html' %}
<tr>
<td class="padding20">
Name
<span class="need-field">*</span>
</td>
<td>
{{ input('new-ssh-add', autofocus='autofocus') }}
</td>
</tr>
<tr>
<td class="padding20">SSH key</td>
<td>
<label for="new-ssh_enable">Enabled SSH key</label><input type="checkbox" id="new-ssh_enable" checked>
</td>
</tr>
{% if page != "servers.py" %}
<tr>
<td class="padding20">Group</td>
<td>
<select id="new-sshgroup" name="new-sshgroup">
{% for group in groups %}
<option value="{{ group.group_id }}">{{ group.name }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
<tr>
<td class="padding20">
User name
<span class="need-field">*</span>
</td>
<td>
<p style="width: 100px;">
{{ input('ssh_user', value=ssh_user, title='SSH username') }}
</p>
{{ input('ssh_pass', type='password', style="display: none;", title="User password, if SSH key is disabled") }}
</td>
</tr>
</table>
</div>
<div id="telegram-add-table" style="display: none;">
<table>
{% include 'include/tr_validate_tips.html' %}
<tr>
<td class="padding20">
<span title="Token that gave you @father_bot">Token</span>
<span class="need-field">*</span>
</td>
<td>
{{ input('telegram-token-add', size='30') }}
</td>
</tr>
<tr>
<td class="padding20">
Channel name
<span class="need-field">*</span>
</td>
<td>
{{ input('telegram-chanel-add') }}
</td>
</tr>
{% if page != "servers.py" %}
<tr>
<td class="padding20">Group</td>
<td>
<select id="new-telegram-group-add" name="new-telegram-group-add">
<option disabled selected value="0">Select a group</option>
{% for group in groups %}
<option value="{{ group.group_id }}">{{ group.name }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
</table>
</div>
<div id="slack-add-table" style="display: none;">
<table>
{% include 'include/tr_validate_tips.html' %}
<tr>
<td class="padding20">
<span title="Token that has given with APP registration">Token</span>
<span class="need-field">*</span>
</td>
<td>
{{ input('slack-token-add', size='30') }}
</td>
</tr>
<tr>
<td class="padding20">
Channel name
<span class="need-field">*</span>
</td>
<td>
{{ input('slack-chanel-add') }}
</td>
</tr>
{% if page != "servers.py" %}
<tr>
<td class="padding20">Group</td>
<td>
<select id="new-slack-group-add" name="new-slack-group-add">
<option disabled selected value="0">Select a group</option>
{% for group in groups %}
<option value="{{ group.group_id }}">{{ group.name }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
</table>
</div>
<div id="backup-add-table" title="Add a new backup job " style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
{% include 'include/add_backup.html' %}
<tr>
<td class="padding20">
Credentials for a remote server
<span class="need-field">*</span>
</td>
<td>
<select id="backup-credentials" required>
<option disabled selected>Select credentials</option>
{% for ssh in sshs %}
{% if ssh.enable == 1 %}
<option value="{{ssh.id}}">{{ssh.name}}</option>
{% endif %}
{% endfor %}
</select>
</td>
</tr>
<tr>
<td class="padding20">
Description
</td>
<td>
{{ input('backup-description', size='30') }}
</td>
</tr>
</table>
</div>
<div id="git-add-table" title="Add a new git job " style="display: none;">
<table class="overview">
{% include 'include/tr_validate_tips.html' %}
<tr>
<td class="padding20" style="width: 40%;">
Server
<span class="need-field">*</span>
</td>
<td>
<select autofocus required name="git-server" id="git-server">
<option disabled>------</option>
{% for s in servers %}
<option value="{{ s.0 }}">{{ s.1 }}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td class="padding20" style="width: 40%;">
Service
<span class="need-field">*</span>
</td>
<td>
<select id="git-service" required>
<option disabled selected>------</option>
{% for s in services %}
<option value="{{s.service_id}}">{{s.service}}</option>
{% endfor %}
</select>
</td>
</tr>
<tr>
<td class="padding20">
Period
<span class="need-field">*</span>
</td>
<td>
{% set values = {'hourly':'hourly','daily':'daily','weekly':'weekly', 'monthly':'monthly'} %}
{{ select('git-time', values=values, selected='hourly', required='required', class='force_close') }}
</td>
</tr>
<tr>
<td class="padding20">
Init a new repository
</td>
<td>
{{ checkbox('git-init')}}
</td>
</tr>
<tr style="display: none" class="git-init-params">
<td class="padding20">
Repository
<span class="need-field">*</span>
</td>
<td>
{{ input('git-repo', size='30', placeholder="git@github.com:user/haproxy_configs.git", title="Use only connect via SSH") }}
</td>
</tr>
<tr>
<td class="padding20">
Branch name
<span class="need-field">*</span>
</td>
<td>
{{ input('git-branch', size='30', placeholder="main") }}
</td>
</tr>
<tr>
<td class="padding20">
Credentials for a git user
<span class="need-field">*</span>
</td>
<td>
<select id="git-credentials" required>
<option disabled selected>------</option>
{% for ssh in sshs %}
{% if ssh.enable == 1 %}
<option value="{{ssh.id}}">{{ssh.name}}</option>
{% endif %}
{% endfor %}
</select>
</td>
</tr>
<tr>
<td class="padding20">
Description
</td>
<td>
{{ input('git-description', size='30') }}
</td>
</tr>
</table>
</div>
<div id="dialog-confirm-services" style="display: none;">
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:3px 12px 20px 0;"></span>Are you sure?</p>
</div>
<div id="firewall_rules" style="display: none; padding: 0 2px 0 0; margin-left: 1px; margin-right: -4px;">
<div id="firewall_rules_body"></div>
</div>
<div id="change-user-service-dialog" style="display: none;">
<div id="change-user-service-form"></div>
</div>