2015-03-02 15:31:25 +00:00
{% extends "base.html" %}
2017-06-06 12:49:11 +00:00
{% load staticfiles %}
2015-03-02 15:31:25 +00:00
{% load i18n %}
{% block title %}{% trans "Instance" %} - {{ vname }}{% endblock %}
{% block content %}
2019-07-31 08:03:48 +00:00
{% include 'pleasewaitdialog.html' %}
<!-- Page Heading -->
2020-01-20 12:47:14 +00:00
< div >
2019-07-31 08:03:48 +00:00
< div >
2020-01-20 12:47:14 +00:00
< h3 > {{ vname }}{% if title %} ({{ title }}){% endif %}< / h3 >
2019-07-31 08:03:48 +00:00
< / div >
< div >
2020-01-20 12:47:14 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< span class = "badge badge-danger" > {% trans "Off" %}< / span >
2020-01-20 12:47:14 +00:00
{% endif %}
{% if status == 1 %}
2020-05-19 16:53:54 +00:00
< span class = "badge badge-success" > {% trans "Active" %}< / span >
2020-01-20 12:47:14 +00:00
{% endif %}
{% if status == 3 %}
2020-05-19 16:53:54 +00:00
< span class = "badge badge-warning" > {% trans "Suspend" %}< / span >
2020-01-20 12:47:14 +00:00
{% endif %}
|
2020-01-21 12:39:16 +00:00
< span { % if guest_agent = = True % }
2020-01-20 12:47:14 +00:00
{% if guest_agent_ready == True %}
2020-05-19 16:53:54 +00:00
class="badge badge-success"
2020-05-20 13:18:27 +00:00
title="{% trans "Guest Agent Enabled & Connected" %}"
2019-12-25 11:36:43 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
class="badge badge-warning"
2020-05-20 13:18:27 +00:00
title="{% trans "Guest Agent Enabled but not Connected" %}"
2020-01-20 12:47:14 +00:00
{% endif %}
{% else %}
2020-05-19 16:53:54 +00:00
class="badge badge-danger"
2020-05-20 13:18:27 +00:00
title="{% trans "Guest Agent Not Enabled & Not Connected" %}"
2020-01-21 12:39:16 +00:00
{% endif %}>< i class = "fa fa-plug" > < / i > < / span >
2020-01-20 12:47:14 +00:00
|
{% if snapshots %}
< i class = "fa fa-camera text-primary" title = "There are {{ snapshots|length }} snapshot(s)" > < / i > |
{% endif %}
{% if cur_vcpu %}
2020-05-19 16:53:54 +00:00
{{ cur_vcpu }} {% trans "VCPU" %}
2020-01-20 12:47:14 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
{{ vcpu }} {% trans "VCPU" %}
2020-01-20 12:47:14 +00:00
{% endif %}
|
2020-05-19 16:53:54 +00:00
{{ cur_memory }} {% trans "MB" %} {% trans "RAM" %}
2020-01-20 12:47:14 +00:00
|
{% for disk in disks %}
{{ disk.size|filesizeformat }} {% trans "Disk" %} |
{% endfor %}
{% for net in networks %}
{% for ipv4 in net.ipv4 %}
{{ ipv4 }} |
{% endfor %}
{% endfor %}
2020-05-20 13:18:27 +00:00
< a class = "text-secondary" href = "{% url 'instance' compute.id vname %}" title = "{% trans 'Refresh instance info' %}" > < span class = "fa fa-refresh" > < / span > < / a >
2019-07-31 08:03:48 +00:00
< / div >
{% if user_quota_msg %}
2020-05-19 16:53:54 +00:00
< div class = "alert alert-warning fade show" >
{{ user_quota_msg|capfirst }} {% trans "quota reached" %}.
< /div">
2019-07-31 08:03:48 +00:00
{% endif %}
< hr >
< / div >
2015-05-20 13:44:30 +00:00
2019-07-31 08:03:48 +00:00
{% include 'errors_block.html' %}
{% include 'messages_block.html' %}
2015-03-02 15:31:25 +00:00
2019-07-31 08:03:48 +00:00
< div class = "row" id = "max-width-page" >
2020-05-19 16:53:54 +00:00
< div class = "container" >
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-pills" id = "navbtn" aria-label = "Instance actions" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#power" class = "nav-link action-button active" aria-controls = "power" role = "tab" data-toggle = "tab" >
< i id = "action-block" class = "fa fa-power-off fa-2x" aria-hidden = "true" > < / i >
2019-07-31 08:03:48 +00:00
{% trans "Power" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#access" class = "nav-link action-button" aria-controls = "access" role = "tab" data-toggle = "tab" >
< i id = "action-block" class = "fa fa-lock" aria-hidden = "true" > < / i >
2019-07-31 08:03:48 +00:00
{% trans "Access" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#resize" class = "nav-link action-button" aria-controls = "resize" role = "tab" data-toggle = "tab" >
< span id = "action-block" class = "fa fa-expand" aria-hidden = "true" > < / span >
2019-07-31 08:03:48 +00:00
{% trans "Resize" %}
< / a >
< / li >
{% if allow_admin_or_not_template %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#snapshots" class = "nav-link action-button" aria-controls = "snapshots" role = "tab" data-toggle = "tab" >
< span id = "action-block" class = "fa fa-camera" aria-hidden = "true" > < / span >
{% trans "Snapshot" %}
< / a >
< / li >
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#settings" class = "nav-link action-button" aria-controls = "settings" role = "tab" data-toggle = "tab" >
< span id = "action-block" class = "fa fa-cog" aria-hidden = "true" > < / span >
2019-07-31 08:03:48 +00:00
{% trans "Settings" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#graphics" id = "chartgraphs" class = "nav-link action-button" aria-controls = "graphics" role = "tab" data-toggle = "tab" >
< span id = "action-block" class = "fa fa-bar-chart" aria-hidden = "true" > < / span >
2019-07-31 08:03:48 +00:00
{% trans "Stats" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a href = "#undefine" class = "nav-link action-button" aria-controls = "undefine" role = "tab" data-toggle = "tab" >
< span id = "action-block" class = "fa fa-trash" aria-hidden = "true" > < / span >
2019-07-31 08:03:48 +00:00
{% trans "Destroy" %}
< / a >
< / li >
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
< div role = "tabpanel" class = "tab-pane active" id = "power" >
2015-03-12 14:15:36 +00:00
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance power actions" >
2020-05-28 21:43:26 +00:00
{% if status == 1 %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#poweroff" aria-controls = "poweroff" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Power Off" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#powercycle" aria-controls = "powercycle" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Power Cycle" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#powerforce" aria-controls = "powerforce" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Force Off" %}
< / a >
< / li >
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#suspend" aria-controls = "suspend" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Suspend" %}
< / a >
< / li >
{% endif %}
2020-05-28 21:43:26 +00:00
{% endif %}
{% if status == 3 %}
2019-07-31 08:03:48 +00:00
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#resume" aria-controls = "resume" role = "tab" data-toggle = "tab" >
{% trans "Resume" %}
< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#powerforce" aria-controls = "powerforce" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Force Off" %}
2018-10-24 13:42:00 +00:00
< / a >
< / li >
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-28 21:43:26 +00:00
{% endif %}
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#boot" aria-controls = "boot" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Power On" %}
< / a >
< / li >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
2020-05-28 21:43:26 +00:00
{% if status == 1 %}
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "poweroff" >
< p > {% trans "This action sends an ACPI shutdown signal to the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label0 = "Power off instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "poweroff" class = "btn btn-lg btn-success float-right" value = "{% trans " Power Off " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "powercycle" >
< p > {% trans "This action forcibly powers off and start the instance and may cause data corruption." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Power cycle instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "powercycle" class = "btn btn-lg btn-success float-right" value = "{% trans " Power Cycle " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "powerforce" >
< p > {% trans "This action forcibly powers off the instance and may cause data corruption." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Force to shotdown instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "powerforce" class = "btn btn-lg btn-success float-right" value = "{% trans " Force Off " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
{% if request.user.is_superuser %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "suspend" >
< p > {% trans "This action suspends the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Suspend instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "suspend" class = "btn btn-lg btn-success float-right" value = "{% trans " Suspend " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
{% endif %}
2020-05-28 21:43:26 +00:00
{% endif %}
{% if status == 3 %}
2019-07-31 08:03:48 +00:00
{% if request.user.is_superuser %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "resume" >
< p > {% trans "This action restore the instance after suspend." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Resume instance from suspension form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "resume" class = "btn btn-lg btn-success float-right" value = "{% trans " Resume " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "powerforce" >
< p > {% trans "This action forcibly powers off the instance and may cause data corruption." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Force to shutdown form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "powerforce" class = "btn btn-lg btn-success float-right" value = "{% trans " Force Off " % } " >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
{% else %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "resume" >
< p > {% trans "Administrator blocked your instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Resume instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success disabled float-right" > {% trans "Resume" %}< / button >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
{% endif %}
2020-05-28 21:43:26 +00:00
{% endif %}
{% if status == 5 %}
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "boot" >
2020-06-10 08:15:14 +00:00
< p > {% trans "Click on Power On button to start this instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Start instance form" > {% csrf_token %}
2019-07-31 08:03:48 +00:00
{% if instance.is_template %}
< p > {% trans "Template instance cannot be started." %}< / p >
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "poweron" class = "btn btn-lg btn-success float-right disabled" value = "{% trans " Power On " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< input type = "submit" name = "poweron" class = "btn btn-lg btn-success float-right" value = "{% trans " Power On " % } " >
2018-10-24 13:42:00 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / form >
< / div >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / div >
2020-05-26 13:18:38 +00:00
< div role = "tabpanel" class = "tab-pane" id = "access" aria-label = "Instance access options" >
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" >
<!-- Nav tabs -->
< ul class = "nav nav-tabs" role = "tablist" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#vnconsole" aria-controls = "vnconsole" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Console" %}
< / a >
< / li >
2020-05-28 21:43:26 +00:00
{% if show_access_root_password == 'True' %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#rootpasswd" aria-controls = "rootpasswd" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Root Password" %}
2015-03-12 14:15:36 +00:00
< / a >
< / li >
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-28 21:43:26 +00:00
{% if show_access_ssh_keys == 'True' %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#sshkeys" aria-controls = "sshkeys" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "SSH Keys" %}
2015-03-12 14:15:36 +00:00
< / a >
< / li >
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-28 21:43:26 +00:00
{% if status == 1 %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#vdiconsole" aria-controls = "vdiconsole" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "VDI" %}
2015-03-12 14:15:36 +00:00
< / a >
< / li >
2020-05-28 21:43:26 +00:00
{% endif %}
2015-03-12 14:15:36 +00:00
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "vnconsole" >
< p > {% trans "This action opens a new window with a VNC connection to the console of the instance." %}< / p >
2020-05-28 21:43:26 +00:00
{% if status == 1 %}
2019-07-31 08:03:48 +00:00
<!-- Split button -->
2020-05-19 16:53:54 +00:00
< div class = "btn-group float-right" >
< button type = "button" id = "consoleBtnGroup" class = "btn btn-lg btn-success" onclick = "open_console('lite')" > {% trans 'Console' %}< / button >
< button type = "button" class = "btn btn-success dropdown-toggle dropdown-toggle-split" data-toggle = "dropdown" aria-haspopup = "true" aria-expanded = "false" >
2019-07-31 08:03:48 +00:00
< span class = "sr-only" > {% trans 'Toggle Dropdown' %}< / span >
< / button >
2020-05-19 16:53:54 +00:00
< div class = "dropdown-menu" >
2020-05-21 22:13:39 +00:00
< a class = "dropdown-item" href = "#" title = "{% trans " Console port " % } : { { console_port } } " onclick = "open_console('lite')" > {% trans "Console" %} - {% trans "Lite" %}< / a >
< a class = "dropdown-item" href = "#" title = "{% trans " Console port " % } : { { console_port } } " onclick = "open_console('full')" > {% trans "Console" %} - {% trans "Full" %}< / a >
2020-05-19 16:53:54 +00:00
< / div >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Console" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
2015-03-12 14:15:36 +00:00
< / div >
2020-05-28 21:43:26 +00:00
{% if show_access_root_password == 'True' %}
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "rootpasswd" >
< p > {% trans "You need shut down your instance and enter a new root password." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form-inline" method = "post" role = "form" aria-label = "Add root password to instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-12" >
2020-05-21 22:13:39 +00:00
< input type = "text" class = "form-control-lg" name = "passwd" placeholder = "{% trans " Enter Password " % } " maxlength = "24" >
2018-06-21 12:53:35 +00:00
< / div >
2015-03-12 14:15:36 +00:00
< / div >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-lg btn-success float-right" name = "rootpasswd" value = "{% trans " Reset Root Password " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Reset Root Password" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
< div class = "clearfix" > < / div >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-28 21:43:26 +00:00
{% if show_access_ssh_keys == 'True' %}
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "sshkeys" >
< p > {% trans "You need shut down your instance and choose your public key." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form-inline" method = "post" role = "form" aria-label = "Add public key to instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-12" >
2020-05-28 21:43:26 +00:00
< select name = "sshkeyid" class = "form-control-lg keyselect" >
2019-07-31 08:03:48 +00:00
{% if publickeys %}
{% for key in publickeys %}
< option value = "{{ key.id }}" > {{ key.keyname }}< / option >
2015-11-24 08:53:13 +00:00
{% endfor %}
2019-07-31 08:03:48 +00:00
{% else %}
< option value = "None" > {% trans "None" %}< / option >
{% endif %}
< / select >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-lg btn-success float-right" name = "addpublickey" value = "{% trans " Add Public Key " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Add Public Key" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
< div class = "clearfix" > < / div >
< / div >
{% endif %}
2020-05-28 21:43:26 +00:00
{% if status == 1 %}
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "vdiconsole" >
2020-05-19 16:53:54 +00:00
< p > {% trans "This action opens a remote viewer with a connection to the console of the instance." %}< / p >
2019-07-31 08:03:48 +00:00
< div class = "input-group" >
< input type = "text" class = "input-lg disabled form-control" disabled id = "vdi_url_input" / >
2020-05-19 16:53:54 +00:00
< span class = "input-group-append" >
< a href = "#" class = "btn btn-success" id = "vdi_url" > {% trans "VDI" %}< / a >
2019-07-31 08:03:48 +00:00
< / span >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
2015-03-12 14:15:36 +00:00
< / div >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "resize" >
< div role = "tabpanel" >
2019-08-27 14:18:33 +00:00
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance resize options" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#resizevm_cpu" aria-controls = "resizevm_cpu" role = "tab" data-toggle = "tab" >
2019-08-27 14:18:33 +00:00
{% trans "CPU" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#resizevm_mem" aria-controls = "resizevm_mem" role = "tab" data-toggle = "tab" >
2019-08-27 14:18:33 +00:00
{% trans "Memory" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#resizevm_disk" aria-controls = "resizevm_disk" role = "tab" data-toggle = "tab" >
2019-08-27 14:18:33 +00:00
{% trans "Disk" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< / li >
2019-08-27 14:18:33 +00:00
< / ul >
<!-- Tab panes -->
2019-07-31 08:03:48 +00:00
< div class = "tab-content" >
2019-08-27 14:18:33 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "resizevm_cpu" >
2019-07-31 08:03:48 +00:00
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_change %}
2019-11-29 11:48:24 +00:00
{% if status == 5 or not vcpus %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Resize instance cpu form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "Logical host CPUs" %} : {{ vcpu_host }}< / p >
< div class = "form-group row" >
< label class = "col-sm-4 col-form-label" > {% trans "Current Allocation" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-4" >
2020-05-19 16:53:54 +00:00
< select name = "cur_vcpu" class = "custom-select" >
2019-07-31 08:03:48 +00:00
{% for cpu in vcpu_range %}
{% if cur_vcpu %}
< option value = "{{ cpu }}" { % if cpu = = cur_vcpu % } selected { % endif % } > {{ cpu }}< / option >
2015-03-12 15:35:51 +00:00
{% else %}
2019-07-31 08:03:48 +00:00
< option value = "{{ cpu }}" { % if cpu = = vcpu % } selected { % endif % } > {{ cpu }}< / option >
{% endif %}
{% endfor %}
< / select >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-4 col-form-label" > {% trans "Maximum Allocation" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-4" >
2020-05-19 16:53:54 +00:00
< select name = "vcpu" class = "custom-select" >
2019-07-31 08:03:48 +00:00
{% for cpu in vcpu_range %}
< option value = "{{ cpu }}" { % if cpu = = vcpu % } selected { % endif % } > {{ cpu }}< / option >
{% endfor %}
< / select >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
2019-08-27 14:18:33 +00:00
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "resizevm_cpu" > {% trans "Resize" %}< / button >
2019-08-27 14:18:33 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Resize" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-08-27 14:18:33 +00:00
< / form >
2019-11-29 11:48:24 +00:00
< div class = "clearfix" > < / div >
{% else %}
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "Logical Instance Active/Maximum CPUs" %} : {{ cur_vcpu }} / {{ vcpu }} < / p >
2019-11-29 11:48:24 +00:00
< div class = "col-sm-3" > < / div >
< div class = "col-sm-6" >
{% for id, vcpu in vcpus.items %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Resize instance cpu form" > {% csrf_token %}
2019-11-29 11:48:24 +00:00
< div class = "col-sm-3" >
< input name = "id" value = "{{ id }}" hidden / >
{% if vcpu.enabled == 'yes' and vcpu.hotpluggable == "yes" %}
2020-05-20 13:18:27 +00:00
< button type = "submit" class = "btn btn-block btn-success" value = "False" name = "set_vcpu" title = "{% trans " Disable " % } " > {{ id }}< / button >
2019-11-29 11:48:24 +00:00
{% elif vcpu.enabled == 'yes' and vcpu.hotpluggable == "no" %}
2020-05-20 13:18:27 +00:00
< button type = "button" class = "btn btn btn-block btn-info" title = "{% trans " Constant " % } " > {{ id }}< / button >
2019-11-29 11:48:24 +00:00
{% else %}
2020-05-20 13:18:27 +00:00
< button type = "submit" class = "btn btn btn-block btn-secondary" value = "True" name = "set_vcpu" title = "{% trans " Enable " % } " > {{ id }}< / button >
2019-11-29 11:48:24 +00:00
{% endif %}
< / div >
< / form >
{% endfor %}
< / div >
< div class = "col-sm-3" > < / div >
{% endif %}
2019-08-27 14:18:33 +00:00
{% else %}
{% trans "You don't have permission for resizing instance" %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Resize" %}< / button >
2019-08-27 14:18:33 +00:00
{% endif %}
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "resizevm_mem" >
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_change %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Resize instance memory form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "Total host memory" %}: {{ memory_host|filesizeformat }}< / p >
< div class = "form-group row" >
2020-06-10 08:15:14 +00:00
< label class = "col-sm-4 col-form-label" > {% trans "Current Allocation" %} ({% trans "MB" %})< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-4 js-custom__container" >
2020-05-19 16:53:54 +00:00
< select name = "cur_memory" class = "custom-select js-custom__toggle" >
2019-07-31 08:03:48 +00:00
{% for mem in memory_range %}
< option value = "{{ mem }}" { % if mem = = cur_memory % } selected { % endif % } > {{ mem }}< / option >
{% endfor %}
< / select >
2020-05-19 16:53:54 +00:00
< input type = "text" name = "cur_memory_custom" class = "custom-select js-custom__toggle" style = "display: none" / >
2019-07-31 08:03:48 +00:00
< small > < input type = "checkbox" class = "js-custom__checkbox" / > {% trans "Custom value" %}< / small >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-4 col-form-label" >
2020-06-10 08:15:14 +00:00
{% trans "Maximum Allocation" %} ({% trans "MB" %})
2020-05-19 16:53:54 +00:00
< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-4 js-custom__container" >
< select name = "memory" class = "form-control js-custom__toggle" >
{% for mem in memory_range %}
< option value = "{{ mem }}"
{% if mem == memory %}selected{% endif %}>{{ mem }}< / option >
{% endfor %}
< / select >
< input type = "text" name = "memory_custom" class = "form-control js-custom__toggle" style = "display: none" / >
< small > < input type = "checkbox" class = "js-custom__checkbox" / > {% trans "Custom value" %}< / small >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "resizevm_mem" > {% trans "Resize" %}< / button >
2019-08-27 14:18:33 +00:00
< / form >
{% else %}
{% trans "You don't have permission for resizing instance" %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Resize" %}< / button >
2019-08-27 14:18:33 +00:00
{% endif %}
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "resizevm_disk" >
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_change %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Resize instance disk form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "Disk allocation (GB)" %}:< / p >
2019-07-31 08:03:48 +00:00
{% for disk in disks %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
2020-06-10 08:15:14 +00:00
< label class = "col-sm-4 col-form-label" > {% trans "Current Allocation" %} ({{ disk.dev }})< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-4 js-custom__container" >
< input type = "text" name = "disk_size_{{ disk.dev }}" class = "form-control" value = "{{ disk.size|filesizeformat }}" / >
< / div >
< / div >
{% endfor %}
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "resizevm_disk" > {% trans "Resize" %}< / button >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Resize" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
{% else %}
{% trans "You don't have permission for resizing instance" %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Resize" %}< / button >
2019-07-31 08:03:48 +00:00
{% endif %}
< div class = "clearfix" > < / div >
< / div >
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "snapshots" >
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance snapshot menu" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#takesnapshot" aria-controls = "takesnapshot" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Take Snapshot" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#managesnapshot" aria-controls = "managesnapshot" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Manage Snapshots" %}
< / a >
< / li >
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "takesnapshot" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2019-07-31 08:03:48 +00:00
< p > {% trans "This may take more than an hour, depending on how much content is on your droplet and how large the disk is." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form-inline" method = "post" role = "form" aria-label = "Create snapshot form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-12" >
2020-05-20 13:18:27 +00:00
< input type = "text" class = "form-control form-control-lg" name = "name" placeholder = "{% trans " Enter Snapshot Name " % } " maxlength = "14" >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-lg btn-success float-right" name = "snapshot" value = "{% trans " Take Snapshot " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Take Snapshot" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
< div class = "clearfix" > < / div >
{% else %}
< p > {% trans "To take a snapshot please Power Off the instance." %}< / p >
2020-05-28 21:43:26 +00:00
{% endif %}
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "managesnapshot" >
2020-01-17 13:14:28 +00:00
{% if snapshots %}
< p > {% trans "Choose a snapshot for restore/delete" %}< / p >
< div class = "table-responsive" >
< table class = "table" >
< thead >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "Name" %}< / th >
< th scope = "col" > {% trans "Date" %}< / th >
< th scope = "colgroup" colspan = "2" > {% trans "Action" %}< / th >
2020-01-17 13:14:28 +00:00
< / thead >
< tbody >
{% for snap in snapshots %}
< tr >
< td > < strong > {{ snap.name }}< / strong > < / td >
< td > {{ snap.date|date:"M d H:i:s" }}< / td >
< td style = "width:30px;" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Restore snapshot form" > {% csrf_token %}
2020-01-17 13:14:28 +00:00
< input type = "hidden" name = "name" value = "{{ snap.name }}" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-20 13:18:27 +00:00
< button type = "submit" class = "btn btn-sm btn-secondary" name = "revert_snapshot" title = "{% trans 'Revert to this Snapshot' %}" onclick = "return confirm('Are you sure?')" >
2020-05-19 16:53:54 +00:00
< span class = "fa fa-download" > < / span >
2018-10-24 11:09:29 +00:00
< / button >
2020-01-17 13:14:28 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button type = "button" class = "btn btn-sm btn-secondary disabled"
2020-01-17 13:14:28 +00:00
title="{% trans "To restore snapshots you need Power Off the instance." %}">
2020-05-19 16:53:54 +00:00
< span class = "fa fa-download" > < / span >
2020-01-17 13:14:28 +00:00
< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-01-17 13:14:28 +00:00
< / form >
< / td >
< td style = "width:30px;" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Delete snapshot form" > {% csrf_token %}
2020-01-17 13:14:28 +00:00
< input type = "hidden" name = "name" value = "{{ snap.name }}" >
2020-05-20 13:18:27 +00:00
< button type = "submit" class = "btn btn-sm btn-danger" name = "delete_snapshot" title = "{% trans 'Delete Snapshot' %}" onclick = "return confirm('{% trans " Are you sure ? " % } ' ) " >
2020-05-19 16:53:54 +00:00
< span class = "fa fa-trash" > < / span >
2020-01-17 13:14:28 +00:00
< / button >
< / form >
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
2019-07-31 08:03:48 +00:00
{% else %}
2020-01-17 13:14:28 +00:00
< p > {% trans "You do not have any snapshots" %}< / p >
{% endif %}
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "settings" >
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance settings" >
2019-07-31 08:03:48 +00:00
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item " >
< a class = "nav-link text-secondary active" href = "#boot_opt" aria-controls = "boot" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Boot" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#disks" aria-controls = "disks" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Disk" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#vncsettings" aria-controls = "vncsettings" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Console" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#network" aria-controls = "network" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Network" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser or request.user.userattributes.can_clone_instances %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#clone" aria-controls = "clone" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Clone" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#migrate" aria-controls = "migrate" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Migrate" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#xmledit" aria-controls = "xmledit" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "XML" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser or request.user.userattributes.can_clone_instances %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#options" aria-controls = "options" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Options" %}
< / a >
< / li >
{% endif %}
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#users" aria-controls = "users" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Users" %}
< / a >
< / li >
{% endif %}
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
{% if request.user.is_superuser %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "boot_opt" >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans 'Autostart' %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Set enable/disable autostart instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-12 text-center" >
2019-07-31 08:03:48 +00:00
< p > {% trans "Autostart your instance when host server is power on " %}
2020-05-28 21:43:26 +00:00
{% if autostart == 0 %}
2019-07-31 08:03:48 +00:00
< input type = "submit" class = "btn btn-success" name = "set_autostart" value = "{% trans " Enable " % } " >
{% else %}
< input type = "submit" class = "btn btn-danger" name = "unset_autostart" value = "{% trans " Disable " % } " >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / p >
2019-01-15 12:55:05 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / form >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans 'Boot Order' %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Enable/disable instance boot order form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-12 text-center" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-03-16 13:59:45 +00:00
< p > {% trans "Enable Boot Menu for your instance when it starts up " %}
2020-05-28 21:43:26 +00:00
{% if bootmenu == 0 %}
2020-05-20 13:18:27 +00:00
< input type = "submit" class = "btn btn-success" name = "set_bootmenu" title = "{% trans 'Show boot menu' %}" value = "{% trans " Enable " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-20 13:18:27 +00:00
< input type = "submit" class = "btn btn-danger" name = "unset_bootmenu" title = "{% trans 'Hide boot menu' %}" value = "{% trans " Disable " % } " >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-03-16 13:59:45 +00:00
{% else %}
2020-05-28 21:43:26 +00:00
{% if bootmenu == 0 %}
2020-05-20 13:18:27 +00:00
< p > **** {% trans "Please shutdown instance to modify boot menu" %} ****< / p >
2020-05-28 21:43:26 +00:00
{% endif %}
{% endif %}
2019-01-15 12:55:05 +00:00
< / div >
2020-03-16 13:59:45 +00:00
< / div >
< / form >
2020-05-28 21:43:26 +00:00
{% if bootmenu == 1 %}
2020-05-19 16:53:54 +00:00
< div class = "d-flex justify-content-center" >
< div class = "col-sm-6 bg-light rounded shadow-sm" >
{% for idx, val in boot_order.items %}
< label > {{ idx|add:1 }}:{{ val.target }}, < / label >
{% endfor %}
< / div >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Boot order edit form" > {% csrf_token %}
2019-07-31 08:03:48 +00:00
< input id = "bootorder" name = "bootorder" hidden >
2020-05-19 16:53:54 +00:00
< div class = "d-flex justify-content-center" >
< div id = "b_order" class = "multipleselect border-0" >
{% for disk in disks %}
< label > < input type = "checkbox" name = "disk:{{ disk.dev }}" value = "disk:{{ disk.dev }}" onclick = "set_orderlist($('#bootorder'))" / > {{ disk.dev }} - {{ disk.image }}< / label >
{% endfor %}
{% for cd in media %}
< label > < input type = "checkbox" name = "cdrom:{{ cd.dev }}" value = "cdrom:{{ cd.dev }}" onclick = "set_orderlist($('#bootorder'))" / > {{ cd.dev }} - {{ cd.image }}< / label >
{% endfor %}
{% for net in networks %}
< label > < input type = "checkbox" name = "network:{{ net.mac }}" value = "network:{{ net.mac }}" onclick = "set_orderlist($('#bootorder'))" / > NIC - {{ net.mac|slice:"9:" }}< / label >
{% endfor %}
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div >
< div class = "row mt-4" >
2020-05-20 13:18:27 +00:00
< a href = "#" id = "boot_order_up" class = "btn btn-light shadow-sm" > < span class = "fa fa-arrow-up" title = "{% trans 'up: move selected devices' %}" > < / span > < / a >
2015-03-13 09:06:34 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "row mt-2" >
2020-05-20 13:18:27 +00:00
< a href = "#" id = "boot_order_down" class = "btn btn-light shadow-sm" > < span class = "fa fa-arrow-down" title = "{% trans 'down: move selected devices' %}" > < / span > < / a >
2015-03-16 13:46:44 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "d-flex justify-content-center" >
< div class = "col-sm-6" >
< input type = "submit" class = "btn btn-success btn-block" name = "set_bootorder" value = "{% trans " Apply " % } " >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / form >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "disks" >
2020-06-05 06:29:26 +00:00
< form action = "" method = "post" role = "form" aria-label = "Add CD-ROM form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" >
2019-07-31 08:03:48 +00:00
{% trans "Instance Media" %}
2020-06-05 06:29:26 +00:00
< button class = "btn btn-success float-right"
type="submit" name="add_cdrom" type="button"
2020-05-20 13:18:27 +00:00
title="{% trans 'Add CD-ROM' %}"
2020-06-05 06:29:26 +00:00
{% if status != 5 %} disabled {% endif %}>
< span class = "fa fa-plus" > < / span >
2019-07-31 08:03:48 +00:00
< / button >
< / p >
< / form >
2020-06-05 06:29:26 +00:00
< div class = "clearfix" > < / div >
2020-05-19 16:53:54 +00:00
{% for cd in media %}
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Mount/unmount instance CD-ROM form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
2020-06-05 06:29:26 +00:00
< a class = "ml-4 col-sm-3 col-form-label"
2020-05-19 16:53:54 +00:00
name="details"
title="{% trans "Details" %}"
tabindex="0"
data-trigger="focus"
data-toggle="popover"
data-html="true"
data-content="< strong > {% trans 'Bus' %}:< / strong > {{ cd.bus }} < br / >
2020-06-10 08:15:14 +00:00
< strong > {% trans 'Device' %}:< / strong > {{ cd.dev }}">
2020-05-19 16:53:54 +00:00
{% trans "CD-ROM" %} {{ forloop.counter }}
< / a >
{% if not cd.image %}
2020-06-05 06:29:26 +00:00
< div class = "col-sm-6" >
< div class = "input-group" >
< select name = "media" class = "form-control" >
{% if media_iso %}
{% for iso in media_iso %}
< option value = "{{ iso }}" > {{ iso }}< / option >
{% endfor %}
{% else %}
< option value = "none" > {% trans "None" %}< / option >
{% endif %}
< / select >
< div class = "input-group-append" >
{% if media_iso and allow_admin_or_not_template %}
< button type = "submit" class = "btn btn-sm btn-success float-left" name = "mount_iso" value = "{{ cd.dev }}" > {% trans "Mount" %}< / button >
{% else %}
< button class = "btn btn-sm btn-success float-left disabled" > {% trans "Mount" %}< / button >
{% endif %}
{% if status == 5 and allow_admin_or_not_template %}
< button type = "submit" class = "btn btn-sm btn-danger float-right" title = "{% trans " Detach CD-ROM ( remove device ) " % } " name = "detach_cdrom" value = "{{ cd.dev }}" >
< span class = "fa fa-remove" > < / span >
< / button >
{% endif %}
2015-03-13 09:06:34 +00:00
< / div >
2020-06-05 06:29:26 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
{% else %}
2020-05-20 13:18:27 +00:00
< div class = "col-sm-6" >
< div class = "input-group" >
2020-05-19 16:53:54 +00:00
< input class = "form-control" value = "{{ cd.image }}" disabled / >
2020-05-20 13:18:27 +00:00
< div class = "input-group-append" >
< input type = "hidden" name = "path" value = "{{ cd.path }}" >
{% if allow_admin_or_not_template %}
< button type = "submit" class = "btn btn-sm btn-success float-left" value = "{{ cd.dev }}" name = "umount_iso" > {% trans "Unmount" %}< / button >
{% else %}
< button class = "btn btn-sm btn-success float-left disabled" value = "{{ cd.dev }}" name = "umount_iso" > {% trans "Unmount" %}< / button >
{% endif %}
< / div >
2020-05-19 16:53:54 +00:00
< / div >
2020-05-20 13:18:27 +00:00
< / div >
2020-05-19 16:53:54 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< / form >
{% empty %}
< div class = "offset-3 col-sm-6" >
< div class = "bg-light rounded shadow-sm" > {% trans 'There is not any CD-ROM device.' %}< / div >
< / div >
{% endfor %}
< div class = "clearfix" > < / div >
< p class = "font-weight-bold" >
{% trans "Instance Volume" %}
{% include 'add_instance_volume.html' %}
< / p >
2019-07-31 08:03:48 +00:00
2020-05-19 16:53:54 +00:00
< div class = "col-12 col-sm-12" >
< div class = "table-responsive" >
2020-05-20 13:18:27 +00:00
< table class = "table table-hover mt-3" >
2020-05-19 16:53:54 +00:00
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "Device" %}< / th >
< th scope = "col" > {% trans "Used" %}< / th >
< th scope = "col" > {% trans "Capacity" %}< / th >
< th scope = "col" > {% trans "Storage" %}< / th >
< th scope = "col" > {% trans "Source" %}< / th >
< th scope = "col" > {% trans "Action" %}< / th >
2020-05-19 16:53:54 +00:00
< / tr >
< / thead >
< tbody >
{% for disk in disks %}
< tr >
< td >
< button type = "submit" class = "btn btn-sm btn-secondary"
name="details{{ forloop.counter0 }}"
title="{% trans "Details" %}"
tabindex="0"
data-trigger="focus"
data-toggle="popover"
data-html="true"
data-content="< strong > Bus:< / strong > {{ disk.bus }} < br / >
< strong > Format:< / strong > {{ disk.format }} < br / >
< strong > Cache:< / strong > {{ disk.cache }} < br / >
< strong > Serial:< / strong > {{ disk.serial }} < br / >
< strong > Readonly:< / strong > {{ disk.readonly }} < br / >
< strong > Shareable:< / strong > {{ disk.shareable }}< / br >
< strong > IO Mode:< / strong > {{ disk.io }} < br / >
< strong > Discard:< / strong > {{ disk.discard }} < br / >
< strong > Detect Zeroes:< / strong > {{ disk.detect_zeroes }}">
< i class = "fa fa-info" > < / i >
< / button >
{{ disk.dev }}
< / td >
< td > {{ disk.used | filesizeformat}}< / td >
< td > {{ disk.size | filesizeformat }}< / td >
< td > {{ disk.storage }}< / td >
< td > {{ disk.path }}< / td >
< td class = "text-nowrap" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Edit instance volume form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< input type = "hidden" name = "path" value = "{{ disk.path }}" >
< input type = "hidden" name = "dev" value = "{{ disk.dev }}" >
< input type = "hidden" name = "storage" value = "{{ disk.storage }}" >
< input type = "hidden" name = "name" value = "{{ disk.image }}" >
{% include 'edit_instance_volume.html' with id=forloop.counter0 %}
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-sm btn-secondary" name = "detach_vol" value = "{{ disk.dev }}" title = "{% trans " Detach " % } " onclick = "return confirm('{% trans " Are you sure to detach volume ? " % } ' ) " >
< i class = "fa fa-eject" > < / i >
< / button >
< button type = "submit" class = "btn btn-sm btn-secondary" name = "delete_vol" title = "{% trans " Delete " % } " onclick = "return confirm('{% trans " Are you sure to delete volume ? " % } ' ) " >
< i class = "fa fa-trash" > < / i >
< / button >
{% else %}
< button class = "btn btn-sm btn-secondary disabled" name = "detach_vol" value = "{{ disk.dev }}" title = "{% trans " Detach " % } " onclick = "return confirm('{% trans " Are you sure ? This may lead data corruption ! " % } ' ) " >
< i class = "fa fa-eject" > < / i >
< / button >
< button class = "btn btn-sm btn-secondary disabled" name = "delete_vol" title = "{% trans " Delete " % } " onclick = "return confirm('{% trans " Are you sure ? This may lead data corruption ! " % } ' ) " >
< i class = "fa fa-trash" > < / i >
< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< / form >
< / td >
< / tr >
{% endfor %}
2020-05-28 21:43:26 +00:00
< / tbody >
2020-05-19 16:53:54 +00:00
< / table >
< / div >
2020-05-28 21:43:26 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "network" >
< p >
{% trans "Add a network device" %}
{% include 'add_instance_network_block.html' %}
< / p >
2020-05-20 13:18:27 +00:00
< div class = "row mt-3" >
< div class = "col-lg-12 mt-3" >
< h5 class = "font-weight-bold" > {% trans "Network Devices" %}< / h5 >
< table class = "table" >
2019-11-20 05:37:59 +00:00
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans 'Name' %}< / th >
< th scope = "col" class = "d-none d-table-cell d-sm-table-cell" colspan = "6" > {% trans 'Info' %}< / th >
< th scope = "colgroup" class = "d-none" colspan = "2" > {% trans 'Info' %}< / th >
< th scope = "colgroup" colspan = "2" > {% trans 'Actions' %}< / th >
2019-11-20 05:37:59 +00:00
< / tr >
< / thead >
< tbody >
2020-01-10 14:55:42 +00:00
{% for network in networks %}
2019-11-20 05:37:59 +00:00
< tr >
2020-01-10 14:55:42 +00:00
< td rowspan = "2" > eth{{ forloop.counter0 }}({{ network.target|default:"no target" }})
2020-05-26 13:18:38 +00:00
< form method = "post" aria-label = "set instance link state form" > {% csrf_token %}
2020-01-10 14:55:42 +00:00
< input name = "mac" value = "{{ network.mac }}" hidden / >
< input name = "set_link_state" value = "{{ network.state }}" hidden / >
< input type = "checkbox" { % if network . state = = ' up ' % } checked
{% endif %} onclick='submit();' />
2020-01-13 13:18:19 +00:00
< strong > {% trans 'active' %}< / strong >
2020-01-10 14:55:42 +00:00
< / form >
< / td >
2020-05-19 16:53:54 +00:00
< th class = "d-none d-table-cell d-sm-table-cell" > {% trans 'MAC' %}< / th >
2019-12-24 11:54:04 +00:00
< td > {{ network.mac }}< / td >
2020-05-26 10:52:52 +00:00
< th scope = "row" class = "d-none d-table-cell d-sm-table-cell" > {% trans 'Filter' %}< / th >
2020-05-19 16:53:54 +00:00
< td class = "d-none d-table-cell" > {{ network.filterref|default:"None" }}< / td >
2020-05-26 10:52:52 +00:00
< th scope = "row" class = "d-none d-table-cell d-sm-table-cell" > {% trans 'Source' %}< / th >
2019-12-24 11:54:04 +00:00
< td > {{ network.nic }}< / td >
< td >
2020-05-19 16:53:54 +00:00
< form method = "post" name = "edit_network{{ forloop.counter0 }}" role = "form" > {% csrf_token %}
2019-11-20 05:37:59 +00:00
< button data-target = "#editInstanceNetwork{{ forloop.counter0 }}" type = "button" class = "btn btn-sm btn-primary"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit NIC" %}" data-toggle="modal">
2020-05-19 16:53:54 +00:00
< span class = "fa fa-edit" aria-hidden = "true" > < / span >
2019-11-20 05:37:59 +00:00
< / button >
< div class = "modal fade" id = "editInstanceNetwork{{ forloop.counter0 }}" role = "dialog" aria-labelledby = "editInstanceNetworkLabel" aria-hidden = "true" >
< div class = "modal-dialog" >
< div class = "modal-content" >
< div class = "modal-header" >
2020-05-19 16:53:54 +00:00
< h5 class = "modal-title" > {% trans "Edit Instance Network" %}< / h5 >
< button type = "button" class = "close" data-dismiss = "modal" aria-hidden = "true" > × < / button >
2019-11-20 05:37:59 +00:00
< / div >
< div class = "modal-body" >
2020-05-20 13:18:27 +00:00
< div class = "container" >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-form-label" > {% trans "MAC" %}< / label >
< div class = "input-group" >
< input class = "form-control" type = "text" value = "{{ network.mac }}" readonly / >
< input class = "form-control" type = "text" name = "net-mac-{{ forloop.counter0 }}" value = "{{ network.mac }}" / >
< / div >
2019-11-20 05:37:59 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-form-label" > {% trans "Net Source" %}< / label >
< div class = "input-group" >
< input class = "form-control" type = "text" value = "{{ network.nic }}" readonly / >
< select class = "form-control" name = "net-source-{{ forloop.counter0 }}" >
{% for c_net in networks_host %}
2020-05-28 21:43:26 +00:00
< option value = "net:{{ c_net }}" { % if c_net = = network . nic % } selected { % endif % } > {% trans 'Network' %} {{ c_net }}< / option >
2020-05-19 16:53:54 +00:00
{% endfor %}
{% for c_iface in interfaces_host %}
2020-05-28 21:43:26 +00:00
< option value = "iface:{{ c_iface }}" { % if c_iface = = network . nic % } selected { % endif % } > {% trans 'Interface' %} {{ c_iface }}< / option >
2020-05-19 16:53:54 +00:00
{% endfor %}
< / select >
< / div >
2019-11-20 05:37:59 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-form-label" > {% trans "NWFilter" %}< / label >
< div class = "input-group" >
< input class = "form-control" type = "text" value = "{{ network.filterref }}" readonly / >
< select class = "form-control" name = "net-nwfilter-{{ forloop.counter0 }}" >
< option value = "" > {% trans "None" %}< / option >
{% for c_filters in nwfilters_host %}
2020-05-28 21:43:26 +00:00
< option value = "{{ c_filters }}" { % if c_filters = = network . filterref % } selected { % endif % } > {{ c_filters }}< / option >
2020-05-19 16:53:54 +00:00
{% endfor %}
< / select >
< / div >
2019-11-20 05:37:59 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-form-label" > {% trans "Model" %} < / label >
< div class = "input-group" >
< input class = "form-control" type = "text" value = "{{ network.model }}" readonly / >
< select class = "form-control" name = "net-model-{{ forloop.counter0 }}" >
{% for model in net_models_host %}
2020-05-28 21:43:26 +00:00
< option value = "{{ model }}" { % if model = = network . model % } selected { % endif % } > {{ model }}< / option >
2020-05-19 16:53:54 +00:00
{% endfor %}
< / select >
< / div >
2020-01-10 14:55:42 +00:00
< / div >
2020-01-10 12:28:09 +00:00
< / div >
2020-05-20 13:18:27 +00:00
< / div >
2020-01-10 12:28:09 +00:00
< div class = "modal-footer" >
2020-05-19 16:53:54 +00:00
< button class = "btn btn-secondary" data-dismiss = "modal" > {% trans 'Close' %}< / button >
2020-05-28 21:43:26 +00:00
< button class = "btn btn-success" name = "change_network" title = "{% trans " Apply network changes " % } " > {% trans "Apply" %}< / button >
2019-11-20 05:37:59 +00:00
< / div >
< / div >
< / div >
< / div >
2020-01-10 12:28:09 +00:00
< / form >
< / td >
2020-01-13 13:18:19 +00:00
< td align = "right" >
< form method = "post" name = "delete_network" role = "form" > {% csrf_token %}
< button class = "btn btn-sm btn-danger" value = "{{ network.mac }}" name = "delete_network" title = "{% trans " Delete Device " % } "
onclick="return confirm('{% trans "Are you sure?" %}')">
2020-05-19 16:53:54 +00:00
< i class = "fa fa-trash" > < / i >
2020-01-13 13:18:19 +00:00
< / button >
< / form >
< / td >
2020-01-10 12:28:09 +00:00
< / tr >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "row" > {% trans 'IPv4' %}< / th >
2020-01-10 12:28:09 +00:00
< td >
2020-01-13 13:18:19 +00:00
{% for ipv4 in network.ipv4|default:"unknown" %}{{ ipv4 }}{% endfor %}
2020-01-10 12:28:09 +00:00
< / td >
2020-05-26 10:52:52 +00:00
< th scope = "row" > {% trans 'IPv6' %}< / th >
2020-05-20 13:18:27 +00:00
< td >
2020-01-13 13:18:19 +00:00
{% for ipv6 in network.ipv6|default:"unknown" %}{{ ipv6 }}{% endfor %}
2020-01-10 12:28:09 +00:00
< / td >
2020-05-26 10:52:52 +00:00
< th scope = "row" > {% trans 'Model' %}< / th >
2020-01-10 14:55:42 +00:00
< td > {{ network.model }}< / td >
2020-01-10 12:28:09 +00:00
< th > {% trans 'QoS' %}< / th >
2020-05-20 13:18:27 +00:00
< td class = "d-flex justify-content-end" >
2020-05-26 13:18:38 +00:00
< form method = "post" name = "add_qos{{ forloop.counter0 }}" role = "form" aria-label = "Add network qos form" > {% csrf_token %}
2020-01-10 12:28:09 +00:00
< input type = "text" name = "net-mac-{{ forloop.counter0 }}" value = "{{ network.mac }}" hidden / >
{% include 'add_network_qos.html' with id=forloop.counter0 %}
< / form >
2019-11-20 05:37:59 +00:00
< / td >
< / tr >
2020-01-10 14:55:42 +00:00
< tr >
2020-05-20 13:18:27 +00:00
< td class = "bg-primary" colspan = "9" > < / td >
2020-01-10 14:55:42 +00:00
< / tr >
{% endfor %}
2019-11-20 05:37:59 +00:00
< / tbody >
< / table >
< / div >
2020-05-20 13:18:27 +00:00
< / div >
2019-11-20 05:37:59 +00:00
{% if qos %}
2020-06-10 13:25:29 +00:00
< div class = "row mt-3" >
< div class = "col-sm-10" >
< p > < strong > {% trans "QoS Configuration" %}< / strong > < / p >
< / div >
< div class = "col-12 col-sm-12" >
< table class = "table table-hover" >
< thead >
< tr class = "d-flex" >
< th scope = "col" class = "col-2" > {% trans "MAC" %}/{% trans "Direction" %}< / th >
< th scope = "col" class = "col-2" > {% trans "Average" %}< / th >
< th scope = "col" class = "col-3" > {% trans "Peak" %}< / th >
< th scope = "col" class = "col-3" > {% trans "Burst" %}< / th >
< th scope = "col" class = "col-2" > {% trans "Actions" %}< / th >
< / tr >
< / thead >
< tbody >
{% for q, attrs in qos.items %}
{% for att in attrs %}
< form method = "post" role = "form" aria-label = "Instance QoS configuration form" > {% csrf_token %}
< tr class = "d-flex" >
< td class = "col-2" > < label class = "col-form-label" > {{ q }} {{ att.direction | capfirst }}< / label > < / td >
< td class = "col-2" > < input id = "qos_average" class = "form-control" name = "qos_average"
value="{{ att.average|default:'' }}"/>
< / td >
< td class = "col-3" > < input id = "qos_peak" class = "form-control" name = "qos_peak"
value="{{ att.peak|default:'' }}"/>
< / td >
< td class = "col-3" > < input id = "qos_burst" class = "form-control" name = "qos_burst"
value="{{ att.burst|default:'' }}"/>
< / td >
< td class = "col-sm-2" >
< input name = "qos_direction" value = "{{ att.direction }}" hidden / >
< input name = "net-mac" value = "{{ q }}" hidden / >
< button type = "submit" class = "btn btn-sm btn-primary"
name="set_qos" data-toggle="modal"
title="{% trans "Edit QoS" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
< i class = "fa fa-save" > < / i >
< / button >
< button type = "submit" class = "btn btn-sm btn-danger"
name="unset_qos"
title="{% trans "Delete QoS" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
< i class = "fa fa-trash" > < / i >
< / button >
< / td >
< / tr >
< / form >
{% endfor %}
{% endfor %}
< / tbody >
< / table >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
2019-11-20 05:37:59 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "migrate" >
< p > {% trans "For migration both host servers must have equal settings and OS type" %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "ml-3 form" method = "post" role = "form" aria-label = "Migrate instance form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Original host" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< label class = "form-control" readonly = "readonly" > {{ compute.name }}< / label >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Host migration" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< select name = "compute_id" class = "custom-select" >
2019-07-31 08:03:48 +00:00
{% if computes_count != 1 %}
{% for comp in computes %}
{% if comp.id != compute.id %}
< option value = "{{ comp.id }}" > {{ comp.name }}< / option >
{% endif %}
{% endfor %}
2017-10-26 13:51:10 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / select >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
2020-05-28 21:43:26 +00:00
< input class = "custom-control-input" type = "checkbox" name = "live_migrate" value = "true" id = "vm_live_migrate" { % if status ! = 5 % } checked { % else % } disabled { % endif % } >
2020-05-19 16:53:54 +00:00
< label class = "custom-control-label" for = "vm_live_migrate" > {% trans "Live migration" %}< / label >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "unsafe_migrate" value = "true" id = "vm_unsafe_migrate" >
< label class = "custom-control-label" for = "vm_unsafe_migrate" > {% trans "Unsafe migration" %}< / label >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "xml_delete" value = "true" id = "xml_delete" checked >
< label class = "custom-control-label" for = "xml_delete" > {% trans "Delete original" %}< / label >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
2020-05-28 21:43:26 +00:00
< input class = "custom-control-input" type = "checkbox" name = "offline_migrate" value = "true" id = "offline_migrate" { % if status = = 5 % } checked { % else % } disabled { % endif % } >
2020-05-19 16:53:54 +00:00
< label class = "custom-control-label" for = "offline_migrate" > {% trans "Offline migration" %}< / label >
< / div >
2019-12-19 13:06:51 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
2020-05-28 21:43:26 +00:00
< input class = "custom-control-input" type = "checkbox" name = "postcopy" value = "true" id = "postcopy" { % if status ! = 1 % } disabled { % endif % } >
2020-05-19 16:53:54 +00:00
< label class = "custom-control-label" for = "postcopy" > {% trans "Post copy" %}< / label >
< / div >
2019-12-19 13:06:51 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
2020-05-28 21:43:26 +00:00
< input class = "custom-control-input" type = "checkbox" name = "autoconverge" value = "true" id = "autoconverge" { % if status ! = 1 % } disabled { % endif % } >
2020-05-19 16:53:54 +00:00
< label class = "custom-control-label" for = "autoconverge" title = "{% trans 'Forces CPU convergence during live migration' %}" > {% trans "Auto converge" %}< / label >
< / div >
2019-12-19 13:06:51 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-6 offset-3" >
< div class = "custom-control custom-switch" >
2020-05-28 21:43:26 +00:00
< input class = "custom-control-input" type = "checkbox" name = "compress" value = "true" id = "compress" { % if status ! = 1 % } disabled { % endif % } >
2020-05-19 16:53:54 +00:00
< label class = "custom-control-label" for = "compress" title = "{% trans 'Compress instance memory for fast migration' %}" > {% trans "Compressed" %}< / label >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
{% if computes_count != 1 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "migrate" onclick = "showPleaseWaitDialog();" > {% trans "Migrate" %}< / button >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" > {% trans "Migrate" %}< / button >
2019-07-31 08:03:48 +00:00
{% endif %}
< / form >
2020-03-16 13:59:45 +00:00
< div class = "clearfix" > < / div >
2019-07-31 08:03:48 +00:00
< / div >
2020-06-12 11:46:17 +00:00
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "xmledit" >
2020-06-10 08:15:14 +00:00
< p > {% trans "If you need to edit XML please Power Off the instance" %}< / p >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Edit instance XML form" > {% csrf_token %}
2019-07-31 08:03:48 +00:00
< div class = "col-sm-12" id = "xmlheight" >
< textarea id = "editor" > {{ inst_xml }}< / textarea >
< / div >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2019-07-31 08:03:48 +00:00
< input type = "hidden" name = "inst_xml" >
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "change_xml" >
2019-07-31 08:03:48 +00:00
{% trans "Change" %}
< / button >
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" >
2019-07-31 08:03:48 +00:00
{% trans "Change" %}
< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "users" >
< div >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" >
2019-07-31 08:03:48 +00:00
{% trans "Instance owners" %}
{% include 'add_instance_owner_block.html' %}
< / p >
< / div >
< div class = "table-responsive" >
2020-05-20 13:18:27 +00:00
< table class = "table table-striped sortable-theme-bootstrap mt-3" data-sortable >
2019-07-31 08:03:48 +00:00
< tbody class = "searchable" >
{% for userinstance in userinstances %}
< tr >
< td > < a href = "{% url 'account' userinstance.user.id %}" > {{ userinstance.user }}< / a > < / td >
< td style = "width:30px;" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Delete Instance owner" > {% csrf_token %}
2019-07-31 08:03:48 +00:00
< input type = "hidden" name = "userinstance" value = "{{ userinstance.pk }}" >
2020-05-20 13:18:27 +00:00
< button type = "submit" class = "btn btn-sm btn-secondary" name = "del_owner" title = "{% trans " Delete Ownership " % } " >
2019-07-31 08:03:48 +00:00
< i class = "fa fa-trash" > < / i >
< / button >
< / form >
< / td >
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
< div class = "clearfix" > < / div >
< / div >
{% endif %}
{% if request.user.is_superuser or request.user.is_staff or userinstance.is_vnc %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "vncsettings" >
2020-05-19 16:53:54 +00:00
< p class = "text-muted" > {% trans "To set console's type, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form" method = "post" role = "form" aria-label = "set console type form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" id = "console_type_selection" >
< label for = "console_select_type" class = "col-sm-2 col-form-label" > {% trans "Type" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
< select id = "console_select_type" class = "custom-select" name = "console_type" >
< option class = "font-weight-bold" value = "" > {% trans "please choose" %}< / option >
{% for ctype in console_types %}
< option value = "{{ ctype }}" > {{ ctype }}< / option >
{% endfor %}
< / select >
< div class = "input-group-append" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-success " name = "set_console_type" > {% trans "Set" %}< / button >
{% else %}
< button class = "btn btn-success disabled" name = "set_console_type" > {% trans "Set" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / form >
2020-05-19 16:53:54 +00:00
< p class = "text-muted" > {% trans "To set console listen address, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form" method = "post" role = "form" aria-label = "Set console listen address form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" id = "console_listen_address_selection" >
< label for = "console_select_listen_address" class = "col-sm-2 col-form-label" > {% trans "Listen on" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
< select id = "console_select_listen_address" class = "custom-select" name = "console_listen_address" >
< option value = "" class = "font-weight-bold" > {% trans "please choose" %}< / option >
{% for address, label in console_listen_addresses %}
< option value = "{{ address }}" > {{ label }}< / option >
{% endfor %}
< / select >
< div class = "input-group-append" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-success " name = "set_console_listen_address" > {% trans "Set" %}< / button >
{% else %}
< button class = "btn btn-success disabled" name = "set_console_listen_address" > {% trans "Set" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / form >
2020-05-19 16:53:54 +00:00
< p class = "text-muted" > {% trans "To create console password, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form" method = "post" role = "form" aria-label = "Create console password form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-10 offset-2 " >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "auto_pass" value = "true" id = "console_passwd_gen" >
< label class = "custom-control-label" for = "console_passwd_gen" > {% trans "Generate" %}< / label >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "clear_pass" value = "true" id = "console_passwd_clear" >
< label class = "custom-control-label" for = "console_passwd_clear" > {% trans "Clear" %}< / label >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label for = "inputPassword1" class = "col-sm-2 col-form-label" > {% trans "Password" %}< / label >
< div class = "col-sm-6" >
< div class = "input-group" >
< input id = "console_show_pass" type = "password" class = "form-control" name = "console_passwd"
{% if console_passwd %}
value="{{ console_passwd }}"
{% else %}
placeholder="{% trans "Password" %}"
{% endif %} maxlength="14">
< div class = "input-group-append" >
{% if console_passwd %}
< a href = "#" name = "console_show" class = "btn btn-md btn-primary" onclick = "show_console()" > {% trans "Show" %}< / a >
{% endif %}
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-success" name = "set_console_passwd" > {% trans "Set" %}< / button >
{% else %}
< button class = "btn btn-success disabled" name = "set_console_passwd" > {% trans "Set" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / form >
2020-05-19 16:53:54 +00:00
< p class = "text-muted" > {% trans "To set console's keymap, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form" method = "post" role = "form" aria-label = "Set console keymap form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "col-sm-10 offset-2" >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "clear_keymap" value = "true" id = "console_keymap_clear" >
< label class = "custom-control-label" for = "console_keymap_clear" > {% trans "Clear" %}< / label >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" id = "console_keymap_selection" >
< label for = "console_select_keymap" class = "col-sm-2 col-form-label" > {% trans "Keymap" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
< select id = "console_select_keymap" class = "custom-select" name = "console_keymap" >
< option value = "" class = "font-weight-bold" > {% trans "please choose" %}< / option >
{% for keymap in keymaps %}
< option value = "{{ keymap }}" > {{ keymap }}< / option >
{% endfor %}
< / select >
< div class = "input-group-append" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-success" name = "set_console_keymap" > {% trans "Set" %}< / button >
{% else %}
< button class = "btn btn-success disabled" name = "set_console_keymap" > {% trans "Set" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / form >
< div class = "clearfix" > < / div >
< / div >
{% endif %}
{% if request.user.is_superuser or request.user.userattributes.can_clone_instances %}
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "clone" >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "Create a clone" %}< / p >
2020-05-26 13:18:38 +00:00
< form class = "form" action = "" method = "post" role = "form" aria-label = "Create clone form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label font-weight-normal" > {% trans "Clone Name" %}< / label >
2019-07-31 08:03:48 +00:00
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< div class = "col-sm-6" >
< div class = "input-group" >
< input id = "clone_name" type = "text" class = "form-control" name = "name" value = "{{ vname }}-clone" / >
< div class = "input-group-append" >
< button type = "button" class = "btn btn-success" name = "guess-clone-name"
onclick="guess_clone_name()">{% trans "Guess" %}< / button >
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
{% elif clone_instance_auto_name %}
< div class = "col-sm-4" >
< input id = "clone_instance_auto_name" type = "text" class = "form-control" name = "auto_name" value = "Automatic" disabled / >
< / div >
{% else %}
< div class = "col-sm-4" >
2020-03-16 13:59:45 +00:00
< select id = "select_clone_name" class = "form-control" name = "name" size = "1" >
2019-07-31 08:03:48 +00:00
{% for name in clone_free_names %}
< option value = "{{ name }}" > {{ name }}< / option >
{% endfor %}
< / select >
< / div >
{% endif %}
< / div >
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< label > {% trans "Network devices" %}:< / label >
2019-07-31 08:03:48 +00:00
{% for network in networks %}
2020-05-19 16:53:54 +00:00
< p >
< div class = "form-group row" >
< label class = "col-sm-2 col-form-label offset-1" > eth{{ forloop.counter0 }} ({{ network.nic }})< / label >
< div class = "col-sm-6" >
< div class = "input-group" >
< input type = "text" class = "form-control" name = "clone-net-mac-{{ forloop.counter0 }}" value = "{{ network.mac }}" / >
< div class = "input-group-append" >
< button type = "button" class = "btn btn-success" name = "random-mac-{{ forloop.counter0 }}"
onclick="random_mac('clone-net-mac-{{ forloop.counter0 }}')">{% trans "Random" %}< / button >
< button type = "button" class = "btn btn-success" name = "guess-mac-{{ forloop.counter0 }}"
onclick="guess_mac_address('#clone_name', {{ forloop.counter0 }})">{% trans "Guess" %}< / button >
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< / p >
2019-07-31 08:03:48 +00:00
{% endfor %}
{% else %}
{% for network in networks %}
< input type = "hidden" class = "form-control" name = "clone-net-mac-{{ forloop.counter0 }}" value = "{{ network.mac }}" / >
{% endfor %}
{% endif %}
{% if request.user.is_superuser %}
2020-05-19 16:53:54 +00:00
< label > {% trans "Storage devices" %}:< / label >
2019-07-31 08:03:48 +00:00
{% for disk in disks %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-2 col-form-label offset-1" > {{ disk.dev }} ({{ disk.storage }})< / label >
< div class = "col-sm-6" >
< div class = "input-group" >
< input id = "disk_name-{{ disk.dev }}" type = "text" class = "form-control" name = "disk-{{ disk.dev }}" value = "{{ disk.image }}" / >
2020-05-28 21:43:26 +00:00
{% if disk.format == 'qcow2' %}
2020-05-19 16:53:54 +00:00
< div class = "input-group-append" >
< span class = "input-group-text" > {% trans 'Metadata' %}< / span >
< div class = "input-group-text" >
< input type = "checkbox" name = "meta-{{ disk.dev }}" value = "true" >
< / div >
< / div >
2020-05-28 21:43:26 +00:00
{% endif %}
2015-03-20 10:06:32 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
{% endfor %}
{% else %}
{% for disk in disks %}
< input id = "disk_name-{{ disk.dev }}" type = "hidden" class = "form-control" name = "disk-{{ disk.dev }}" value = "{{ disk.image }}" / >
{% endfor %}
{% endif %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Title" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
< input type = "text" name = "clone-title" class = "form-control" >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Description" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
< textarea name = "clone-description" class = "form-control" > < / textarea >
< / div >
< / div >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "clone" onclick = "showPleaseWaitDialog();" > {% trans "Clone" %}< / button >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success float-right disabled" name = "clone" > {% trans "Clone" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "options" >
2019-11-20 13:24:01 +00:00
< p > {% trans "To set instance template name description, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Set instance template name description form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Title" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
< input type = "text" name = "title" class = "form-control" value = "{{ title }}" >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Description" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
< textarea name = "description" class = "form-control" > {{ description }}< / textarea >
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label class = "col-sm-3 col-form-label" > {% trans "Is template" %}< / label >
2019-07-31 08:03:48 +00:00
< div class = "col-sm-6" >
2019-09-25 08:48:28 +00:00
< input type = "checkbox"
name="is_template"
value="True"
id="is_template"
{% if instance.is_template %}checked{% endif %}
{% if not request.user.is_superuser and not request.user.is_staff %}disabled{% endif %}>
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< div class = "offset-3 col-sm-6" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2019-11-20 13:24:01 +00:00
< button type = "submit" class = "btn btn-block btn-success" name = "change_options" > {% trans "Change" %}< / button >
{% else %}
< button class = "btn btn-block btn-success disabled" name = "change_options" > {% trans "Change" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-11-20 13:24:01 +00:00
< / div >
< / div >
< / form >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "To set instance video model, shutdown the instance." %}< / p >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Set instance video model form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label for = "video_model_select" class = "col-sm-3 col-form-label" > {% trans "Primary Video Model" %}< / label >
2019-11-20 13:24:01 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
< select id = "video_model_select" class = "custom-select" name = "video_model" >
< option class = "font-weight-bold" value = "" > {% trans "please choose" %}< / option >
{% for vmodel in videos_host %}
< option value = "{{ vmodel }}" > {{ vmodel }}< / option >
{% endfor %}
2019-11-20 13:24:01 +00:00
< / select >
< span class = "input-group-btn" >
2020-05-28 21:43:26 +00:00
{% if status == 5 %}
2019-11-20 13:24:01 +00:00
< button type = "submit" class = "btn btn-success" name = "set_video_model" > {% trans "Set" %}< / button >
2020-05-19 16:53:54 +00:00
{% else %}
2019-11-20 13:24:01 +00:00
< button class = "btn btn-success disabled" name = "set_video_model" > {% trans "Set" %}< / button >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-11-20 13:24:01 +00:00
< / span >
2020-05-19 16:53:54 +00:00
< / div >
2019-11-20 13:24:01 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / form >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "To set instance vCPUs hotpluggable" %}< / p >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Set instance vCPUs hotpluggable form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label for = "vcpu_hotplug" class = "col-sm-3 col-form-label" > {% trans "vCPU Hot Plug" %}< / label >
2019-11-29 11:48:24 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
2019-11-29 11:48:24 +00:00
< select id = "vcpu_hotplug" class = "form-control" name = "vcpu_hotplug" >
< option value = "True" { % if vcpus % } selected { % endif % } > {% trans 'Enabled' %}< / option >
< option value = "False" { % if not vcpus % } selected { % endif % } > {% trans 'Disabled' %}< / option >
< / select >
< span class = "input-group-btn" >
{% if status == 5 %}
< button type = "submit" class = "btn btn-success" name = "set_vcpu_hotplug" > {% trans "Set" %}< / button >
{% else %}
< button class = "btn btn-success" name = "set_vcpu_hotplug" disabled > {% trans "Set" %}< / button >
{% endif %}
< / span >
2020-05-19 16:53:54 +00:00
< / div >
2019-11-29 11:48:24 +00:00
< / div >
< / div >
< / form >
2020-05-19 16:53:54 +00:00
< p class = "font-weight-bold" > {% trans "To Enable/Disable Qemu Guest Agent. Status" %}:
2019-12-25 11:36:43 +00:00
{% if status == 1 %}
2019-12-24 14:19:11 +00:00
{% if guest_agent_ready %}
2020-05-19 16:53:54 +00:00
< label class = "badge badge-success" > {% trans 'Connected' %}< / label >
2019-12-24 14:19:11 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< label class = "badge badge-danger" > {% trans 'Disconnected' %}< / label >
2019-12-24 14:19:11 +00:00
{% endif %}< / p >
2019-12-25 11:36:43 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< label class = "badge badge-default" > {% trans 'Unknown' %}< / label >
2019-12-25 11:36:43 +00:00
{% endif %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Enable/Disable Qemu Guest Agent form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div class = "form-group row" >
< label for = "guest_agent" class = "col-sm-3 col-form-label" > {% trans "Qemu Guest Agent" %}< / label >
2019-12-24 14:19:11 +00:00
< div class = "col-sm-6" >
2020-05-19 16:53:54 +00:00
< div class = "input-group" >
< select id = "guest_agent" class = "custom-select" name = "guest_agent" >
2019-12-24 14:19:11 +00:00
< option value = "True" { % if guest_agent % } selected { % endif % } > {% trans 'Enabled' %}< / option >
< option value = "False" { % if not guest_agent % } selected { % endif % } > {% trans 'Disabled' %}< / option >
< / select >
< span class = "input-group-btn" >
< button type = "submit" class = "btn btn-success" name = "set_guest_agent" > {% trans "Set" %}< / button >
< / span >
2020-05-19 16:53:54 +00:00
< / div >
2019-12-24 14:19:11 +00:00
< / div >
< / div >
< / form >
< div class = "clearfix" > < / div >
< / div >
2019-07-31 08:03:48 +00:00
{% endif %}
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "graphics" >
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance graphs and logs menu" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary active" href = "#graphs" id = "graphtab" aria-controls = "graphs" role = "tab" data-toggle = "tab" aria-controls = "graphs" aria-selected = "true" >
2019-07-31 08:03:48 +00:00
{% trans "Real Time" %}
< / a >
< / li >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link text-secondary" href = "#logs" id = "logtab" aria-controls = "logs" role = "tab" data-toggle = "tab" aria-controls = "logs" onclick = 'update_logs_table("{{ vname }}");' >
2019-07-31 08:03:48 +00:00
{% trans "Logs" %}
< / a >
< / li >
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "graphs" >
2020-05-19 16:53:54 +00:00
< div class = "mb-1 card border-success" >
< div class = "card-header" >
< h5 class = "card-title" > < i class = "fa fa-long-arrow-right" > < / i > {% trans "CPU Usage" %}< / h5 >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "card-body" >
2019-07-31 08:03:48 +00:00
< div class = "flot-chart" >
2020-05-19 16:53:54 +00:00
< div class = "flot-chart-content" id = "flot-moving-line-chart" >
2019-07-31 08:03:48 +00:00
< canvas id = "cpuChart" width = "735" height = "160" > < / canvas >
2019-05-21 06:12:28 +00:00
< / div >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< div class = "mb-1 card border-danger" >
< div class = "card-header" >
< h5 class = "card-title" > < i class = "fa fa-long-arrow-right" > < / i > {% trans "Memory Usage" %}< / h5 >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "card-body" >
2019-07-31 08:03:48 +00:00
< div class = "flot-chart" >
2020-05-19 16:53:54 +00:00
< div class = "flot-chart-content" id = "flot-moving-line-chart" >
2019-07-31 08:03:48 +00:00
< canvas id = "memChart" width = "735" height = "160" > < / canvas >
2017-12-11 14:07:01 +00:00
< / div >
< / div >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
{% for net in networks %}
2020-05-19 16:53:54 +00:00
< div class = "mb-1 card border-info" >
< div class = "card-header" >
< h5 class = "card-title" > < i class = "fa fa-long-arrow-right" > < / i > {% trans "Bandwidth Device" %}: eth{{ forloop.counter0 }}< / h5 >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "card-body" >
2019-07-31 08:03:48 +00:00
< div class = "flot-chart" >
2020-05-19 16:53:54 +00:00
< div class = "flot-chart-content" id = "flot-moving-line-chart" >
2019-07-31 08:03:48 +00:00
< canvas id = "netEth{{ forloop.counter0 }}Chart" width = "735" height = "160" > < / canvas >
< / div >
< / div >
< / div >
< / div >
{% endfor %}
{% for disk in disks %}
2020-05-19 16:53:54 +00:00
< div class = "mb-1 card border-warning" >
< div class = "card-header" >
2020-06-12 11:46:17 +00:00
< h5 class = "card-title" > < i class = "fa fa-long-arrow-right" > < / i > {% trans "Disk I/O device" %}: {{ disk.dev }}< / h5 >
2019-07-31 08:03:48 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< div class = "card-body" >
2019-07-31 08:03:48 +00:00
< div class = "flot-chart" >
2020-05-19 16:53:54 +00:00
< div class = "flot-chart-content" id = "flot-moving-line-chart" >
2019-07-31 08:03:48 +00:00
< canvas id = "blk{{ disk.dev }}Chart" width = "735" height = "160" > < / canvas >
< / div >
< / div >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
2019-07-31 08:03:48 +00:00
{% endfor %}
< div class = "clearfix" > < / div >
< / div >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered" id = "logs" >
< div class = "table-responsive" >
< table class = "table table-striped sortable-theme-bootstrap" id = "logs_table" data-sortable >
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "Date" %}< / th >
< th scope = "col" > {% trans "User" %}< / th >
< th scope = "col" > {% trans "Message" %}< / th >
2019-07-31 08:03:48 +00:00
< / tr >
< / thead >
< tbody class = "searchable" >
< tr > < td colspan = "3" > < i > {% trans 'None' %}...< / i > < / td > < / tr >
< / tbody >
< / table >
2015-03-12 14:15:36 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< div class = "clearfix" > < / div >
< / div >
< / div >
< / div >
< / div >
< div role = "tabpanel" class = "tab-pane" id = "undefine" >
< div role = "tabpanel" >
<!-- Nav tabs -->
2020-05-26 13:18:38 +00:00
< ul class = "nav nav-tabs" role = "tablist" aria-label = "Instance destroy menu" >
2020-05-19 16:53:54 +00:00
< li class = "nav-item" >
< a class = "nav-link active" href = "#destroy" aria-controls = "destroy" role = "tab" data-toggle = "tab" >
2019-07-31 08:03:48 +00:00
{% trans "Destroy Instance" %}
< / a >
< / li >
< / ul >
<!-- Tab panes -->
< div class = "tab-content" >
< div role = "tabpanel" class = "tab-pane tab-pane-bordered active" id = "destroy" >
< p > {% trans "Delete storage for instance?" %}< / p >
{% if request.user.is_superuser or userinstance.is_delete %}
2020-05-28 21:43:26 +00:00
{% if status == 3 %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success disabled float-right" name = "delete" > {% trans "Destroy" %}< / button >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< form class = "form" method = "post" role = "form" id = "delete_form" > {% csrf_token %}
< div class = "ml-3 form-row" >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "delete_disk" value = "true" checked id = "delete_disk" >
< label class = "custom-control-label font-weight-bold" for = "delete_disk" > {% trans "Remove Instance's data" %}< / label >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
2019-12-13 13:40:59 +00:00
{% if nvram %}
2020-05-19 16:53:54 +00:00
< div class = "ml-3 form-row" >
< div class = "custom-control custom-switch" >
< input class = "custom-control-input" type = "checkbox" name = "delete_nvram" value = "true" id = "delete_nvram" checked >
2020-06-10 12:16:58 +00:00
< label class = "custom-control-label font-weight-bold" for = "delete_nvram" > {% trans "Remove Instance's NVRAM" %}< / label >
2020-05-19 16:53:54 +00:00
< / div >
2019-12-13 13:40:59 +00:00
< / div >
{% endif %}
2020-05-19 16:53:54 +00:00
< button type = "submit" class = "btn btn-lg btn-success float-right" name = "delete" > {% trans "Destroy" %}< / button >
2019-07-31 08:03:48 +00:00
< / form >
2020-05-28 21:43:26 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< button class = "btn btn-lg btn-success disabled float-right" name = "delete" > {% trans "Destroy" %}< / button >
2019-07-31 08:03:48 +00:00
{% endif %}
< div class = "clearfix" > < / div >
2015-03-12 14:15:36 +00:00
< / div >
< / div >
< / div >
< / div >
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
< / div >
2020-05-25 11:32:36 +00:00
{% if bottom_bar %}
{% include 'bottom_bar.html' %}
{% endif %}
2015-03-12 15:35:51 +00:00
{% endblock %}
{% block script %}
2020-05-14 16:59:22 +00:00
< script src = "{% static " js / ace / ace . js " % } " type = "text/javascript" charset = "utf-8" > < / script >
2018-10-24 09:04:05 +00:00
< script >
2018-11-23 12:18:32 +00:00
function get_volumes(compute_id, pool) {
get_vol_url = "/computes/" + compute_id + "/storage/" + pool + "/volumes";
$.getJSON(get_vol_url, function (data) {
$("#vols").find('option').remove();
$("#vols").removeAttr("disabled");
$.each(data['vols'], function(i, item) {
$("#vols").append('< option value = ' + item +' > ' + item + '< / option > ');
2019-01-15 12:55:05 +00:00
})
2018-11-23 12:18:32 +00:00
});
2018-10-24 09:04:05 +00:00
2018-10-25 06:57:41 +00:00
var sto_drop = document.getElementById('select_storage');
sto_drop.value = pool;
sto_drop.innerHTML = pool + "< span class = \"caret\" > < / span > ";
var sto_input = document.getElementById('selected_storage');
sto_input.value = pool;
sto_input.innerHTML = pool;
2018-10-24 09:04:05 +00:00
}
< / script >
2015-03-13 12:06:51 +00:00
< script >
var editor = ace.edit("editor");
editor.getSession().setMode("ace/mode/xml");
var input = $('input[name="inst_xml"]');
editor.getSession().on("change", function () {
input.val(editor.getSession().getValue());
});
< / script >
2015-03-12 15:35:51 +00:00
< script >
2018-08-14 12:11:49 +00:00
function open_console(view_style) {
2018-10-24 09:04:05 +00:00
window.open('{% url 'console' %}?token={{ compute_id }}-{{ uuid }}& view=' + view_style +'', '', 'width=850,height=600')
2015-03-12 15:35:51 +00:00
}
< / script >
2015-03-13 09:06:34 +00:00
< script >
function random_mac(net) {
2018-10-01 12:09:04 +00:00
$.getJSON('{% url 'random_mac_address' %}', function (data) {
2018-10-24 09:04:05 +00:00
$('input[name="' + net + '"]').val(data['mac']);
2018-07-26 09:35:37 +00:00
});
2020-03-16 13:59:45 +00:00
}
2015-03-13 09:06:34 +00:00
< / script >
< script >
function show_console() {
if ($('#console_show_pass').attr('type') == 'password') {
$('#console_show_pass').attr('type', 'text');
} else {
$('#console_show_pass').attr('type', 'password');
}
}
< / script >
2016-02-08 11:28:52 +00:00
< script >
2016-03-23 08:00:42 +00:00
function guess_mac_address(src_elem, net) {
new_vname = $(src_elem).val();
2018-10-01 12:09:04 +00:00
guess_mac_address_url = "{% url 'guess_mac_address' 1 %}".replace(1, new_vname);
$.getJSON(guess_mac_address_url, function(data) {
2016-02-10 16:52:50 +00:00
$('input[name="clone-net-mac-'+net+'"]').val(data['mac']);
2016-02-08 11:28:52 +00:00
});
}
< / script >
2016-05-27 12:13:24 +00:00
< script >
function guess_clone_name() {
2018-10-01 12:09:04 +00:00
$.getJSON('{% url 'guess_clone_name' %}', function(data) {
2016-05-27 12:13:24 +00:00
guessed_name = data['name'].split(".")[0];
$('#clone_name').val(guessed_name);
update_clone_disk_name(guessed_name);
2016-06-08 11:37:26 +00:00
guess_mac_address('#clone_name', 0);
2016-05-27 12:13:24 +00:00
});
}
< / script >
2016-02-08 09:17:01 +00:00
< script >
function update_clone_disk_name(new_vname) {
2018-09-11 13:11:13 +00:00
vname = '{{ vname }}';
{% for disk in disks %}
2019-03-19 11:39:34 +00:00
disk_name = '{{ disk.image }}';
2020-03-16 13:59:45 +00:00
disk_dot = disk_name.split('.');
2019-03-19 11:39:34 +00:00
disk_dot_suffix = disk_dot[disk_dot.length-1];
if (disk_name.startsWith(vname)) {
image = disk_name.replace(vname, new_vname);
} else if (disk_name.lastIndexOf('.') > -1 & & disk_dot_suffix.length < = 7) {
disk_dot.pop();
2020-03-16 13:59:45 +00:00
disk_name_only = disk_dot.join('-');
2019-03-19 11:39:34 +00:00
image = new_vname + "-" + disk_name_only + "." + disk_dot_suffix
} else if (new_vname != disk_name) {
image = new_vname
} else {
image = new_vname + '-clone';
}
$('#disk_name-{{ disk.dev }}').val(image);
2020-04-17 12:37:34 +00:00
{% endfor %}
2016-02-08 09:17:01 +00:00
}
< / script >
2015-03-13 09:06:34 +00:00
< script >
$(document).on('change', '#console_passwd_gen', function () {
if ($(this).prop('checked')) {
$('#console_passwd_manual').hide();
$('#console_passwd_clear').prop('checked', false);
} else {
$('#console_passwd_manual').show();
}
});
$(document).on('change', '#console_passwd_clear', function () {
if ($(this).prop('checked')) {
$('#console_passwd_manual').hide();
$('#console_passwd_gen').prop('checked', false);
} else {
$('#console_passwd_manual').show();
}
});
$(document).on('change', '#console_keymap_clear', function () {
if ($(this).prop('checked')) {
$('#console_keymap_selection').hide();
} else {
$('#console_keymap_selection').show();
}
});
2016-02-08 09:17:01 +00:00
$('#clone_name').on('input', function () {
update_clone_disk_name($(this).val());
});
2015-03-13 09:06:34 +00:00
$(document).ready(function () {
// set current console keymap or fall back to default
2020-03-16 13:59:45 +00:00
var keymap = "{{ console_keymap }}";
2015-03-13 09:06:34 +00:00
if (keymap != '') {
$("#console_select_keymap option[value='" + keymap + "']").prop('selected', true);
}
});
$(document).ready(function () {
// set current console type or fall back to default
2020-03-16 13:59:45 +00:00
var console_type = "{{ console_type }}";
2015-03-13 09:06:34 +00:00
if (console_type != '') {
$("#console_select_type option[value='" + console_type + "']").prop('selected', true);
}
});
2018-06-15 12:13:50 +00:00
$(document).ready(function () {
// set current console listen address or fall back to default
2020-03-16 13:59:45 +00:00
var console_listen_address = "{{ console_listen_address }}";
2018-06-15 12:13:50 +00:00
if (console_listen_address != '') {
$("#console_select_listen_address option[value='" + console_listen_address + "']").prop('selected', true);
2019-11-20 13:24:01 +00:00
}
});
$(document).ready(function () {
// get video model or fall back to default
2020-03-16 13:59:45 +00:00
let video_model = "{{ video_model }}";
2019-11-20 13:24:01 +00:00
if (video_model != '') {
$("#video_model_select option[value='" + video_model + "']").prop('selected', true);
2018-06-15 12:13:50 +00:00
}
});
2018-06-21 12:53:35 +00:00
$(document).ready(function () {
// set vdi url
2020-05-14 13:45:37 +00:00
$.get("{% url 'vdi_url' compute_id vname %}", function(data) {
2018-09-05 06:30:08 +00:00
$("#vdi_url_input").attr("value", data);
2018-06-21 12:53:35 +00:00
$("#vdi_url").attr("href", data);
});
});
2018-07-26 09:35:37 +00:00
{% if request.user.is_superuser %}
$(document).ready(function () {
2018-08-28 08:55:27 +00:00
random_mac('clone-net-mac-0');
random_mac('add-net-mac');
2018-09-11 13:11:13 +00:00
update_clone_disk_name($('#clone_name').val());
2018-07-26 09:35:37 +00:00
});
{% else %}
2016-03-23 08:00:42 +00:00
$('#select_clone_name').on('change', function () {
update_clone_disk_name($(this).val());
guess_mac_address('#select_clone_name', 0);
});
$(document).ready(function () {
update_clone_disk_name($('#select_clone_name').val());
guess_mac_address('#select_clone_name', 0);
});
{% endif %}
2015-03-13 09:06:34 +00:00
< / script >
2018-11-07 11:29:36 +00:00
< script >
2019-07-31 08:03:48 +00:00
$(document).ready(function(){
$('[data-toggle="popover"]').popover({
placement : 'top'
});
2018-11-07 11:29:36 +00:00
});
2019-01-15 12:55:05 +00:00
< / script >
< script >
function set_orderlist(obj){
var result = '';
$('#b_order label input:checked').each(function () {
if (result != '') result += ',';
result += $(this).val();
});
obj.val(result);
}
2019-07-31 08:03:48 +00:00
$(document).ready(function () {
2019-01-15 12:55:05 +00:00
{# Boot Order Arragements #}
jQuery.fn.multiselect = function() {
$(this).each(function() {
var checkboxes = $(this).find("input:checkbox");
checkboxes.each(function() {
var checkbox = $(this);
// Highlight pre-selected checkboxes
if (checkbox.prop("checked"))
checkbox.parent().addClass("multiselect-on");
// Highlight checkboxes that the user selects
checkbox.click(function() {
if (checkbox.prop("checked"))
checkbox.parent().addClass("multiselect-on");
else
checkbox.parent().removeClass("multiselect-on");
});
});
});
};
$(function() {
$(".multiselect").multiselect();
});
$('#boot_order_up').bind('click', function() {
$('#b_order label input:checked').each( function() {
var label = $(this).parent();
var newPos = label.index() - 1;
if (newPos > -1) {
$('#b_order label').eq(newPos).before("< label > < input type = 'checkbox' value = '"+$(this).val()+"' name = '"+$(this).val()+"' checked > "+$(this).parent().text()+"< / label > ");
label.remove();
}
$(".multiselect").multiselect();
});
set_orderlist($("#bootorder"));
});
$('#boot_order_down').bind('click', function() {
2020-05-20 13:18:27 +00:00
var countOptions = $('#b_order label').length;
var countSelected = $('#b_order label input:checked').length;
2019-01-15 12:55:05 +00:00
$('#b_order label input:checked').each( function() {
var label = $(this).parent();
var newPos = label.index() + countSelected;
if (newPos < countOptions ) {
$('#b_order label').eq(newPos).after("< label > < input type = 'checkbox' value = '"+$(this).val()+"' name = '"+$(this).val()+"' checked > "+$(this).parent().text()+"< / label > ");
label.remove();
}
$(".multiselect").multiselect();
});
set_orderlist($("#bootorder"));
});
});
2018-11-07 11:29:36 +00:00
< / script >
2015-03-13 09:06:34 +00:00
< script >
$(function () {
$('.js-custom__checkbox').change(function () {
var container = $(this).closest('.js-custom__container');
var toggles = container.find('.js-custom__toggle');
toggles.toggle();
});
});
< / script >
2019-05-21 06:12:28 +00:00
< script src = "{% static " js / Chart . bundle . min . js " % } " > < / script >
2015-03-20 10:06:32 +00:00
< script >
2015-03-23 09:23:17 +00:00
$('#chartgraphs').on('shown.bs.tab', function (event) {
2019-05-21 06:12:28 +00:00
var cpu_ctx = $("#cpuChart").get(0).getContext("2d");
var cpuChart = new Chart(cpu_ctx, {
type: 'line',
data: {
datasets : [{
backgroundColor: "rgba(44,127,184,0.5)",
label: "Usage"
}]
},
options: {
responsive: true,
legend: {
display: false
2015-03-20 10:06:32 +00:00
},
2019-05-21 06:12:28 +00:00
scales: {
xAxes:[{
offset: false,
ticks: {
beginAtZero: false,
autoSkip: true,
maxTicksLimit: 10,
maxRotation: 0,
minRotation: 0,
stepSize: 10,
},
}],
yAxes: [{
ticks: {
suggestedMax: 100,
suggestedMin: 0,
stepSize: 20,
callback: function(value, index, values) {
return value + ' %';
}
},
}],
2015-03-20 10:06:32 +00:00
},
2019-05-21 06:12:28 +00:00
tooltips: {
callbacks: {
label: function (tooltipItem, chart) {
var label = chart.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += ': ';
}
return label += tooltipItem.yLabel + ' %';
}
}
}
}
});
2015-03-20 10:06:32 +00:00
2019-05-21 06:12:28 +00:00
var mem_ctx = $("#memChart").get(0).getContext("2d");
var memChart = new Chart(mem_ctx, {
type: 'line',
data: {
datasets : [{
label: "Usage"
}]
},
options: {
responsive: true,
legend: {
display: false
},
scales: {
xAxes:[{
offset: false,
ticks: {
beginAtZero: false,
autoSkip: true,
maxTicksLimit: 10,
maxRotation: 0,
minRotation: 0,
stepSize: 10,
},
}],
yAxes: [{
ticks: {
suggestedMax: 100,
suggestedMin: 0,
stepSize: 20,
callback: function(value, index, values) {
return value + ' MB';
}
},
}],
},
tooltips: {
callbacks: {
label: function (tooltipItem, chart) {
var label = chart.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += '(RSS): ';
}
return label += tooltipItem.yLabel + ' MB';
}
}
}
}
});
2015-03-20 10:06:32 +00:00
var diskChart = {};
{% for disk in disks %}
var disk_ctx_{{ disk.dev }} = $("#blk{{ disk.dev }}Chart").get(0).getContext("2d");
2019-05-21 06:12:28 +00:00
diskChart['{{ disk.dev }}'] = new Chart(disk_ctx_{{ disk.dev }}, {
type: 'line',
data: {
datasets : [{
backgroundColor: "rgba(127,205,187,0.5)",
label: "Read"
},
{
backgroundColor: "rgba(44,127,184,0.5)",
label: "Write"
}]
},
options: {
responsive: true,
legend: {
display: false
},
scales: {
xAxes:[{
offset: false,
ticks: {
beginAtZero: false,
autoSkip: true,
maxTicksLimit: 10,
maxRotation: 0,
minRotation: 0,
stepSize: 10,
},
}],
yAxes: [{
ticks: {
suggestedmax: 100,
suggestedMin: 0,
callback: function(value, index, values) {
return value + ' Mb/s';
}
},
}],
},
tooltips: {
callbacks: {
label: function (tooltipItem, chart) {
var label = chart.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += ': ';
}
return label += tooltipItem.yLabel + ' Mb/s';
}
}
}
}
});
2015-03-20 10:06:32 +00:00
{% endfor %}
var netChart = {};
{% for net in networks %}
var net_ctx_{{ forloop.counter0 }} = $("#netEth{{ forloop.counter0 }}Chart").get(0).getContext("2d");
2020-03-16 13:59:45 +00:00
netChart[{{ forloop.counter0 }}] = new Chart(net_ctx_{{ forloop.counter0 }}, {
2019-05-21 06:12:28 +00:00
type: 'line',
data: {
datasets : [
{
backgroundColor: "rgba(127,205,187,0.5)",
label: "Inbound"
},
{
backgroundColor: "rgba(44,127,184,0.5)",
label: "Outbound"
}]
},
options: {
responsive: true,
legend: {
display: false
},
scales: {
xAxes:[{
offset: false,
ticks: {
beginAtZero: false,
autoSkip: true,
maxTicksLimit: 10,
maxRotation: 0,
minRotation: 0,
stepSize: 10,
},
}],
yAxes: [{
ticks: {
suggestedMax: 100,
suggestedMin: 0,
callback: function(value, index, values) {
return value + ' Mbps';
}
},
}],
},
tooltips: {
callbacks: {
label: function (tooltipItem, chart) {
var label = chart.datasets[tooltipItem.datasetIndex].label || '';
if (label) {
label += ': ';
}
return label += tooltipItem.yLabel + ' Mbps';
}
}
}
}
});
2015-03-20 10:06:32 +00:00
{% endfor %}
2020-05-14 16:34:28 +00:00
var graph_interval = window.setInterval(function graph_usage() {
2015-03-20 10:06:32 +00:00
$.getJSON('{% url 'inst_graph' compute_id vname %}', function (data) {
2019-05-21 06:12:28 +00:00
cpuChart.data.labels.push(data.timeline);
cpuChart.data.datasets[0].data.push(data.cpudata);
if (cpuChart.data.datasets[0].data.length > 10){
cpuChart.data.labels.shift();
cpuChart.data.datasets[0].data.shift();
2015-03-20 10:06:32 +00:00
}
cpuChart.update();
2019-05-21 06:12:28 +00:00
memChart.data.labels.push(data.timeline);
memChart.options.scales.yAxes[0].ticks.max = parseInt(data.memdata.total / 1024);
memChart.options.scales.yAxes[0].ticks.stepSize = parseInt(data.memdata.total / (1024 * 5));
memChart.data.datasets[0].data.push(data.memdata.used / 1024);
if (memChart.data.datasets[0].data.length > 10){
memChart.data.labels.shift();
memChart.data.datasets[0].data.shift();
2015-03-23 09:23:17 +00:00
}
2019-05-21 06:12:28 +00:00
memChart.update();
for (let j = 0; j < data.blkdata.length ; j + + ) {
diskChart[data.blkdata[j].dev].data.labels.push(data.timeline);
2015-03-20 10:06:32 +00:00
2020-03-16 13:59:45 +00:00
diskChart[data.blkdata[j].dev].data.datasets[0].data.push(data.blkdata[j].data[0]);
diskChart[data.blkdata[j].dev].data.datasets[1].data.push(data.blkdata[j].data[1]);
2019-05-21 06:12:28 +00:00
if (diskChart[data.blkdata[j].dev].data.datasets[0].data.length > 10){
diskChart[data.blkdata[j].dev].data.labels.shift();
diskChart[data.blkdata[j].dev].data.datasets[0].data.shift();
diskChart[data.blkdata[j].dev].data.datasets[1].data.shift();
2015-03-23 09:23:17 +00:00
}
2019-05-21 06:12:28 +00:00
diskChart[data.blkdata[j].dev].update();
}
2015-03-20 10:06:32 +00:00
2019-05-21 06:12:28 +00:00
for (let j = 0; j < data.netdata.length ; j + + ) {
netChart[data.netdata[j].dev].data.labels.push(data.timeline);
2020-03-16 13:59:45 +00:00
netChart[data.netdata[j].dev].data.datasets[0].data.push(data.netdata[j].data[0]);
netChart[data.netdata[j].dev].data.datasets[1].data.push(data.netdata[j].data[1]);
2019-05-21 06:12:28 +00:00
if (netChart[data.netdata[j].dev].data.datasets[0].data.length > 10){
netChart[data.netdata[j].dev].data.labels.shift();
netChart[data.netdata[j].dev].data.datasets[0].data.shift();
netChart[data.netdata[j].dev].data.datasets[1].data.shift();
}
2015-03-23 09:23:17 +00:00
netChart[data.netdata[j].dev].update();
}
});
2015-03-23 13:47:47 +00:00
}, 10000);
2015-03-23 09:23:17 +00:00
});
2015-03-24 07:22:30 +00:00
< / script >
< script >
2020-05-14 16:34:28 +00:00
backgroundJobRunning = false;
var status_interval = window.setInterval(function get_status() {
var status = {{ status|lower }};
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
if (data['status'] != status & & !backgroundJobRunning) {
window.location.reload()
}
});
}, 5000);
// Stop getting status info before delete instance
$('#delete_form').submit(function(){
window.clearInterval(status_interval);
return true;
});
2015-03-24 07:22:30 +00:00
< / script >
< script >
var hash = location.hash;
if (~$.inArray(hash, ['#poweron', '#poweroff', '#powercycle', '#suspend', '#resume'])) {
var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () {
if ($(this).attr('href') === '#power') {
$(this).trigger('click');
}
});
}
2019-08-27 14:18:33 +00:00
if (~$.inArray(hash, ['#resize', "resizevm_cpu", "resizevm_mem", "resizevm_disk"])) {
2015-03-24 07:22:30 +00:00
var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () {
if ($(this).attr('href') === '#resize') {
$(this).trigger('click');
}
});
}
2019-01-15 12:55:05 +00:00
if (~$.inArray(hash, ['#boot_opt', "#disks", '#network', '#clone', '#xmledit', '#vncsettings', '#migrate', '#options', '#users'])) {
2015-03-24 07:22:30 +00:00
var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () {
if ($(this).attr('href') === '#settings') {
$(this).trigger('click');
}
});
2015-04-21 12:40:18 +00:00
var btn = $('#settings>div>ul>li>a');
$(btn).each(function () {
if ($(this).attr('href') === hash) {
$(this).trigger('click');
}
});
}
2018-09-04 12:01:11 +00:00
if (~$.inArray(hash, ['#takesnapshot', '#managesnapshot'])) {
2015-04-21 12:40:18 +00:00
var btnsect = $('#navbtn>li>a');
$(btnsect).each(function () {
if ($(this).attr('href') === '#snapshots') {
$(this).trigger('click');
}
});
var btn = $('#snapshots>div>ul>li>a');
$(btn).each(function () {
if ($(this).attr('href') === hash) {
$(this).trigger('click');
}
});
2015-03-24 07:22:30 +00:00
}
< / script >
2017-12-11 14:07:01 +00:00
< script >
function update_logs_table(vname) {
2018-10-01 12:09:04 +00:00
logurl = "{% url 'vm_logs' 1 %}".replace(1, vname);
$.getJSON(logurl, function(data) {
2017-12-11 14:07:01 +00:00
var logs = "";
$.each(data, function(id) {
row = data[id];
console.log(row);
logs += '< tr > < td style = "width:150px" > '+row['date']+'< / td > ';
logs += '< td > '+row['user']+'< / td > ';
logs += '< td > '+row['message']+'< / td > < / tr > ';
});
$("#logs_table > tbody").html(logs);
});
}
< / script >
2015-07-09 07:41:56 +00:00
{% endblock %}