{% import 'main/macros.tpl.html' as macro %}
{{ macro.table_search(label_search) }}
<div class="table-responsive">
	<table class="table table-striped table-hover table-bordered">
		<thead>
			<tr>
				<!--class="d-none d-lg-table-cell"-->
                <th scope="col">{{ label_label }}</th>
                <th scope="col">{{ label_domain }}</th>
                <th scope="col" style="width: 5%;">{{ label_port }}</th>
                <th scope="col" style="width: 8%;">{{ label_type }}</th>
                <th scope="col" style="width: 8%;">{{ label_rtime }} (ms)</th>
                <th scope="col" style="width: 10%;">{{ label_last_online }}</th>
                <th scope="col" style="width: 10%;">{{ label_last_offline }}</th>
                <th scope="col" style="width: 10%;">{{ label_monitoring }}</th>
                {% if user_level == 10 %}
                <th scope="col" style="width: 5%;">&#32</th>
                {% endif %}
			</tr>
			<tr class="warning no-result">
					<td colspan="9"><i class="fas fa-exclamation-triangle"></i> No result</td>
				  </tr>
		</thead>
		<tbody>
			{% for server in servers %}
			<tr>
				<th scope="row">
					<div class="content">
						{% if server.status|lower == 'on' %}
						<i class="fas fa-check-circle" title="{{ server.status }}"></i>&nbsp;
						{% elseif server.status|lower == 'warning' %}
						<i class="fas fa-exclamation-triangle" title="{{ server.status }}"></i>&nbsp;
						{% elseif server.status|lower == 'off' %}
						<i class="fas fa-times-circle" title="{{ server.status }}"></i>&nbsp;
						{% endif %}
						<a href="{{ server.url_view|raw }}" title="{{ label_view }}">
							{{ server.label }}
						</a>
					</div>
				</th>
				<td><div class="content">{{ server.ip|raw }}</div></td>
				<td>{{ server.port }}</td>
				<td>{{ server.type }}</td>
				<td>{{ (server.rtime * 1000)|round(2) }}</td>
				<td><div class="content">{{ server.last_online }}</div></td>
				<td><div class="content">{{ server.last_offline }}</div></td>
				<td>
					{% if server.active|lower == 'yes'%} 
						<i class="fas fa-eye" title="{{ server.active_title }}"></i>
					{% else %}
						<i class="fas fa-eye-slash" title="{{ server.active_title }}"></i>
					{% endif %}
					{% if server.email|lower == 'yes' and config.email|lower%}
						<i class="fas fa-envelope" title="{{ label_email }}"></i>
					{% endif %}
					{% if server.sms|lower == 'yes' and config.sms|lower%}
						<i class="fas fa-sms" title="{{ label_sms }}"></i>
					{% endif %}
					{% if server.pushover|lower == 'yes'and config.pushover|lower %}
						<span class="fa-layers">
							<i class="fas fa-circle" title="{{ label_pushover }}"></i>
							<span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">P</span>
						</span>
					{% endif %}
					{% if server.telegram|lower == 'yes' and config.telegram|lower%}
                        <i class="fab fa-telegram" title="{{ label_telegram }}"></i>
					{% endif %}
					{% if server.jabber|lower == 'yes'%}
					<span class="fa-layers">
                        <i class="fas fa-circle" title="{{ label_jabber }}"></i>
                        <span class="fa-layers-text fa-inverse" style="font-weight:400; font-size:75%">J</span>
                    </span>
                    {% endif %}
                    {% if server.discord|lower == 'yes' and config.discord|lower %}
                        <i class="fab fa-discord" title="{{ label_discord }}"></i>
                    {% endif %}
                    {% if server.webhook|lower == 'yes' and config.webhook|lower %}
                        <span class="fa-layers">
                            <i class="fas fa-circle" title="{{ label_webhook }}"></i>
                            <span class="fa-layers-text fa-inverse" style="font-weight:600; font-size:55%">W</span>
                        </span>
                    {% endif %}
				</td>
				{% if user_level == 10 %}
				<td>
					<div class="item-action dropdown">
						<a data-toggle="dropdown" class="icon"><i class="fas fa-ellipsis-v"></i></a>
						<div class="dropdown-menu">
							<a class="dropdown-item" href="{{ server.url_view|raw }}" title="{{ label_view }}">
								<i class="fas fa-eye"></i> {{ label_view }}
							</a>
							<a class="dropdown-item" href="{{ server.url_edit|raw }}" title="{{ label_edit }}">
								<i class="fas fa-edit"></i> {{ label_edit }}
							</a>
							<a class="dropdown-item show-modal" href="{{ server.url_delete|raw }}" title="{{ label_delete }}" data-modal-id="delete"
							 data-modal-param="{{ server.label }}">
								<i class="fas fa-trash"></i> {{ label_delete }}
							</a>
						</div>
					</div>
				</td>
				{% endif %}
			</tr>
			{% endfor %}
		</tbody>
	</table>
</div>