1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 12:04:15 +00:00
webvirtcloud/computes/templates/computes.html

247 lines
19 KiB
HTML
Raw Normal View History

2015-02-27 12:25:41 +00:00
{% extends "base.html" %}
2015-02-27 08:53:51 +00:00
{% load i18n %}
2015-02-27 12:25:41 +00:00
{% block title %}{% trans "Computes" %}{% endblock %}
{% block content %}
2019-07-31 08:03:48 +00:00
<!-- Page Heading -->
<div class="row">
<div class="col-lg-12">
{% include 'create_comp_block.html' %}
2020-05-19 16:53:54 +00:00
<h2 class="page-header">{% trans "Computes" %}</h2>
2019-07-31 08:03:48 +00:00
</div>
</div>
<!-- /.row -->
2015-02-27 08:53:51 +00:00
2019-07-31 08:03:48 +00:00
{% include 'errors_block.html' %}
2015-02-27 08:53:51 +00:00
2019-07-31 08:03:48 +00:00
<div class="row">
{% if computes_info %}
{% for compute in computes_info %}
2020-06-09 11:13:40 +00:00
<div id="{{ compute.name }}" class="mb-3 col-12 col-sm-4">
2020-05-19 16:53:54 +00:00
{% if compute.status is True %}
<div class="card border-success shadow h-100">
<div class="card-header bg-success">
{% else %}
<div class="card border-danger shadow h-100">
<div class="card-header bg-danger">
{% endif %}
<h5 class="my-0 card-title">
{% if compute.status is True %}
<a class="card-link text-light" href="{% url 'overview' compute.id %}"><strong>{{ compute.name }}</strong></a>
{% else %}
<span class="card-link text-light" href="#"><strong>{{ compute.name }}</strong></span>
{% endif %}
<a class="card-link text-light float-right" data-toggle="modal" href="#editHost{{ compute.id }}" title="{% trans "Edit" %}">
<i class="fa fa-cog"></i>
</a>
</h5>
2019-07-31 08:03:48 +00:00
</div>
2020-05-19 16:53:54 +00:00
<div class="card-body">
<dl class="row">
<dt class="col-5">{% trans "Status" %}</dt>
2020-05-19 16:53:54 +00:00
{% if compute.status %}
<dd class="col-7">{% trans "Connected" %}</dd>
2020-05-19 16:53:54 +00:00
{% else %}
<dd class="col-7">{% trans "Not Connected" %}</dd>
2020-05-19 16:53:54 +00:00
{% endif %}
<dt class="col-5">{% trans "Details" %}</dt>
2020-05-19 16:53:54 +00:00
{% if compute.details %}
<dd class="col-7">{% trans compute.details %}</dd>
2020-05-19 16:53:54 +00:00
{% else %}
<dd class="col-7">{% trans "No details available" %}</dd>
2020-05-19 16:53:54 +00:00
{% endif %}
</dl>
2019-07-31 08:03:48 +00:00
<!-- Modal Edit -->
<div class="modal fade" id="editHost{{ compute.id }}" tabindex="-1" role="dialog" aria-labelledby="editHostLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
2020-05-19 16:53:54 +00:00
<h5 class="modal-title">{% trans "Edit connection" %}</h5>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
2015-03-05 14:56:22 +00:00
</div>
{% if compute.type == 1 %}
2020-05-26 13:18:38 +00:00
<form method="post" role="form" aria-label="Edit tcp host form">{% csrf_token %}
2019-07-31 08:03:48 +00:00
<div class="modal-body">
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Name" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="hidden" name="host_id" value="{{ compute.id }}">
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "FQDN / IP" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Username" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Password" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Details" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="details" class="form-control" placeholder="{% trans "Details" %}" value="{{ compute.details }}">
2019-07-31 08:03:48 +00:00
</div>
</div></div>
<div class="modal-footer">
<button type="submit" class="btn btn-danger mr-auto" name="host_del">
2019-07-31 08:03:48 +00:00
{% trans "Delete" %}
</button>
2020-05-19 16:53:54 +00:00
<button type="button" class="btn btn-secondary" data-dismiss="modal">
2019-07-31 08:03:48 +00:00
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-primary" name="host_edit" autofocus>
2019-07-31 08:03:48 +00:00
{% trans "Change" %}
</button>
2015-02-27 08:53:51 +00:00
</div>
2019-07-31 08:03:48 +00:00
</form>
{% endif %}
{% if compute.type == 2 %}
2020-05-26 13:18:38 +00:00
<form method="post" role="form" aria-label="Edit ssh host form">{% csrf_token %}
2019-07-31 08:03:48 +00:00
<div class="modal-body">
<p class="modal-body">{% trans "Need create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Name" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="hidden" name="host_id" value="{{ compute.id }}">
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
2018-07-31 07:15:59 +00:00
</div>
2019-07-31 08:03:48 +00:00
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "FQDN / IP" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Username" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
<input type="hidden" name="password" value="{{ compute.password }}">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Details" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="details" class="form-control" placeholder="{% trans "Details" %}" value="{{ compute.details }}">
2019-07-31 08:03:48 +00:00
</div>
</div>
</div>
<div class="modal-footer">
2020-05-19 16:53:54 +00:00
<button type="submit" class="btn btn-danger mr-auto" name="host_del">
2019-07-31 08:03:48 +00:00
{% trans "Delete" %}
</button>
2020-05-19 16:53:54 +00:00
<button type="button" class="btn btn-secondary" data-dismiss="modal">
2019-07-31 08:03:48 +00:00
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-primary" name="host_edit">
{% trans "Change" %}
</button>
</div>
</form>
{% endif %}
{% if compute.type == 3 %}
2020-05-26 13:18:38 +00:00
<form method="post" role="form" aria-label="Edit tls host form">{% csrf_token %}
2019-07-31 08:03:48 +00:00
<div class="modal-body">
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Name" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="hidden" name="host_id" value="{{ compute.id }}">
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "FQDN / IP" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Username" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="login" class="form-control" placeholder="{% trans "Name" %}">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Password" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Details" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="details" class="form-control" placeholder="{% trans "Details" %}" value="{{ compute.details }}">
2019-07-31 08:03:48 +00:00
</div>
</div>
</div>
<div class="modal-footer">
2020-05-19 16:53:54 +00:00
<button type="submit" class="btn btn-danger mr-auto" name="host_del">
2019-07-31 08:03:48 +00:00
{% trans "Delete" %}
</button>
2020-05-19 16:53:54 +00:00
<button type="button" class="btn btn-secondary" data-dismiss="modal">
2019-07-31 08:03:48 +00:00
{% trans "Close" %}
</button>
<button type="submit" class="btn btn-primary" name="host_edit">
{% trans "Change" %}
</button>
</div>
</form>
{% endif %}
{% if compute.type == 4 %}
2020-05-26 13:18:38 +00:00
<form method="post" role="form" aria-label="Edit/delete host form">{% csrf_token %}
2019-07-31 08:03:48 +00:00
<div class="modal-body">
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Name" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="hidden" name="host_id" value="{{ compute.id }}">
<input type="text" name="name" class="form-control" value="{{ compute.name }}" maxlength="20" required pattern="[a-z0-9\.\-_]+">
</div>
</div>
2020-05-19 16:53:54 +00:00
<div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Details" %}</label>
2019-07-31 08:03:48 +00:00
<div class="col-sm-6">
<input type="text" name="details" class="form-control" placeholder="{% trans 'Details' %}" value="{{ compute.details }}">
2019-07-31 08:03:48 +00:00
</div>
</div>
</div>
<div class="modal-footer">
2020-05-19 16:53:54 +00:00
<button type="submit" class="btn btn-danger mr-auto" name="host_del">
2019-07-31 08:03:48 +00:00
{% trans "Delete" %}
</button>
2020-05-19 16:53:54 +00:00
<button type="button" class="btn btn-secondary" data-dismiss="modal">
2019-07-31 08:03:48 +00:00
{% trans "Close" %}
<button type="submit" class="btn btn-primary" name="host_edit">
{% trans "Change" %}
</button>
</div>
</form>
{% endif %}
2019-07-31 08:03:48 +00:00
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
2015-02-27 08:53:51 +00:00
</div>
2019-07-31 08:03:48 +00:00
</div>
</div>
{% endfor %}
{% else %}
<div class="col-lg-12">
<div class="alert alert-warning alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning" %}:</strong> {% trans "Hypervisor doesn't have any Computes" %}
</div>
</div>
{% endif %}
</div>
{% endblock %}