Files
urbackup/templates/asset/asset_tab.html.twig
T
2026-05-20 11:16:14 +02:00

70 lines
3.0 KiB
Twig

<div class="plugin-urbackup-asset-tab">
{% if not linked %}
<div class="alert alert-info">
{{ __('No UrBackup server linked.', 'urbackup') }}
</div>
<table class="tab_cadre_fixe">
<tr>
<th colspan="2">{{ __('UrBackup server selection', 'urbackup') }}</th>
</tr>
{% if is_sub_location %}
<tr class="tab_bg_1">
<td colspan="2"><em>
{{ __('The asset is in a sub-location. The plugin will use the server assigned to the root location.', 'urbackup') }}
</em></td>
</tr>
{% endif %}
{% if servers|length == 0 %}
<tr class="tab_bg_1">
<td colspan="2">
<div class="alert alert-warning">
{{ __('No UrBackup server available for the root location of this asset.', 'urbackup') }}
</div>
</td>
</tr>
{% elseif can_connect %}
<tr class="tab_bg_1">
<td>{{ __('Available servers for root location', 'urbackup') }}</td>
<td>
<form method="post" action="{{ path('urbackup_asset_action') }}">
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token() }}">
<input type="hidden" name="itemtype" value="{{ itemtype }}">
<input type="hidden" name="items_id" value="{{ items_id }}">
<select name="plugin_urbackup_servers_id">
{% for id, name in servers %}
<option value="{{ id }}">{{ name }}</option>
{% endfor %}
</select>
<button type="submit" name="connect" class="btn btn-primary">{{ __('Connect', 'urbackup') }}</button>
</form>
</td>
</tr>
{% else %}
<tr class="tab_bg_1">
<td colspan="2">
{{ __('A server is available, but you do not have permission to link this asset.', 'urbackup') }}
</td>
</tr>
{% endif %}
</table>
{% else %}
<table class="tab_cadre_fixe">
<tr>
<th colspan="4">{{ __('UrBackup status', 'urbackup') }}</th>
</tr>
<tr class="tab_bg_1">
<td>{{ __('Linked server', 'urbackup') }}</td>
<td>{{ server_link }}</td>
<td>{{ __('IP address', 'urbackup') }}</td>
<td>{{ server_ip }}</td>
</tr>
<tr class="tab_bg_1">
<td>{{ __('UrBackup server version', 'urbackup') }}</td>
<td>{{ server_version }}</td>
<td>{{ __('Client name', 'urbackup') }}</td>
<td>{{ client_name }}</td>
</tr>
</table>
{% endif %}
</div>