mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
323 lines
15 KiB
HTML
323 lines
15 KiB
HTML
{% extends 'base.html' %}
|
|
{% load buttons %}
|
|
{% load custom_links %}
|
|
{% load static %}
|
|
{% load helpers %}
|
|
{% load plugins %}
|
|
|
|
{% block header %}
|
|
<div class="row noprint">
|
|
<div class="col-sm-8 col-md-9">
|
|
<ol class="breadcrumb">
|
|
{% if object.cluster %}
|
|
<li><a href="{{ object.cluster.get_absolute_url }}">{{ object.cluster }}</a></li>
|
|
{% endif %}
|
|
<li>{{ object }}</li>
|
|
</ol>
|
|
</div>
|
|
<div class="col-sm-4 col-md-3">
|
|
<form action="{% url 'virtualization:virtualmachine_list' %}" method="get">
|
|
<div class="input-group">
|
|
<input type="text" name="q" class="form-control" placeholder="Search virtual machines" />
|
|
<span class="input-group-btn">
|
|
<button type="submit" class="btn btn-primary">
|
|
<span class="mdi mdi-magnify"></span>
|
|
</button>
|
|
</span>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="pull-right noprint">
|
|
{% if perms.virtualization.add_vminterface %}
|
|
<a href="{% url 'virtualization:vminterface_add' %}?virtual_machine={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary">
|
|
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add Interfaces
|
|
</a>
|
|
{% endif %}
|
|
{% plugin_buttons object %}
|
|
{% if perms.virtualization.add_virtualmachine %}
|
|
{% clone_button object %}
|
|
{% endif %}
|
|
{% if perms.virtualization.change_virtualmachine %}
|
|
{% edit_button object %}
|
|
{% endif %}
|
|
{% if perms.virtualization.delete_virtualmachine %}
|
|
{% delete_button object %}
|
|
{% endif %}
|
|
</div>
|
|
<h1>{% block title %}{{ object }}{% endblock %}</h1>
|
|
{% include 'inc/created_updated.html' %}
|
|
<div class="pull-right noprint">
|
|
{% custom_links object %}
|
|
</div>
|
|
<ul class="nav nav-tabs">
|
|
<li role="presentation"{% if not active_tab %} class="active"{% endif %}>
|
|
<a href="{{ object.get_absolute_url }}">Virtual Machine</a>
|
|
</li>
|
|
{% if perms.extras.view_configcontext %}
|
|
<li role="presentation"{% if active_tab == 'config-context' %} class="active"{% endif %}>
|
|
<a href="{% url 'virtualization:virtualmachine_configcontext' pk=object.pk %}">Config Context</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if perms.extras.view_objectchange %}
|
|
<li role="presentation"{% if active_tab == 'changelog' %} class="active"{% endif %}>
|
|
<a href="{% url 'virtualization:virtualmachine_changelog' pk=object.pk %}">Change Log</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Virtual Machine</strong>
|
|
</div>
|
|
<table class="table table-hover panel-body attr-table">
|
|
<tr>
|
|
<td>Name</td>
|
|
<td>{{ object }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Status</td>
|
|
<td>
|
|
<span class="label label-{{ object.get_status_class }}">{{ object.get_status_display }}</span>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Role</td>
|
|
<td>
|
|
{% if object.role %}
|
|
<a href="{% url 'virtualization:virtualmachine_list' %}?role={{ object.role.slug }}">{{ object.role }}</a>
|
|
{% else %}
|
|
<span class="text-muted">None</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Platform</td>
|
|
<td>
|
|
{% if object.platform %}
|
|
<a href="{% url 'virtualization:virtualmachine_list' %}?platform={{ object.platform.slug }}">{{ object.platform }}</a>
|
|
{% else %}
|
|
<span class="text-muted">None</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Tenant</td>
|
|
<td>
|
|
{% if object.tenant %}
|
|
{% if object.tenant.group %}
|
|
<a href="{{ object.tenant.group.get_absolute_url }}">{{ object.tenant.group }}</a> /
|
|
{% endif %}
|
|
<a href="{{ object.tenant.get_absolute_url }}">{{ object.tenant }}</a>
|
|
{% else %}
|
|
<span class="text-muted">None</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Primary IPv4</td>
|
|
<td>
|
|
{% if object.primary_ip4 %}
|
|
<a href="{% url 'ipam:ipaddress' pk=object.primary_ip4.pk %}">{{ object.primary_ip4.address.ip }}</a>
|
|
{% if object.primary_ip4.nat_inside %}
|
|
<span>(NAT for {{ object.primary_ip4.nat_inside.address.ip }})</span>
|
|
{% elif object.primary_ip4.nat_outside %}
|
|
<span>(NAT: {{ object.primary_ip4.nat_outside.address.ip }})</span>
|
|
{% endif %}
|
|
{% else %}
|
|
<span class="text-muted">—</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Primary IPv6</td>
|
|
<td>
|
|
{% if object.primary_ip6 %}
|
|
<a href="{% url 'ipam:ipaddress' pk=object.primary_ip6.pk %}">{{ object.primary_ip6.address.ip }}</a>
|
|
{% if object.primary_ip6.nat_inside %}
|
|
<span>(NAT for {{ object.primary_ip6.nat_inside.address.ip }})</span>
|
|
{% elif object.primary_ip6.nat_outside %}
|
|
<span>(NAT: {{ object.primary_ip6.nat_outside.address.ip }})</span>
|
|
{% endif %}
|
|
{% else %}
|
|
<span class="text-muted">—</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
{% include 'inc/custom_fields_panel.html' %}
|
|
{% include 'extras/inc/tags_panel.html' with tags=object.tags.all url='virtualization:virtualmachine_list' %}
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Comments</strong>
|
|
</div>
|
|
<div class="panel-body rendered-markdown">
|
|
{% if object.comments %}
|
|
{{ object.comments|render_markdown }}
|
|
{% else %}
|
|
<span class="text-muted">None</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% plugin_left_page object %}
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Cluster</strong>
|
|
</div>
|
|
<table class="table table-hover panel-body attr-table">
|
|
<tr>
|
|
<td>Cluster</td>
|
|
<td>
|
|
{% if object.cluster.group %}
|
|
<a href="{{ object.cluster.group.get_absolute_url }}">{{ object.cluster.group }}</a> /
|
|
{% endif %}
|
|
<a href="{{ object.cluster.get_absolute_url }}">{{ object.cluster }}</a>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Cluster Type</td>
|
|
<td>{{ object.cluster.type }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Resources</strong>
|
|
</div>
|
|
<table class="table table-hover panel-body attr-table">
|
|
<tr>
|
|
<td><i class="mdi mdi-gauge"></i> Virtual CPUs</td>
|
|
<td>{{ object.vcpus|placeholder }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i class="mdi mdi-chip"></i> Memory</td>
|
|
<td>
|
|
{% if object.memory %}
|
|
{{ object.memory }} MB
|
|
{% else %}
|
|
<span class="text-muted">—</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><i class="mdi mdi-harddisk"></i> Disk Space</td>
|
|
<td>
|
|
{% if object.disk %}
|
|
{{ object.disk }} GB
|
|
{% else %}
|
|
<span class="text-muted">—</span>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
{% if perms.secrets.view_secret %}
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Secrets</strong>
|
|
</div>
|
|
{% include 'secrets/inc/assigned_secrets.html' %}
|
|
{% if perms.secrets.add_secret %}
|
|
<div class="panel-footer text-right noprint">
|
|
<a href="{% url 'secrets:secret_add' %}?virtual_machine={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-xs btn-primary">
|
|
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add secret
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Services</strong>
|
|
</div>
|
|
{% if services %}
|
|
<table class="table table-hover panel-body">
|
|
{% for service in services %}
|
|
{% include 'ipam/inc/service.html' %}
|
|
{% endfor %}
|
|
</table>
|
|
{% else %}
|
|
<div class="panel-body text-muted">
|
|
None
|
|
</div>
|
|
{% endif %}
|
|
{% if perms.ipam.add_service %}
|
|
<div class="panel-footer text-right noprint">
|
|
<a href="{% url 'virtualization:virtualmachine_service_assign' virtualmachine=object.pk %}" class="btn btn-xs btn-primary">
|
|
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Assign service
|
|
</a>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% plugin_right_page object %}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
{% plugin_full_width_page object %}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
<input type="hidden" name="virtual_machine" value="{{ object.pk }}" />
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<strong>Interfaces</strong>
|
|
<div class="pull-right noprint">
|
|
{% if request.user.is_authenticated %}
|
|
<button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#VirtualMachineVMInterfaceTable_config" title="Configure table"><i class="mdi mdi-cog"></i> Configure</button>
|
|
{% endif %}
|
|
</div>
|
|
<div class="pull-right col-md-2 noprint">
|
|
<input class="form-control interface-filter" type="text" placeholder="Filter" title="Filter text (regular expressions supported)" style="height: 23px" />
|
|
</div>
|
|
</div>
|
|
{% include 'responsive_table.html' with table=vminterface_table %}
|
|
{% if perms.virtualization.add_vminterface or perms.virtualization.delete_vminterface %}
|
|
<div class="panel-footer noprint">
|
|
{% if interfaces and perms.virtualization.change_vminterface %}
|
|
<button type="submit" name="_rename" formaction="{% url 'virtualization:vminterface_bulk_rename' %}?return_url={{ object.get_absolute_url }}" class="btn btn-warning btn-xs">
|
|
<span class="mdi mdi-pencil" aria-hidden="true"></span> Rename
|
|
</button>
|
|
<button type="submit" name="_edit" formaction="{% url 'virtualization:vminterface_bulk_edit' %}?return_url={{ object.get_absolute_url }}" class="btn btn-warning btn-xs">
|
|
<span class="mdi mdi-pencil" aria-hidden="true"></span> Edit
|
|
</button>
|
|
{% endif %}
|
|
{% if interfaces and perms.virtualization.delete_vminterface %}
|
|
<button type="submit" name="_delete" formaction="{% url 'virtualization:vminterface_bulk_delete' %}?return_url={{ object.get_absolute_url }}" class="btn btn-danger btn-xs">
|
|
<span class="mdi mdi-trash-can-outline" aria-hidden="true"></span> Delete
|
|
</button>
|
|
{% endif %}
|
|
{% if perms.virtualization.add_vminterface %}
|
|
<div class="pull-right">
|
|
<a href="{% url 'virtualization:vminterface_add' %}?virtual_machine={{ object.pk }}&return_url={{ object.get_absolute_url }}" class="btn btn-primary btn-xs">
|
|
<span class="mdi mdi-plus-thick" aria-hidden="true"></span> Add interfaces
|
|
</a>
|
|
</div>
|
|
<div class="clearfix"></div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|
|
{% table_config_form vminterface_table %}
|
|
</div>
|
|
</div>
|
|
{% include 'secrets/inc/private_key_modal.html' %}
|
|
{% endblock %}
|
|
|
|
{% block javascript %}
|
|
<script src="{% static 'js/interface_filtering.js' %}?v{{ settings.VERSION }}"></script>
|
|
<script src="{% static 'js/secrets.js' %}?v{{ settings.VERSION }}"></script>
|
|
<script src="{% static 'js/tableconfig.js' %}?v{{ settings.VERSION }}"></script>
|
|
{% endblock %}
|