2017-08-04 17:02:52 -04:00
{% extends '_base.html' %}
2018-02-02 16:12:57 -05:00
{% load buttons %}
2017-08-04 17:02:52 -04:00
{% block content %}
< div class = "pull-right" >
{% if perms.virtualization.add_virtualmachine %}
2018-02-02 16:12:57 -05:00
{% add_button 'virtualization:virtualmachine_add' %}
{% import_button 'virtualization:virtualmachine_import' %}
2017-08-04 17:02:52 -04:00
{% endif %}
2018-02-02 16:12:57 -05:00
{% export_button content_type %}
2017-08-04 17:02:52 -04:00
< / div >
< h1 > {% block title %}Virtual Machines{% endblock %}< / h1 >
< div class = "row" >
< div class = "col-md-9" >
2017-09-12 12:49:01 -04:00
{% include 'virtualization/inc/virtualmachine_table.html' with bulk_edit_url='virtualization:virtualmachine_bulk_edit' bulk_delete_url='virtualization:virtualmachine_bulk_delete' %}
2017-08-04 17:02:52 -04:00
< / div >
< div class = "col-md-3" >
{% include 'inc/search_panel.html' %}
2018-05-18 15:43:21 -04:00
{% include 'inc/tags_panel.html' %}
2017-08-04 17:02:52 -04:00
< / div >
< / div >
{% endblock %}
2017-08-16 17:00:17 -04:00
{% block javascript %}
< script type = "text/javascript" >
$(document).ready(function() {
var cluster_group_list = $('#id_cluster_group');
var cluster_list = $('#id_cluster_id');
// Update cluster options based on selected group
cluster_group_list.change(function() {
var selected_groups = $(this).val();
if (selected_groups) {
cluster_list.empty();
$.ajax({
url: netbox_api_path + 'virtualization/clusters/?limit=500& group=' + selected_groups.join('& group='),
dataType: 'json',
success: function (response, status) {
$.each(response["results"], function (index, cluster) {
var option = $("< option > < / option > ").attr("value", cluster.id).text(cluster.name);
cluster_list.append(option);
});
}
});
}
});
});
< / script >
{% endblock %}