mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Resoved problem with app template
This commit is contained in:
parent
35da9ad193
commit
b4e8da8671
42 changed files with 37 additions and 32 deletions
|
@ -1,104 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "User" %} - {{ user }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'accounts/create_user_inst_block.html' %}
|
||||
<h1 class="page-header">{{ user }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if not user_insts %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "User doesn't have any Instace" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{% trans "Instance" %}</th>
|
||||
<th>{% trans "Resize" %}</th>
|
||||
<th>{% trans "Delete" %}</th>
|
||||
<th colspan="2">{% trans "Action" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for inst in user_insts %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td><a href="{% url 'instance' inst.instance.compute.id inst.instance.name %}">{{ inst.instance.name }}</a></td>
|
||||
<td>{{ inst.is_change }}</td>
|
||||
<td>{{ inst.is_delete }}</td>
|
||||
<td style="width:5px;">
|
||||
<a href="#editPriv{{ forloop.counter }}" type="button" class="btn btn-xs btn-default" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal pool -->
|
||||
<div class="modal fade" id="editPriv{{ forloop.counter }}" tabindex="-1" role="dialog" aria-labelledby="editPrivLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Edit privilegies for" %} {{ inst.instance.name }}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="user_inst" value="{{ inst.id }}">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Resize" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select type="text" class="form-control" name="inst_change">
|
||||
<option value="">False</option>
|
||||
<option value="1" {% if inst.is_change %}selected{% endif %}>True</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Delete" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select type="text" class="form-control" name="inst_delete">
|
||||
<option value="">False</option>
|
||||
<option value="1" {% if inst.is_delete %}selected{% endif %}>True</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="permission">{% trans "Edit" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
</td>
|
||||
<td style="width:5px;">
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="user_inst" value="{{ inst.id }}">
|
||||
<button type="submit" class="btn btn-xs btn-default" name="delete" tittle="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true"></span>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,102 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Users" %}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'accounts/create_user_block.html' %}
|
||||
<h1 class="page-header">{% trans "Users" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if not users %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any User" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% for user in users %}
|
||||
<div id="{{ user.username }}" class="col-xs-12 col-sm-4">
|
||||
<div class="panel {% if user.is_active %}panel-success{% else %}panel-danger{% endif %} panel-data">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<a href="{% url 'account' user.id %}"><strong>{{ user.username }}</strong></a>
|
||||
<a data-toggle="modal" href="#editUser{{ user.id }}" class="pull-right" title="{% trans "Edit" %}">
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="col-xs-4 col-sm-4">
|
||||
<p><strong>{% trans "Status:" %}</strong></p>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
{% if user.is_active %}
|
||||
<p>{% trans "Active" %}</p>
|
||||
{% else %}
|
||||
<p>{% trans "Blocked" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal Edit -->
|
||||
<div class="modal fade" id="editUser{{ user.id }}" tabindex="-1" role="dialog" aria-labelledby="editUserLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Edit user info" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="hidden" name="user_id" value="{{ user.id }}">
|
||||
<input type="text" name="name" class="form-control" value="{{ user.username }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" name="user_pass" class="form-control" value="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="pull-left btn btn-danger" name="delete">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
{% if user.is_active %}
|
||||
<button type="submit" class="pull-left btn btn-warning" name="block">
|
||||
{% trans "Block" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button type="submit" class="pull-left btn btn-success" name="unblock">
|
||||
{% trans "Unblock" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="edit">
|
||||
{% trans "Edit" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,41 +0,0 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="WebVirtMgr panel for manage virtual machine">
|
||||
<meta name="author" content="anatoliy.guskov@gmail.com">
|
||||
|
||||
<title>{% block title %}{% endblock %}</title>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet">
|
||||
|
||||
<!-- SB admin CSS -->
|
||||
<link href="{% static "css/signin.css" %}" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="{% static "js/jquery.js" %}"></script>
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="{% static "js/bootstrap.min.js" %}"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -1,38 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddUser" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal pool -->
|
||||
<div class="modal fade" id="AddUser" tabindex="-1" role="dialog" aria-labelledby="AddUserLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add New User" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="john" required pattern="[a-z0-9]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" class="form-control" name="password" placeholder="*******" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,36 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#addUserInst" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal pool -->
|
||||
<div class="modal fade" id="addUserInst" tabindex="-1" role="dialog" aria-labelledby="addUserInstLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add Instance for User" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Host / Instance" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" name="inst_id">
|
||||
{% for inst in instances %}
|
||||
<option value="{{ inst.id }}">{{ inst.compute.name }} / {{ inst.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="add">{% trans "Add" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,25 +0,0 @@
|
|||
{% extends "accounts/base_auth.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "WebVirtCloud - Sign In" %}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<a href="/"><h1>WebVirtCloud</h1></a>
|
||||
</div>
|
||||
<div class="col-xs-12" role="main">
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
{% trans "Incorrect username or password." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<form class="form-signin" method="post" role="form">{% csrf_token %}
|
||||
<h2 class="form-signin-heading">{% trans "Sign In" %}</h2>
|
||||
<input type="text" class="form-control" name="username" placeholder="Login" autocapitalize="none" autocorrect="off" autofocus>
|
||||
<input type="password" class="form-control" name="password" placeholder="Password">
|
||||
<input name="next" id="next" type="hidden" value="{% url 'instances' %}">
|
||||
<button class="btn btn-lg btn-success btn-block" type="submit">{% trans "Sign In" %}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,15 +0,0 @@
|
|||
{% extends "accounts/base_auth.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "WebVirtCloud - Sign Out" %}{% endblock %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="page-header">
|
||||
<a href="/"><h1>WebVirtCloud</h1></a>
|
||||
</div>
|
||||
<div class="col-xs-12" role="main">
|
||||
<div class="logout">
|
||||
<h1>{% trans "Successful log out" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,71 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Profile" %}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">{% trans "Profile" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">{% trans "Edit Profile" %}</h3>
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Login" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" value="{{ request.user.username }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-2 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="text" class="form-control" name="username" value="{{ request.user.first_name }}" pattern="[0-9a-zA-Z]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-2 control-label">{% trans "Email" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="email" class="form-control" name="email" value="{{ request.user.email }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary">{% trans "Change" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<h3 class="page-header">{% trans "Edit Password" %}</h3>
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{% trans "Old password" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control" name="oldpasswd" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-2 control-label">{% trans "New password" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control" name="passwd1" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-2 control-label">{% trans "Retry password" %}</label>
|
||||
<div class="col-sm-4">
|
||||
<input type="password" class="form-control" name="passwd2" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary">{% trans "Change" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,221 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Computes" %}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'computes/create_comp_block.html' %}
|
||||
<h1 class="page-header">{% trans "Computes" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if computes_info %}
|
||||
{% for compute in computes_info %}
|
||||
<div id="{{ compute.name }}" class="col-xs-12 col-sm-4">
|
||||
<div class="panel {% if compute.status %}panel-success{% else %}panel-danger{% endif %} panel-data">
|
||||
<div class="panel-heading">
|
||||
{% ifequal compute.status 1 %}
|
||||
<h3 class="panel-title">
|
||||
<a href="{% url 'overview' compute.id %}"><strong>{{ compute.name }}</strong></a>
|
||||
<a data-toggle="modal" href="#editHost{{ compute.id }}" class="pull-right" title="{% trans "Edit" %}">
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
</a>
|
||||
</h3>
|
||||
{% else %}
|
||||
<h3 class="panel-title"><strong>{{ compute.name }}</strong>
|
||||
<a data-toggle="modal" href="#editHost{{ compute.id }}" class="pull-right" title="{% trans "Edit" %}">
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
</a>
|
||||
</h3>
|
||||
{% endifequal %}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-4">
|
||||
<p><strong>{% trans "Status:" %}</strong></p>
|
||||
</div>
|
||||
<div class="col-xs-4 col-sm-6">
|
||||
{% if compute.status %}
|
||||
<p>{% trans "Connected" %}</p>
|
||||
{% else %}
|
||||
<p>{% trans "Not Connected" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 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">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Edit connection" %}</h4>
|
||||
</div>
|
||||
{% ifequal compute.type 1 %}
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="pull-left btn btn-danger" name="host_del">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_edit">
|
||||
{% trans "Edit" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
{% ifequal compute.type 2 %}
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" value="{{ compute.login }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="pull-left btn btn-danger" name="host_del">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_edit">
|
||||
{% trans "Edit" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
{% ifequal compute.type 3 %}
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" value="{{ compute.hostname }}" required pattern="[a-z0-9\:\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" placeholder="{% trans "Name" %}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" name="password" class="form-control" value="{{ compute.password }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="pull-left btn btn-danger" name="host_del">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_tls_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
{% ifequal compute.type 4 %}
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="pull-left btn btn-danger" name="host_del">
|
||||
{% trans "Delete" %}
|
||||
</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_tls_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
</div>
|
||||
</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">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Computes" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,159 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#addHost" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="addHost" tabindex="-1" role="dialog" aria-labelledby="addHostLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add Connection" %}</h4>
|
||||
</div>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#1" data-toggle="tab">{% trans "TCP Connections" %}</a>
|
||||
</li>
|
||||
<li><a href="#2" data-toggle="tab">{% trans "SSH Connections" %}</a></li>
|
||||
<li><a href="#3" data-toggle="tab">{% trans "TLS Connection" %}</a></li>
|
||||
<li><a href="#4" data-toggle="tab">{% trans "Local Socket" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="1">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" name="password" class="form-control" placeholder="{% trans "Password" %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_tcp_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="2">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<p class="modal-body">{% trans "You must 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>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\:\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_ssh_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="3">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "FQDN / IP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="hostname" class="form-control" placeholder="{% trans "FQDN or IP Address" %}" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Username" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="login" class="form-control" placeholder="{% trans "Username" %}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Password" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="password" name="password" class="form-control" placeholder="{% trans "Password" %}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_tls_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="4">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Label" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" class="form-control" placeholder="Label Name" maxlength="20" required pattern="[a-z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="host_socket_add">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,149 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Overview" %} - {{ compute.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">{{ compute.name }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> {% trans "Overview" %}
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row" id="max-width-page">
|
||||
<h3 class="page-header">{% trans "Basic details" %}</h3>
|
||||
<div class="col-xs-4 col-sm-3">
|
||||
<p>{% trans "Hostname" %}</p>
|
||||
<p>{% trans "Hypervisor" %}</p>
|
||||
<p>{% trans "Memory" %}</p>
|
||||
<p>{% trans "Architecture" %}</p>
|
||||
<p>{% trans "Logical CPUs" %}</p>
|
||||
<p>{% trans "Processor" %}</p>
|
||||
<p>{% trans "Connection" %}</p>
|
||||
</div>
|
||||
<div class="col-xs-8 col-sm-7">
|
||||
<p>{{ hostname }}</p>
|
||||
<p>{{ hypervisor }}</p>
|
||||
<p>{{ host_arch }}</p>
|
||||
<p>{{ host_memory|filesizeformat }}</p>
|
||||
<p>{{ logical_cpu }}</p>
|
||||
<p>{{ model_cpu }}</p>
|
||||
<p>{{ uri_conn }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="max-width-page">
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">{% trans "Performance" %}</h3>
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "CPU usage" %}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="flot-chart">
|
||||
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
|
||||
<canvas id="cpuChart" width="735" height="250"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-long-arrow-right"></i> {% trans "RAM usage" %}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="flot-chart">
|
||||
<div class="flot-chart-content" id="flot-moving-line-chart" style="padding: 0px; position: relative;">
|
||||
<canvas id="memChart" width="735" height="250"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script src="{{ STATIC_URL }}js/Chart.min.js"></script>
|
||||
<script>
|
||||
var cpuLineData = {
|
||||
labels : [0, 0, 0, 0, 0],
|
||||
datasets : [
|
||||
{
|
||||
fillColor: "rgba(241,72,70,0.5)",
|
||||
strokeColor: "rgba(241,72,70,1)",
|
||||
pointColor : "rgba(241,72,70,1)",
|
||||
pointStrokeColor : "#fff",
|
||||
pointHighlightFill : "#fff",
|
||||
pointHighlightStroke : "rgba(220,220,220,1)",
|
||||
data : [0, 0, 0, 0, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
var cpu_ctx = document.getElementById("cpuChart").getContext("2d");
|
||||
var cpuChart = new Chart(cpu_ctx).Line(cpuLineData, {
|
||||
animation: false,
|
||||
pointDotRadius: 2,
|
||||
scaleLabel: "<%=value%> %",
|
||||
scaleOverride: true,
|
||||
scaleSteps: 10,
|
||||
scaleStepWidth: 10,
|
||||
scaleStartValue: 0,
|
||||
responsive: true
|
||||
});
|
||||
|
||||
var memLineData = {
|
||||
labels : [0, 0, 0, 0, 0],
|
||||
datasets : [
|
||||
{
|
||||
fillColor : "rgba(249,134,33,0.5)",
|
||||
strokeColor : "rgba(249,134,33,1)",
|
||||
pointColor : "rgba(249,134,33,1)",
|
||||
pointStrokeColor : "#fff",
|
||||
pointHighlightFill : "#fff",
|
||||
pointHighlightStroke : "rgba(151,187,205,1)",
|
||||
data : [0, 0, 0, 0, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
var mem_ctx = $("#memChart").get(0).getContext("2d");
|
||||
var memChart = new Chart(mem_ctx).Line(memLineData, {
|
||||
animation: false,
|
||||
pointDotRadius: 2,
|
||||
scaleLabel: "<%=value%> Mb",
|
||||
responsive: true
|
||||
});
|
||||
|
||||
window.setInterval(function graph_usage() {
|
||||
$.getJSON('{% url 'compute_graph' compute_id %}', function (data) {
|
||||
cpuChart.scale.xLabels = data.timeline;
|
||||
memChart.scale.xLabels = data.timeline;
|
||||
for (var i = 0; i < 5; i++) {
|
||||
cpuChart.datasets[0].points[i].value = data.cpudata[i];
|
||||
memChart.datasets[0].points[i].value = data.memdata[i];
|
||||
}
|
||||
cpuChart.update();
|
||||
memChart.update();
|
||||
});
|
||||
}, 5000);
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,208 +0,0 @@
|
|||
{% load i18n %}
|
||||
<html>
|
||||
<head>
|
||||
<link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico">
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/spicearraybuffer.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/enums.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/atKeynames.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/utils.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/png.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/lz.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/quic.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/bitmap.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/spicedataview.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/spicetype.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/spicemsg.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/wire.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/spiceconn.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/display.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/main.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/inputs.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/webm.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/playback.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/simulatecursor.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/cursor.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/thirdparty/jsbn.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/thirdparty/rsa.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/thirdparty/prng4.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/thirdparty/rng.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/thirdparty/sha1.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/ticket.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/resize.js"></script>
|
||||
<script src="{{ STATIC_URL }}js/spice-html5/filexfer.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Helvetica;
|
||||
background-color:#494949;
|
||||
}
|
||||
|
||||
#status {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
font-size: 1em;
|
||||
height: 1.6em;
|
||||
padding-top: 0.3em;
|
||||
background-color: #222;
|
||||
}
|
||||
|
||||
#spice-area {
|
||||
border-bottom-right-radius: 800px 600px;
|
||||
background-color: #313131;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#spice-screen canvas {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="status"></div>
|
||||
<div id="spice-area">
|
||||
<div id="spice-screen" class="spice-screen"></div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var sc;
|
||||
|
||||
function spice_set_cookie(name, value, days) {
|
||||
var date, expires;
|
||||
date = new Date();
|
||||
date.setTime(date.getTime() + (days*24*60*60*1000));
|
||||
expires = "; expires=" + date.toGMTString();
|
||||
document.cookie = name + "=" + value + expires + "; path=/";
|
||||
};
|
||||
|
||||
function spice_query_var(name, defvalue) {
|
||||
var match = RegExp('[?&]' + name + '=([^&]*)')
|
||||
.exec(window.location.search);
|
||||
return match ?
|
||||
decodeURIComponent(match[1].replace(/\+/g, ' '))
|
||||
: defvalue;
|
||||
}
|
||||
|
||||
var status_div=false;
|
||||
function log_message(msg,color,bgcolor) {
|
||||
if (!status_div) {
|
||||
status_div=document.getElementById('status');
|
||||
}
|
||||
status_div.innerHTML=msg;
|
||||
if (color) {
|
||||
status_div.style.color=color;
|
||||
}
|
||||
if (bgcolor) {
|
||||
status_div.style.backgroundColor=bgcolor;
|
||||
}
|
||||
}
|
||||
|
||||
function log_error(msg) {
|
||||
log_message(msg,'#000','#f44');
|
||||
}
|
||||
|
||||
function log_info(msg) {
|
||||
log_message(msg,'#000','#eee');
|
||||
}
|
||||
|
||||
function spice_error(e)
|
||||
{
|
||||
console.log(e);
|
||||
disconnect();
|
||||
if (e.message != undefined) {
|
||||
log_error(e.message);
|
||||
}
|
||||
else {
|
||||
log_error('Unknown error');
|
||||
}
|
||||
}
|
||||
|
||||
function spice_success(msg) {
|
||||
log_info(msg);
|
||||
}
|
||||
|
||||
function connect(uri,password)
|
||||
{
|
||||
// If a token variable is passed in, set the parameter in a cookie.
|
||||
// This is used by nova-spiceproxy.
|
||||
token = spice_query_var('token', null);
|
||||
if (token) {
|
||||
spice_set_cookie('token', token, 1)
|
||||
}
|
||||
|
||||
if (sc) {
|
||||
sc.stop();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
sc = new SpiceMainConn({uri: uri, password: password, screen_id: "spice-screen",
|
||||
onsuccess: spice_success, onerror: spice_error, onagent: agent_connected });
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
console.log(e);
|
||||
log_error(e.toString());
|
||||
disconnect();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function disconnect()
|
||||
{
|
||||
console.log(">> disconnect");
|
||||
if (sc) {
|
||||
sc.stop();
|
||||
}
|
||||
if (window.File && window.FileReader && window.FileList && window.Blob)
|
||||
{
|
||||
console.log(" -> Disable drag/drop transfer");
|
||||
var spice_xfer_area = document.getElementById('spice-xfer-area');
|
||||
try {
|
||||
document.getElementById('spice-area').removeChild(spice_xfer_area);
|
||||
document.getElementById('spice-area').removeEventListener('dragover', handle_file_dragover, false);
|
||||
document.getElementById('spice-area').removeEventListener('drop', handle_file_drop, false);
|
||||
}
|
||||
catch(e) {
|
||||
console.log(' -> Error disabling drag/drop transfer');
|
||||
}
|
||||
}
|
||||
console.log("<< disconnect");
|
||||
}
|
||||
|
||||
function agent_connected(sc) {
|
||||
console.log('Connected');
|
||||
window.addEventListener('resize', handle_resize);
|
||||
window.spice_connection = this;
|
||||
|
||||
resize_helper(this);
|
||||
|
||||
if (window.File && window.FileReader && window.FileList && window.Blob)
|
||||
{
|
||||
var spice_xfer_area = document.createElement("div");
|
||||
spice_xfer_area.setAttribute('id', 'spice-xfer-area');
|
||||
document.getElementById('spice-area').addEventListener('dragover', handle_file_dragover, false);
|
||||
document.getElementById('spice-area').addEventListener('drop', handle_file_drop, false);
|
||||
log_info('Drag and drop transfer enabled.');
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log("File API is not supported");
|
||||
log_info('Drag and drop transfer not supported.');
|
||||
}
|
||||
log_info('Connected');
|
||||
}
|
||||
|
||||
var uri = 'ws://{{ ws_host }}:{{ ws_port }}';
|
||||
var password = '{{ console_passwd }}';
|
||||
log_info('Connecting ...');
|
||||
connect(uri,password);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,186 +0,0 @@
|
|||
{% load i18n %}
|
||||
<html>
|
||||
<head>
|
||||
<link rel="shortcut icon" href="{{ STATIC_URL }}img/favicon.ico">
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}js/novnc/base.css" title="plain">
|
||||
<!--
|
||||
<script type='text/javascript'
|
||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||
-->
|
||||
<script src="{{ STATIC_URL }}js/novnc/util.js"></script>
|
||||
</head>
|
||||
<body style="margin: 0px;">
|
||||
<div id="noVNC_screen">
|
||||
<div id="noVNC_status_bar" class="noVNC_status_bar" style="margin-top: 0px;">
|
||||
<table border=0 width="100%">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="noVNC_status">{% trans "Loading..." %}</div>
|
||||
</td>
|
||||
<td width="18%" style="text-align:right;">
|
||||
<div id="noVNC_buttons">
|
||||
<!-- dirty fix for keyboard on iOS devices -->
|
||||
<input type="button" id="showKeyboard" value="Keyboard" title="Show Keyboard"/>
|
||||
<!-- Note that Google Chrome on Android doesn't respect any of these,
|
||||
html attributes which attempt to disable text suggestions on the
|
||||
on-screen keyboard. Let's hope Chrome implements the ime-mode
|
||||
style for example -->
|
||||
<!-- TODO: check if this is needed on iOS -->
|
||||
<textarea id="keyboardinput" autocapitalize="off"
|
||||
autocorrect="off" autocomplete="off" spellcheck="false"
|
||||
mozactionhint="Enter" onsubmit="return false;"
|
||||
style="ime-mode: disabled;">
|
||||
</textarea>
|
||||
|
||||
<input type=button value="Ctrl+Alt+Del" id="sendCtrlAltDelButton">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<canvas id="noVNC_canvas" width="640px" height="20px">
|
||||
{% trans "Canvas not supported." %}
|
||||
</canvas>
|
||||
</div>
|
||||
<script>
|
||||
/*jslint white: false */
|
||||
/*global window, $, Util, RFB, */
|
||||
"use strict";
|
||||
|
||||
// dirty fix for keyboard on iOS devices
|
||||
var keyboardVisible = false;
|
||||
var isTouchDevice = false;
|
||||
isTouchDevice = 'ontouchstart' in document.documentElement;
|
||||
|
||||
// Load supporting scripts
|
||||
Util.load_scripts(["webutil.js", "base64.js", "websock.js", "des.js",
|
||||
"input.js", "display.js", "jsunzip.js", "rfb.js"]);
|
||||
|
||||
var rfb;
|
||||
|
||||
function passwordRequired(rfb) {
|
||||
var msg;
|
||||
msg = '<form onsubmit="return setPassword();"';
|
||||
msg += 'role="form"';
|
||||
msg += ' style="margin-bottom: 0px">';
|
||||
msg += 'Password Required: ';
|
||||
msg += '<input type=password size=10 id="password_input" class="noVNC_status">';
|
||||
msg += '<\/form>';
|
||||
$D('noVNC_status_bar').setAttribute("class", "noVNC_status_warn");
|
||||
$D('noVNC_status').innerHTML = msg;
|
||||
}
|
||||
function setPassword() {
|
||||
rfb.sendPassword($D('password_input').value);
|
||||
return false;
|
||||
}
|
||||
function sendCtrlAltDel() {
|
||||
rfb.sendCtrlAltDel();
|
||||
return false;
|
||||
}
|
||||
|
||||
// dirty fix for keyboard on iOS devices
|
||||
function showKeyboard() {
|
||||
var kbi, skb, l;
|
||||
kbi = $D('keyboardinput');
|
||||
skb = $D('showKeyboard');
|
||||
l = kbi.value.length;
|
||||
if (keyboardVisible === false) {
|
||||
kbi.focus();
|
||||
try {
|
||||
kbi.setSelectionRange(l, l);
|
||||
} // Move the caret to the end
|
||||
catch (err) {
|
||||
} // setSelectionRange is undefined in Google Chrome
|
||||
keyboardVisible = true;
|
||||
//skb.className = "noVNC_status_button_selected";
|
||||
} else if (keyboardVisible === true) {
|
||||
kbi.blur();
|
||||
//skb.className = "noVNC_status_button";
|
||||
keyboardVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
function updateState(rfb, state, oldstate, msg) {
|
||||
var s, sb, cad, level;
|
||||
s = $D('noVNC_status');
|
||||
sb = $D('noVNC_status_bar');
|
||||
cad = $D('sendCtrlAltDelButton');
|
||||
switch (state) {
|
||||
case 'failed':
|
||||
level = "error";
|
||||
break;
|
||||
case 'fatal':
|
||||
level = "error";
|
||||
break;
|
||||
case 'normal':
|
||||
level = "normal";
|
||||
break;
|
||||
case 'disconnected':
|
||||
level = "normal";
|
||||
break;
|
||||
case 'loaded':
|
||||
level = "normal";
|
||||
break;
|
||||
default:
|
||||
level = "warn";
|
||||
break;
|
||||
}
|
||||
|
||||
if (state === "normal") {
|
||||
cad.disabled = false;
|
||||
}
|
||||
else {
|
||||
cad.disabled = true;
|
||||
}
|
||||
|
||||
if (typeof(msg) !== 'undefined') {
|
||||
sb.setAttribute("class", "noVNC_status_" + level);
|
||||
s.innerHTML = msg;
|
||||
}
|
||||
}
|
||||
|
||||
window.onscriptsload = function () {
|
||||
var host, port, password, path, token;
|
||||
|
||||
$D('sendCtrlAltDelButton').style.display = "inline";
|
||||
$D('sendCtrlAltDelButton').onclick = sendCtrlAltDel;
|
||||
|
||||
// dirty fix for keyboard on iOS devices
|
||||
if (isTouchDevice) {
|
||||
$D('showKeyboard').onclick = showKeyboard;
|
||||
// Remove the address bar
|
||||
setTimeout(function () {
|
||||
window.scrollTo(0, 1);
|
||||
}, 100);
|
||||
} else {
|
||||
$D('showKeyboard').style.display = "none";
|
||||
}
|
||||
|
||||
WebUtil.init_logging(WebUtil.getQueryVar('logging', 'warn'));
|
||||
document.title = unescape(WebUtil.getQueryVar('title', 'noVNC'));
|
||||
// By default, use the host and port of server that served this file
|
||||
host = '{{ ws_host }}';
|
||||
port = '{{ ws_port }}';
|
||||
password = '{{ console_passwd }}';
|
||||
|
||||
if ((!host) || (!port)) {
|
||||
updateState('failed',
|
||||
"Must specify host and port in URL");
|
||||
return;
|
||||
}
|
||||
|
||||
rfb = new RFB({'target': $D('noVNC_canvas'),
|
||||
'encrypt': WebUtil.getQueryVar('encrypt',
|
||||
(window.location.protocol === "https:")),
|
||||
'repeaterID': WebUtil.getQueryVar('repeaterID', ''),
|
||||
'true_color': WebUtil.getQueryVar('true_color', true),
|
||||
'local_cursor': WebUtil.getQueryVar('cursor', true),
|
||||
'shared': WebUtil.getQueryVar('shared', true),
|
||||
'view_only': WebUtil.getQueryVar('view_only', false),
|
||||
'updateState': updateState,
|
||||
'onPasswordRequired': passwordRequired});
|
||||
rfb.connect(host, port, password, path);
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,65 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#addFlavor" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Flavor -->
|
||||
<div class="modal fade" id="addFlavor" tabindex="-1" role="dialog" aria-labelledby="addFlavorLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add New Flavor" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="label" class="form-control" placeholder="Micro" maxlength="20"
|
||||
required pattern="[a-zA-Z0-9]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VCPU" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="vcpu" value="1" maxlength="1" required
|
||||
pattern="[0-9]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "RAM" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="memory" value="512" maxlength="5" required
|
||||
pattern="[0-9]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "MB" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "HDD" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="disk" value="10" maxlength="3" required
|
||||
pattern="[0-9]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "GB" %}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="create_flavor">
|
||||
{% trans "Add" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,418 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% load static %}
|
||||
{% block title %}{% trans "Create new instance" %}{% endblock %}
|
||||
{% block style %}
|
||||
<link href="{% static "css/bootstrap-multiselect.css" %}" rel="stylesheet">
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'create/create_flav_block.html' %}
|
||||
<h1 class="page-header">{% trans "New instance on" %} {{ compute.name }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<p>
|
||||
<a class="btn btn-success" data-toggle="collapse" href="#addCustom" aria-expanded="false" aria-controls="addCustom">
|
||||
{% trans "Custom" %}
|
||||
</a>
|
||||
<a class="btn btn-success" data-toggle="collapse" href="#addFromTemp" aria-expanded="false" aria-controls="addFromTemp">
|
||||
{% trans "Template" %}
|
||||
</a>
|
||||
<a class="btn btn-success" data-toggle="collapse" href="#addFromXML" aria-expanded="false" aria-controls="addFromXML">
|
||||
{% trans "XML" %}
|
||||
</a>
|
||||
</p>
|
||||
<div class="collapse" id="addCustom">
|
||||
<div class="well">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="{% trans "Name" %}" maxlength="14" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VCPU" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="vcpu" value="1" maxlength="1" required pattern="[0-9]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Host-Model" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="host_model" value="true" checked>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "CPU" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "RAM" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="memory" value="512" maxlength="5" required pattern="[0-9]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "MB" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "HDD" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<ul id="img-list">
|
||||
<!-- populated from javascript -->
|
||||
</ul>
|
||||
<input id="images" name="images" type="hidden" value=""/>
|
||||
<select id="image-control" name="image-control" class="form-control" multiple="multiple">
|
||||
{% if get_images %}
|
||||
{% for name in get_images %}
|
||||
<option value="{{ name }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<option value="">{% trans "None" %}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Network" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<ul id="net-list">
|
||||
<!-- populated from javascript -->
|
||||
</ul>
|
||||
<input id="networks" type="hidden" name="networks" value=""/>
|
||||
<select id="network-control" name="network-control" class="form-control" multiple="multiple">
|
||||
{% for network in networks %}
|
||||
<option value="{{ network }}">{{ network }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VirtIO" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="virtio" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
{% if storages %}
|
||||
<button type="submit" class="btn btn-primary" name="create" value="1">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="btn btn-primary disabled">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="addFromTemp">
|
||||
<div class="well">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="{% trans "Name" %}" maxlength="14" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VCPU" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="vcpu" value="1" maxlength="1" required pattern="[0-9]">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Host-Model" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="host_model" value="true" checked>
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "CPU" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "RAM" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="memory" value="512" maxlength="5" required pattern="[0-9]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "MB" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "HDD" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="template" class="form-control">
|
||||
{% if get_images %}
|
||||
{% for name in get_images %}
|
||||
<option value="{{ name }}">{{ name }}</option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<option value="">{% trans "None" %}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group meta-prealloc">
|
||||
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="meta_prealloc" title="Metadata preallocation" value="true">
|
||||
</div>
|
||||
<label class="col-lg-1 control-label">{% trans "Image" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Network" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="networks" class="form-control">
|
||||
{% for network in networks %}
|
||||
<option value="{{ network }}">{{ network }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VirtIO" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="virtio" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
{% if storages %}
|
||||
<button type="submit" class="btn btn-primary" name="create" value="1">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="btn btn-primary disabled">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse" id="addFromXML">
|
||||
<div class="well">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="col-sm-12" id="xmlheight">
|
||||
<textarea id="editor" name="from_xml"></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" name="create_xml">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{% if not flavors %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Flavors" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-lg-12">
|
||||
<h3 class="page-header">{% trans "Create from flover" %}</h3>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "VCPU's" %}</th>
|
||||
<th>{% trans "RAM" %}</th>
|
||||
<th>{% trans "HDD" %}</th>
|
||||
<th colspan="2">{% trans "Action" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for flavor in flavors %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ flavor.label }}</td>
|
||||
<td>{{ flavor.vcpu }}</td>
|
||||
<td>{{ flavor.memory }} {% trans "MB" %}</td>
|
||||
<td>{{ flavor.disk }} {% trans "GB" %}</td>
|
||||
<td style="width:5px;">
|
||||
<div class="modal fade" id="addVMflavor{{ forloop.counter }}" tabindex="-1" role="dialog" aria-labelledby="addVMFlavorLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Create Virtual Machine" %} ({{ flavor.label }})</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name"
|
||||
placeholder="{% trans "Name" %}" maxlength="14" required
|
||||
pattern="[a-zA-Z0-9\.\-_]+">
|
||||
<input type="hidden" name="vcpu" value="{{ flavor.vcpu }}">
|
||||
<input type="hidden" name="memory" value="{{ flavor.memory }}">
|
||||
<input type="hidden" name="hdd_size" value="{{ flavor.disk }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Storage" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<select name="storage" class="form-control">
|
||||
{% if storages %}
|
||||
{% for storage in storages %}
|
||||
<option value="{{ storage }}">{{ storage }}</option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<option value="">{% trans "None" %}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group meta-prealloc">
|
||||
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="meta_prealloc" title="Metadata preallocation" value="true">
|
||||
</div>
|
||||
<label class="col-lg-1 control-label">{% trans "Image" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Network" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="networks" class="form-control">
|
||||
{% for network in networks %}
|
||||
<option value="{{ network }}">{{ network }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "MAC" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="mac" maxlength="17" value="{{ mac_auto }}" required pattern="[a-zA-Z0-9:]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Host-Model" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="host_model" value="true" checked>
|
||||
</div>
|
||||
<label class="col-lg-1 control-label">{% trans "CPU" %}</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "VirtIO" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="virtio" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
{% if storages %}
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
{% else %}
|
||||
<button class="btn btn-primary disabled">{% trans "Create" %}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a data-toggle="modal" href="#addVMflavor{{ forloop.counter }}" class="btn btn-sm btn-default">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
</td>
|
||||
<td style="width:5px;">
|
||||
<form class="form-horizontal" action="" method="post" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="flavor" value="{{ flavor.id }}">
|
||||
<button type="submit" class="btn btn-sm btn-default" name="delete_flavor" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script src="{% static "js/bootstrap-multiselect.js" %}"></script>
|
||||
<script>
|
||||
function toggleValue(string, updated_value, checked) {
|
||||
var result = '';
|
||||
if (checked) {
|
||||
result = string;
|
||||
if (result != '') result += ',';
|
||||
result += updated_value;
|
||||
} else {
|
||||
$.each(string.split(','), function (index, value) {
|
||||
if (value == updated_value) return;
|
||||
if (result != '') result += ',';
|
||||
result += value;
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#image-control').multiselect({
|
||||
buttonText: function (options, select) {
|
||||
return 'Add image <b class="caret"></b>';
|
||||
},
|
||||
buttonTitle: function (options, select) {
|
||||
return '';
|
||||
},
|
||||
onChange: function (element, checked) {
|
||||
var input_value = toggleValue($('#images').val(), element.val(), checked);
|
||||
$('#images').val(input_value);
|
||||
var selected_list_html = '';
|
||||
var counter = 0;
|
||||
if (input_value != '') {
|
||||
$.each(input_value.split(','), function (index, value) {
|
||||
var li = '<li>hdd' + counter +
|
||||
' -> ' + value + ' ' +
|
||||
'<a class="btn-link" onclick="javascript:$(\'#image-control\').multiselect(\'deselect\', \'' + value + '\')">x</a></li>';
|
||||
selected_list_html += li;
|
||||
counter++;
|
||||
});
|
||||
}
|
||||
$('#img-list').html(selected_list_html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#network-control').multiselect({
|
||||
buttonText: function (options, select) {
|
||||
return 'Add network <b class="caret"></b>';
|
||||
},
|
||||
buttonTitle: function (options, select) {
|
||||
return '';
|
||||
},
|
||||
onChange: function (element, checked) {
|
||||
var input_value = toggleValue($('#networks').val(), element.val(), checked);
|
||||
$('#networks').val(input_value);
|
||||
var selected_list_html = '';
|
||||
var counter = 0;
|
||||
if (input_value != '') {
|
||||
$.each(input_value.split(','), function (index, value) {
|
||||
var li = '<li>eth' + counter +
|
||||
' -> ' + value + ' ' +
|
||||
'<a class="btn-link" onclick="javascript:$(\'#network-control\').multiselect(\'deselect\', \'' + value + '\')">x</a></li>';
|
||||
selected_list_html += li;
|
||||
counter++;
|
||||
});
|
||||
}
|
||||
$('#net-list').html(selected_list_html);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="{{ STATIC_URL }}/js/ace.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script>
|
||||
var editor = ace.edit("editor");
|
||||
editor.getSession().setMode("ace/mode/xml");
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,40 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddInstance" type="button" class="btn btn-success btn-header pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal pool -->
|
||||
<div class="modal fade" id="AddInstance" tabindex="-1" role="dialog" aria-labelledby="AddNetPoolLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Chose computes for new instance" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Compute" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select class="form-control" id="compute_select">
|
||||
{% for compute in computes %}
|
||||
<option value="{{ compute.id }}">{{ compute.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="chose" onclick='goto_compute()'>
|
||||
{% trans "Chose" %}
|
||||
</button>
|
||||
</div>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
File diff suppressed because it is too large
Load diff
|
@ -1,245 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Instances" %}{% endblock %}
|
||||
{% block style %}
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}/css/sortable-theme-bootstrap.css" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'instances/create_inst_block.html' %}
|
||||
<div class="pull-right search">
|
||||
<input id="filter" class="form-control" type="text" placeholder="Search">
|
||||
</div>
|
||||
<h1 class="page-header">{% trans "Instances" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="table-responsive">
|
||||
{% if request.user.is_superuser %}
|
||||
{% if not all_host_vms %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instace" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<table class="table table-hover table-striped sortable-theme-bootstrap" data-sortable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Host</th>
|
||||
<th>Status</th>
|
||||
<th>VCPU</th>
|
||||
<th>Memory</th>
|
||||
<th data-sortable="false" style="width:205px;">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
{% for host, inst in all_host_vms.items %}
|
||||
{% for vm, info in inst.items %}
|
||||
<tr>
|
||||
<td><a href="{% url 'instance' host.0 vm %}">{{ vm }}</a></td>
|
||||
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a></td>
|
||||
<td>{% ifequal info.status 1 %}
|
||||
<span class="text-success">{% trans "Active" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal info.status 5 %}
|
||||
<span class="text-danger">{% trans "Off" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal info.status 3 %}
|
||||
<span class="text-warning">{% trans "Suspend" %}</span>
|
||||
{% endifequal %}
|
||||
</td>
|
||||
<td>{{ info.vcpu }}</td>
|
||||
<td>{{ info.memory }} {% trans "MB" %}</td>
|
||||
<td><form action="" method="post" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="name" value="{{ vm }}"/>
|
||||
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
||||
{% ifequal info.status 5 %}
|
||||
<button class="btn btn-sm btn-default" type="submit" name="poweron" title="{% trans "Power On" %}">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Suspend" %}">
|
||||
<span class="glyphicon glyphicon-pause"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Cycle" %}">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "VNC Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal info.status 3 %}
|
||||
<button class="btn btn-sm btn-default" type="submit" name="resume" title="{% trans "Resume" %}">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Suspend" %}">
|
||||
<span class="glyphicon glyphicon-pause"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Cycle" %}">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "VNC Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal info.status 1 %}
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power On" %}">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default" type="submit" name="suspend" title="{% trans "Suspend" %}">
|
||||
<span class="glyphicon glyphicon-pause"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default" type="submit" name="poweroff" title="{% trans "Power Off" %}" onclick="return confirm('Are you sure?')">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default" type="submit" name="powercycle" title="{% trans "Power Cycle" %}" onclick="return confirm('Are you sure?')">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<a href="#" class="btn btn-sm btn-default" onclick='open_console("{{ host.0 }}-{{ info.uuid }}")' title="{% trans "Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</a>
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if not all_user_vms %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Instace" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<table class="table table-hover table-striped sortable-theme-bootstrap" data-sortable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>VCPU</th>
|
||||
<th>Memory</th>
|
||||
<th data-sortable="false" style="width: 165px;">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
{% for inst, vm in all_user_vms.items %}
|
||||
<tr>
|
||||
<td><a href="{% url 'instance' vm.compute_id vm.name %}">{{ vm.name }}</a></td>
|
||||
<td>{% ifequal vm.status 1 %}
|
||||
<span class="text-success">{% trans "Active" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 5 %}
|
||||
<span class="text-danger">{% trans "Off" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 3 %}
|
||||
<span class="text-warning">{% trans "Suspend" %}</span>
|
||||
{% endifequal %}
|
||||
</td>
|
||||
<td>{{ vm.vcpu }}</td>
|
||||
<td>{{ vm.memory }} {% trans "MB" %}</td>
|
||||
<td><form action="" method="post" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="name" value="{{ vm.name }}"/>
|
||||
<input type="hidden" name="compute_id" value="{{ vm.compute_id }}"/>
|
||||
{% ifequal vm.status 5 %}
|
||||
<button class="btn btn-sm btn-default" type="submit" name="poweron" title="Power On">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Cycle" %}">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "VNC Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 3 %}
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power On" %}">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Cycle" %}">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "VNC Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 1 %}
|
||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power On" %}">
|
||||
<span class="glyphicon glyphicon-play"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default" type="submit" name="poweroff" title="{% trans "Power Off" %}">
|
||||
<span class="glyphicon glyphicon-off"></span>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-default" type="submit" name="powercycle" title="{% trans "Power Cycle" %}" onclick="return confirm('Are you sure?')">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</button>
|
||||
<a href="#" class="btn btn-sm btn-default" onclick='open_console("{{ host.0 }}-{{ vm.uuid }}")' title="{% trans "Console" %}">
|
||||
<span class="glyphicon glyphicon-eye-open"></span>
|
||||
</a>
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script src="{{ STATIC_URL }}js/sortable.min.js"></script>
|
||||
<script>
|
||||
function open_console(uuid) {
|
||||
window.open("{% url 'console' %}?token=" + uuid, "", "width=850,height=485");
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
(function ($) {
|
||||
$('#filter').keyup(function () {
|
||||
var rex = new RegExp($(this).val(), 'i');
|
||||
$('.searchable tr').hide();
|
||||
$('.searchable tr').filter(function () {
|
||||
return rex.test($(this).text());
|
||||
}).show();
|
||||
})
|
||||
}(jQuery));
|
||||
});
|
||||
</script>
|
||||
{% if request.user.is_superuser %}
|
||||
<script>
|
||||
function goto_compute() {
|
||||
var compute = $("#compute_select").val();
|
||||
window.location = "/create/" + compute + "/";
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -1,143 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddInterface" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Secret -->
|
||||
<div class="modal fade" id="AddInterface" tabindex="-1" role="dialog" aria-labelledby="AddInterface" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Create New Interface" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="name" class="form-control" placeholder="br0" maxlength="10" required pattern="[a-z0-9\. ]+"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Start mode" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="start_mode" class="form-control">
|
||||
<option value="none">{% trans "none" %}</option>
|
||||
<option value="onboot">{% trans "onboot" %}</option>
|
||||
<option value="hotplug">{% trans "hotplug" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Device" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="netdev" class="form-control">
|
||||
{% for dev in netdevs %}
|
||||
<option value="{{ dev }}">{{ dev }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="itype" class="form-control" id="itype">
|
||||
<option value="bridge">{% trans "bridge" %}</option>
|
||||
<option value="ethernet">{% trans "ethernet" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "STP" %}</label>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<select name="stp" class="form-control">
|
||||
<option value="on">{% trans "on" %}</option>
|
||||
<option value="off">{% trans "off" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "Delay" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="delay" class="form-control" value="0" maxlength="3" required pattern="[0-9]+"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#1" data-toggle="tab">{% trans "IPv4" %}</a>
|
||||
</li>
|
||||
<li><a href="#2" data-toggle="tab">{% trans "IPv6" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="1">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv4 Mode" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="ipv4_type" class="form-control" id="ipv4">
|
||||
<option value="dhcp">{% trans "DHCP" %}</option>
|
||||
<option value="static">{% trans "Static" %}</option>
|
||||
<option value="none">{% trans "No configuration" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group static_ipv4_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv4 Address" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ipv4_addr" maxlength="19" pattern="[0-9\.\/]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group static_ipv4_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv4 Gateway" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ipv4_gw" maxlength="16" pattern="[0-9\.]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="2">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv6 Mode" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="ipv6_type" class="form-control" id="ipv6">
|
||||
<option value="none">{% trans "No configuration" %}</option>
|
||||
<option value="dhcp">{% trans "DHCP" %}</option>
|
||||
<option value="static">{% trans "Static" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group static_ipv6_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv6 Address" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ipv6_addr" maxlength="100" pattern="[0-9a-f\:\/]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group static_ipv6_form_group">
|
||||
<label class="col-sm-3 control-label">{% trans "IPv6 Gateway" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ipv6_gw" maxlength="100" pattern="[0-9a-f\:]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,67 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Interface" %} - {{ iface }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">{% trans "Interface:" %} {{ iface }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<p>{% trans "Interface:" %}</p>
|
||||
<p>{% trans "IPv4:" %} ({% ifequal ipv4 None %}None{% else %}{{ ipv4_type }}{% endifequal %})</p>
|
||||
<p>{% trans "IPv6:" %} ({% ifequal ipv6 None %}None{% else %}{{ ipv6_type }}{% endifequal %})</p>
|
||||
<p>{% trans "MAC Adress:" %}</p>
|
||||
<p>{% trans "Interface Type:" %}</p>
|
||||
{% ifequal itype 'bridge' %}
|
||||
<p>{% trans "Bridge device" %}</p>
|
||||
{% endifequal %}
|
||||
<p>{% trans "Boot Mode:" %}</p>
|
||||
<p>{% trans "State:" %}</p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
<p><strong>{{ iface }}</strong></p>
|
||||
<p>{{ ipv4 }}</p>
|
||||
<p>{{ ipv6 }}</p>
|
||||
<p>{{ mac }}</p>
|
||||
<p>{{ itype }}</p>
|
||||
{% ifequal itype 'bridge' %}
|
||||
<p>{{ bridge }}</p>
|
||||
{% endifequal %}
|
||||
<p>{{ start_mode }}</p>
|
||||
<p>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
{% ifequal state 0 %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="start" value="{% trans "Start" %}">
|
||||
<input type="submit" class="btn btn-xs btn-default" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% else %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,93 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Interfaces" %} - {{ compute.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'interfaces/create_iface_block.html' %}
|
||||
<h1 class="page-header">{{ compute.name }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> {% trans "Interfaces" %}
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if not ifaces_all %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Interfaces" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% for iface in ifaces_all %}
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="panel {% ifequal iface.state 1 %}panel-success{% else %}panel-danger{% endifequal %} panel-data">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><a href="{% url 'interface' compute.id iface.name %}">{{ iface.name }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-4">
|
||||
<p><strong>{% trans "Type:" %}</strong></p>
|
||||
<p><strong>{% trans "MAC:" %}</strong></p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-7">
|
||||
<p>{{ iface.type }}</p>
|
||||
<p>{{ iface.mac }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#itype').change(function (eventObject) {
|
||||
if ($(this).val() == 'bridge') {
|
||||
$('.bridge_name_form_group').show();
|
||||
} else {
|
||||
$('.bridge_name_form_group').hide();
|
||||
}
|
||||
}).change();
|
||||
$('#ipv4').change(function (eventObject) {
|
||||
if ($(this).val() == 'static') {
|
||||
$('.static_ipv4_form_group').show();
|
||||
} else {
|
||||
$('.static_ipv4_form_group').hide();
|
||||
}
|
||||
}).change();
|
||||
$('#ipv6').change(function (eventObject) {
|
||||
if ($(this).val() == 'static') {
|
||||
$('.static_ipv6_form_group').show();
|
||||
} else {
|
||||
$('.static_ipv6_form_group').hide();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,52 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Logs" %}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">{% trans "Logs" %}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if not logs %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "You don't have any Logs" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>{% trans "User" %}</th>
|
||||
<th>{% trans "Instance" %}</th>
|
||||
<th>{% trans "Message" %}</th>
|
||||
<th>{% trans "Date" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for log in logs %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td><a href="{% url 'account' log.user.id %}">{{ log.user }}</a></td>
|
||||
<td><a href="{% url 'instance' log.instance.compute.id log.instance %}">{{ log.instance }}</a></td>
|
||||
<td>{{ log.message }}</td>
|
||||
<td style="width:120px;">{{ log.date|date:"M d H:i:s" }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -1,73 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddNetPool" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal pool -->
|
||||
<div class="modal fade" id="AddNetPool" tabindex="-1" role="dialog" aria-labelledby="AddNetPoolLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add New Network" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="default" required pattern="[a-zA-Z0-9_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-4 control-label">{% trans "Subnet pool" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="subnet" value="192.168.100.0/24" required pattern="[0-9\/\.]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-4 control-label">{% trans "DHCP" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="dhcp" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group_dhcp">
|
||||
<label class="col-sm-4 control-label">{% trans "Fixed Address" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="fixed" value="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">{% trans "Type forwarding" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="forward_select" class="form-control" name="forward">
|
||||
<option value="nat">{% trans "NAT" %}</option>
|
||||
<option value="route">{% trans "ROUTE" %}</option>
|
||||
<option value="none">{% trans "ISOLATE" %}</option>
|
||||
<option value="bridge">{% trans "BRIDGE" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group">
|
||||
<label class="col-sm-4 control-label">{% trans "Bridge Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="bridge_name" placeholder="br0" pattern="[a-z0-9\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group bridge_name_form_group">
|
||||
<label class="col-sm-4 control-label">{% trans "Open vSwitch" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="openvswitch" value="true">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,187 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Network" %} - {{ pool }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header">{% trans "Network:" %} {{ pool }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<p>{% trans "Network name:" %}</p>
|
||||
<p>{% trans "Device:" %}</p>
|
||||
<p>{% trans "State" %}</p>
|
||||
<p>{% trans "Autostart" %}</p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
<p>{{ pool }}</p>
|
||||
<p>{{ device }}</p>
|
||||
<p>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
{% ifequal state 0 %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="start" value="{% trans "Start" %}">
|
||||
<input type="submit" class="btn btn-xs btn-default" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% else %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
{% ifequal autostart 0 %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="set_autostart" value="{% trans "Enable" %}">
|
||||
{% else %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="unset_autostart" onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% if state %}
|
||||
<div class="row">
|
||||
<h3 class="page-header">{% trans "IPv4 configuration" %}</h3>
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<p>{% trans "IPv4 Forwarding:" %}</p>
|
||||
<p>{% trans "Network:" %}</p>
|
||||
<p>{% trans "DHCP:" %}</p>
|
||||
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
|
||||
<p>{% trans "Start:" %}</p>
|
||||
<p>{% trans "End:" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<p>
|
||||
{% ifequal ipv4_forward.0 'nat' %}
|
||||
{% trans "NAT" %}
|
||||
{% endifequal %}
|
||||
{% ifequal ipv4_forward.0 'route' %}
|
||||
{% trans "ROUTE" %}
|
||||
{% endifequal %}
|
||||
{% ifequal ipv4_forward.0 'bridge' %}
|
||||
{% trans "BRIDGE" %}
|
||||
{% endifequal %}
|
||||
{% if not ipv4_forward.0 %}
|
||||
{% trans "ISOLATE" %}
|
||||
{% endif %}
|
||||
</p>
|
||||
<p>{{ ipv4_network }}</p>
|
||||
<p>
|
||||
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
|
||||
<span class="text-success">{% trans "ON" %}</span>
|
||||
{% else %}
|
||||
<span class="text-danger">{% trans "OFF" %}</span>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
|
||||
<p>{{ ipv4_dhcp_range_start }}</p>
|
||||
<p>{{ ipv4_dhcp_range_end }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if fixed_address %}
|
||||
<div class="row">
|
||||
<h3 class="page-header">{% trans "Fixed Address" %}</h3>
|
||||
<div class="col-xs-12">
|
||||
<div class="panel-group" id="accordion">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
|
||||
Show
|
||||
</a>
|
||||
</div>
|
||||
<div id="collapseOne" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="input-append form-inline pull-right" style="">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" id="filter_input">
|
||||
</div>
|
||||
<input type="button" class="btn btn-default" id="filter_button" value="Filter">
|
||||
<button type="button" class="btn btn-default" id="filter_clear">Clear</button>
|
||||
</div>
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align: center">{% trans "Address" %}</th>
|
||||
<th style="text-align: center">{% trans "MAC" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody style="text-align: center">
|
||||
{% for fix in fixed_address %}
|
||||
<tr>
|
||||
<td>{{ fix.host }}</td>
|
||||
<td>{{ fix.mac }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script>
|
||||
$.expr[':'].Contains = $.expr.createPseudo(function (arg) {
|
||||
return function (elem) {
|
||||
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
|
||||
};
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
// add event button labeled "filter"
|
||||
$('#filter_button').click(function (event) {
|
||||
// get value
|
||||
var filter_val = $('#filter_input').val();
|
||||
if (filter_val == '') {
|
||||
// show all
|
||||
$('tbody tr').show();
|
||||
} else {
|
||||
// show only matches
|
||||
$('tbody tr:Contains(\'' + filter_val + '\')').show();
|
||||
// hide non-matching items
|
||||
$('tbody tr:not(:Contains(\'' + filter_val + '\'))').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// add event button labeled "clear"
|
||||
$('#filter_clear').click(function (event) {
|
||||
$('#filter_input').val('');
|
||||
$('#filter_button').click();
|
||||
});
|
||||
|
||||
// trigger filter when enter key pressed
|
||||
$('#filter_input').keyup(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
$('#filter_button').click();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,80 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Networks" %} - {{ compute.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'networks/create_net_block.html' %}
|
||||
<h1 class="page-header">{{ compute.name }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> {% trans "Networks" %}
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if not networks %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Networks" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% for pool in networks %}
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="panel {% if pool.status %}panel-success{% else %}panel-danger{% endif %} panel-data">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><a href="{% url 'network' compute.id pool.name %}">{{ pool.name }}</a></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-4">
|
||||
<p><strong>{% trans "Device:" %}</strong></p>
|
||||
<p><strong>{% trans "Forward:" %}</strong></p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-7">
|
||||
<p>{{ pool.device }}</p>
|
||||
<p>{{ pool.forward|upper }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#forward_select').change(function (eventObject) {
|
||||
if ($(this).val() == 'bridge') {
|
||||
$('.bridge_name_form_group').show();
|
||||
$('.bridge_name_form_group_dhcp').hide();
|
||||
} else {
|
||||
$('.bridge_name_form_group').hide();
|
||||
$('.bridge_name_form_group_dhcp').show();
|
||||
}
|
||||
}).change();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,60 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddSecret" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Secret -->
|
||||
<div class="modal fade" id="AddSecret" tabindex="-1" role="dialog" aria-labelledby="AddSecret" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Create New Secret" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Ephemeral" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="ephemeral" class="form-control">
|
||||
<option value="no">{% trans "no" %}</option>
|
||||
<option value="yes">{% trans "yes" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Private" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="private" class="form-control">
|
||||
<option value="no">{% trans "no" %}</option>
|
||||
<option value="yes">{% trans "yes" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Usage" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="usage_type" class="form-control">
|
||||
<option value="ceph">{% trans "ceph" %}</option>
|
||||
<option value="volume">{% trans "volume" %}</option>
|
||||
<option value="iscsi">{% trans "iscsi" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Data" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="data" class="form-control" value="" required pattern="[a-z0-9\. ]+"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,121 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Secrets" %} - {{ compute.name }}{% endblock %}
|
||||
{% block style %}
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}/css/sortable-theme-bootstrap.css" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'secrets/create_secret_block.html' %}
|
||||
<h1 class="page-header">{% trans "Secrets" %}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> {% trans "Secrets" %}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if not secrets_all %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Secrets" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-lg-12">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
|
||||
<thead>
|
||||
<tr class="active">
|
||||
<th>{% trans "UUID" %}</th>
|
||||
<th>{% trans "Type" %}</th>
|
||||
<th>{% trans "Usage" %}</th>
|
||||
<th data-sortable="false" style="width:90px;">{% trans "Action" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for secret in secrets_all %}
|
||||
<tr>
|
||||
<td>{{ secret.uuid }}</td>
|
||||
<td>{% ifequal secret.usageType 0 %}
|
||||
{% trans "volume" %}
|
||||
{% endifequal %}
|
||||
{% ifequal secret.usageType 1 %}
|
||||
{% trans "iscsi" %}
|
||||
{% endifequal %}
|
||||
{% ifequal secret.usageType 2 %}
|
||||
{% trans "ceph" %}
|
||||
{% endifequal %}
|
||||
</td>
|
||||
<td>{{ secret.usage }}</td>
|
||||
<td>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="uuid" value="{{ secret.uuid }}"/>
|
||||
<a data-toggle="modal" href="#editSecret{{ secret.uuid }}" class="btn btn-sm btn-default" title="{% trans "Edit" %}">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
</a>
|
||||
<button type="submit" class="btn btn-sm btn-default" name="delete" title="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="editSecret{{ secret.uuid }}" tabindex="-1" role="dialog"
|
||||
aria-labelledby="editSecret" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Set secret value" %}</h4>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Value" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="hidden" name="uuid" value="{{ secret.uuid }}">
|
||||
<input type="text" name="value" class="form-control" value="{{ secret.value }}" maxlength="45" required pattern="[a-zA-Z0-9]$+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="set_value">{% trans "Set" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script src="{{ STATIC_URL }}/js/sortable.min.js"></script>
|
||||
{% endblock %}
|
|
@ -1,238 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
<a href="#AddStgPool" type="button" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Storage pool -->
|
||||
<div class="modal fade" id="AddStgPool" tabindex="-1" role="dialog" aria-labelledby="AddStgPoolLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Create Storage Pool" %}</h4>
|
||||
</div>
|
||||
<div class="tabbable">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#1" data-toggle="tab">{% trans "DIR" %}</a>
|
||||
</li>
|
||||
<li><a href="#2" data-toggle="tab">{% trans "LVM" %}</a></li>
|
||||
<li><a href="#3" data-toggle="tab">{% trans "CEPH" %}</a></li>
|
||||
<li><a href="#4" data-toggle="tab">{% trans "NETFS" %}</a></li>
|
||||
<li><a href="#5" data-toggle="tab">{% trans "ISO" %}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="1">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="stg_type" value="dir" disabled>
|
||||
<input type="hidden" name="stg_type" value="dir">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" name="target" class="form-control" value="/var/lib/libvirt/images" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="2">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="stg_type" value="logical" disabled>
|
||||
<input type="hidden" name="stg_type" value="logical">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="default" maxlength="20" required pattern="[a-zA-Z0-9\.\-\_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Device" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="source" value="/dev/sdb" required pattern="[a-z0-9\/]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="3">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="stg_type" value="rbd" disabled>
|
||||
<input type="hidden" name="stg_type" value="rbd">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="rbdpool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Ceph User" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ceph_user" placeholder="libvirt" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Ceph Pool" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ceph_pool" placeholder="libvirt-pool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Ceph Host" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="ceph_host" placeholder="mon0.ceph.host" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Secrets" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="secret" class="form-control">
|
||||
{% if secrets %}
|
||||
{% for secret in secrets %}
|
||||
<option value="{{ secret }}">{{ secret }}</option>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<option value="None">{% trans "None" %}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
{% if secrets %}
|
||||
<button type="submit" class="btn btn-primary" name="create">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% else %}
|
||||
<button class="btn btn-primary disabled" name="create">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="4">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Type" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="stg_type" value="netfs" disabled>
|
||||
<input type="hidden" name="stg_type" value="netfs">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="netfspool" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Hostname" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="netfs_host" placeholder="nfs.example.com" maxlength="20" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Remote Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="source" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Format" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="source_format" class="form-control" id="source_format">
|
||||
<option value="auto">{% trans "auto" %}</option>
|
||||
<option value="nfs">{% trans "nfs" %}</option>
|
||||
<option value="glusterfs">{% trans "glusterfs" %}</option>
|
||||
<option value="cifs">{% trans "cifs" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Local Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="target" placeholder="/srv/storage/" maxlength="40" required pattern="[a-zA-Z0-9\/\-_]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="tab-pane" id="5">
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" value="iso" disabled>
|
||||
<input type="hidden" name="name" value="iso">
|
||||
<input type="hidden" name="stg_type" value="dir">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Path" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="target" value="/var/www/webvirtmgr/images" required pattern="[a-zA-Z0-9\/\-\_]+">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">
|
||||
{% trans "Close" %}
|
||||
</button>
|
||||
<button type="submit" class="btn btn-primary" name="create">
|
||||
{% trans "Create" %}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endif %}
|
|
@ -1,91 +0,0 @@
|
|||
{% load i18n %}
|
||||
{% if request.user.is_superuser %}
|
||||
{% ifnotequal state 0 %}
|
||||
{% ifequal pool "iso" %}
|
||||
<a href="#IsoUpload" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Upload -->
|
||||
<div class="modal fade" id="IsoUpload" tabindex="-1" role="dialog" aria-labelledby="IsoUploadLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Upload ISO Image" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" enctype="multipart/form-data" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="file" name="file" id="id_file">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="iso_upload">{% trans "Upload" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% else %}
|
||||
<a href="#AddImage" class="btn btn-success pull-right" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
|
||||
</a>
|
||||
|
||||
<!-- Modal Image -->
|
||||
<div class="modal fade" id="AddImage" tabindex="-1" role="dialog" aria-labelledby="AddImageLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Add New Volume" %}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="{% trans "Name" %}" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">.img</label>
|
||||
</div>
|
||||
<div class="form-group" id="image_format">
|
||||
<label class="col-sm-3 control-label">{% trans "Format" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="format" class="form-control image-format">
|
||||
<option value="qcow2">{% trans "qcow2" %}</option>
|
||||
<option value="qcow">{% trans "qcow" %}</option>
|
||||
<option value="raw">{% trans "raw" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Size" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="size" value="10" maxlength="3" required pattern="[0-9]+">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">{% trans "GB" %}</label>
|
||||
</div>
|
||||
<div class="form-group meta-prealloc">
|
||||
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="meta_prealloc" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="add_volume">{% trans "Create" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% endifequal %}
|
||||
{% endifnotequal %}
|
||||
{% endif %}
|
|
@ -1,224 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Storage" %} - {{ pool }}{% endblock %}
|
||||
{% block style %}
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}css/sortable-theme-bootstrap.css" />
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'storages/create_stg_vol_block.html' %}
|
||||
<h1 class="page-header">{% trans "Storage:" %} {{ pool }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> <a href="{% url 'storages' compute.id %}">{% trans "Storages" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
<p>{% trans "Pool name:" %}</p>
|
||||
<p>{% trans "Pool type:" %}</p>
|
||||
<p>{% trans "Pool path:" %}</p>
|
||||
<p>{% trans "Pool status:" %}</p>
|
||||
<p>{% trans "Size:" %} ({{ size|filesizeformat }} / {{ used|filesizeformat }})</p>
|
||||
<p>{% trans "State:" %}</p>
|
||||
<p>{% trans "Autostart:" %}</p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6">
|
||||
<p>{{ pool }}</p>
|
||||
<p>{% if not type %}{% trans "None" %}{% else %}{{ type }}{% endif %}</p>
|
||||
<p>{% if not path %}{% trans "None" %}{% else %}{{ path }}{% endif %}</p>
|
||||
<p>{% if not status %}{% trans "None" %}{% else %}{{ status }}{% endif %}</p>
|
||||
<p>{% trans "Usage:" %} {{ percent }}%</p>
|
||||
<p>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
{% ifequal state 0 %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="start" value="{% trans "Start" %}">
|
||||
<input type="submit" class="btn btn-xs btn-default" name="delete" value="{% trans "Delete" %}"
|
||||
onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% else %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="stop" value="{% trans "Stop" %}"
|
||||
onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</p>
|
||||
<p>
|
||||
<form action="" method="post" role="form">{% csrf_token %}
|
||||
{% ifequal autostart 0 %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="set_autostart"
|
||||
value="{% trans "Enable" %}">
|
||||
{% else %}
|
||||
<input type="submit" class="btn btn-xs btn-default" name="unset_autostart"
|
||||
onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
||||
{% endifequal %}
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if state %}
|
||||
<div class="row">
|
||||
<div class="pull-right search">
|
||||
<input id="filter" class="form-control" type="text" placeholder="Search">
|
||||
</div>
|
||||
<h3 class="page-header">{% trans "Volumes" %}</h3>
|
||||
|
||||
</div>
|
||||
{% if volumes %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped sortable-theme-bootstrap" data-sortable>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 45px;">#</th>
|
||||
<th>{% trans "Name" %}</th>
|
||||
<th>{% trans "Size" %}</th>
|
||||
<th>{% trans "Format" %}</th>
|
||||
<th data-sortable="false" colspan="2">{% trans "Action" %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="searchable">
|
||||
{% for volume in volumes %}
|
||||
<tr>
|
||||
<td>{{ forloop.counter }}</td>
|
||||
<td>{{ volume.name }}</td>
|
||||
<td>{{ volume.size|filesizeformat }}</td>
|
||||
<td>{{ volume.type }}</td>
|
||||
<td style="width:30px;">
|
||||
<!-- Modal Clone -->
|
||||
<div class="modal fade" id="Clone{{ forloop.counter }}" tabindex="-1" role="dialog"
|
||||
aria-labelledby="addHostLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">{% trans "Clone image" %} <span class="text-danger">{{ volume.name }}</span></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form class="form-horizontal" method="post" role="form">{% csrf_token %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{% trans "Name" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" class="form-control" name="name" placeholder="{% trans "Name" %}" required pattern="[a-zA-Z0-9\.\-_]+">
|
||||
<input type="hidden" name="image" value="{{ volume.name }}">
|
||||
</div>
|
||||
<label class="col-sm-1 control-label">.img</label>
|
||||
</div>
|
||||
<div class="form-group" id="image_format">
|
||||
<label class="col-sm-3 control-label">{% trans "Convert" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="volume-convert" type="checkbox" name="convert" value="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group format-convert">
|
||||
<label class="col-sm-3 control-label">{% trans "Format" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="format" class="form-control image-format">
|
||||
<option value="raw">{% trans "raw" %}</option>
|
||||
<option value="qcow">{% trans "qcow" %}</option>
|
||||
<option value="qcow2">{% trans "qcow2" %}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group meta-prealloc" style="display: none;">
|
||||
<label class="col-sm-3 control-label">{% trans "Metadata" %}</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="checkbox" name="meta_prealloc" value="true" checked>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
|
||||
<button type="submit" class="btn btn-primary" name="cln_volume">{% trans "Clone" %}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- /.modal-content -->
|
||||
</div> <!-- /.modal-dialog -->
|
||||
</div> <!-- /.modal -->
|
||||
{% ifnotequal volume.type "iso" %}
|
||||
<a data-toggle="modal" href="#Clone{{ forloop.counter }}" class="btn btn-sm btn-default" title="{% trans "Clone" %}"><i class="fa fa-files-o"></i></a>
|
||||
{% else %}
|
||||
<a class="btn btn-sm btn-default disabled"><i class="fa fa-files-o"></i></a>
|
||||
{% endifnotequal %}
|
||||
</td>
|
||||
<td style="width:30px;">
|
||||
<form action="" method="post" style="height:10px" role="form">{% csrf_token %}
|
||||
<input type="hidden" name="volname" value="{{ volume.name }}">
|
||||
<button type="submit" class="btn btn-sm btn-default" name="del_volume" title="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||
<i class="fa fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Volumes" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
<script src="{{ STATIC_URL }}/js/sortable.min.js"></script>
|
||||
<script>
|
||||
$('.format-convert').hide();
|
||||
$(document).on('change', '.volume-convert', function () {
|
||||
if ($(this).prop('checked')) {
|
||||
$('.format-convert').show();
|
||||
if ($('.image-format').val() == 'qcow2') {
|
||||
$('.meta-prealloc').show();
|
||||
}
|
||||
} else {
|
||||
$('.format-convert').hide();
|
||||
$('.meta-prealloc').hide();
|
||||
}
|
||||
});
|
||||
$(document).on('change', '.image-format', function () {
|
||||
if ($(this).val() == "qcow2") {
|
||||
$('.meta-prealloc').show();
|
||||
} else {
|
||||
$('.meta-prealloc').hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
(function ($) {
|
||||
$('#filter').keyup(function () {
|
||||
var rex = new RegExp($(this).val(), 'i');
|
||||
$('.searchable tr').hide();
|
||||
$('.searchable tr').filter(function () {
|
||||
return rex.test($(this).text());
|
||||
}).show();
|
||||
})
|
||||
}(jQuery));
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
|
@ -1,67 +0,0 @@
|
|||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block title %}{% trans "Storages" %} - {{ compute.name }}{% endblock %}
|
||||
{% block content %}
|
||||
<!-- Page Heading -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% include 'storages/create_stg_block.html' %}
|
||||
<h1 class="page-header">{{ compute.name }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
<li class="active">
|
||||
<i class="fa fa-dashboard"></i> <a href="{% url 'overview' compute.id %}">{% trans "Overview" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-hdd-o"></i> {% trans "Storages" %}
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-sitemap"></i> <a href="{% url 'networks' compute.id %}">{% trans "Networks" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-wifi"></i> <a href="{% url 'interfaces' compute.id %}">{% trans "Interfaces" %}</a>
|
||||
</li>
|
||||
<li>
|
||||
<i class="fa fa-key"></i> <a href="{% url 'secrets' compute.id %}">{% trans "Secrets" %}</a>
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.row -->
|
||||
|
||||
{% include 'errors_block.html' %}
|
||||
|
||||
<div class="row">
|
||||
{% if not storages %}
|
||||
<div class="col-lg-12">
|
||||
<div class="alert alert-warning alert-dismissable">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<i class="fa fa-exclamation-triangle"></i> <strong>{% trans "Warning:" %}</strong> {% trans "Hypervisor doesn't have any Storages" %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% for pool in storages %}
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="panel {% if pool.status %}panel-success{% else %}panel-danger{% endif %} panel-data">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><a href="{% url 'storage' compute.id pool.name %}">{{ pool.name }}</a></h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-4 col-sm-4">
|
||||
<p><strong>{% trans "Type:" %}</strong></p>
|
||||
<p><strong>{% trans "Size:" %}</strong></p>
|
||||
<p><strong>{% trans "Volumes:" %}</strong></p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-7">
|
||||
<p>{{ pool.type|upper }}</p>
|
||||
<p>{{ pool.size|filesizeformat }}</p>
|
||||
<p>{{ pool.volumes }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue