2015-03-06 07:42:25 +00:00
{% extends "base.html" %}
{% load i18n %}
2021-06-15 06:42:55 +00:00
{% load static %}
2023-08-09 06:20:18 +00:00
{% load bootstrap_icons %}
2020-10-15 14:18:45 +00:00
2015-03-06 11:59:27 +00:00
{% block title %}{% trans "Network" %} - {{ pool }}{% endblock %}
2020-10-15 14:18:45 +00:00
{% block page_heading %}{% trans "Network" %}: {{ pool }}{% endblock page_heading %}
2015-03-06 07:42:25 +00:00
{% block content %}
2019-07-31 08:03:48 +00:00
< div class = "row" >
< div class = "col-lg-12" >
2021-07-07 11:12:38 +00:00
< ol class = "breadcrumb shadow-sm" >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'overview' compute.id %}" > {% bs_icon 'laptop' %} {% trans "Overview" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'instances' compute.id %}" > {% bs_icon 'server' %} {% trans "Instances" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'storages' compute.id %}" > {% bs_icon 'device-hdd' %} {% trans "Storages" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'networks' compute.id %}" > {% bs_icon 'hdd-network' %} {% trans "Networks" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'interfaces' compute.id %}" > {% bs_icon 'wifi' %} {% trans "Interfaces" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'nwfilters' compute.id %}" > {% bs_icon 'filter' %} {% trans "NWFilters" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
2020-05-19 16:53:54 +00:00
< li class = "breadcrumb-item" >
2023-08-09 06:20:18 +00:00
< a href = "{% url 'virtsecrets' compute.id %}" > {% bs_icon 'key' %} {% trans "Secrets" %}< / a >
2019-07-31 08:03:48 +00:00
< / li >
< / ol >
2020-05-19 16:53:54 +00:00
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2015-03-06 07:42:25 +00:00
2019-07-31 08:03:48 +00:00
< div class = "row" >
2021-07-07 11:12:38 +00:00
< dl class = "ms-3 row" >
2020-05-19 16:53:54 +00:00
< dt class = "col-6" > {% trans "Network name" %}< / dt >
< dd class = "col-6" > {{ pool }}< / dd >
< dt class = "col-6" > {% trans "Device" %}< / dt >
< dd class = "col-6" > {{ device }}< / dd >
< dt class = "col-6" > {% trans "State" %}< / dt >
< dd class = "col-6" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Network start/stop/delete form" > {% csrf_token %}
2020-06-04 12:40:57 +00:00
{% if state == 0 %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-sm btn-success" name = "start" value = "{% trans " Start " % } " >
< input type = "submit" class = "btn btn-sm btn-danger" name = "delete" value = "{% trans " Delete " % } " onclick = "return confirm('{% trans " Are you sure ? " % } ' ) " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-sm btn-secondary" name = "stop" value = "{% trans " Stop " % } " onclick = "return confirm('{% trans " Are you sure ? " % } ' ) " >
2020-06-04 12:40:57 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
2020-05-19 16:53:54 +00:00
< / dd >
< dt class = "col-6" > {% trans "Autostart" %}< / dt >
< dd class = "col-6" >
2020-05-26 13:18:38 +00:00
< form action = "" method = "post" role = "form" aria-label = "Network enable/disable autostart form" > {% csrf_token %}
2020-06-04 12:40:57 +00:00
{% if autostart == 0 %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-sm btn-success" name = "set_autostart" value = "{% trans " Enable " % } " >
2019-07-31 08:03:48 +00:00
{% else %}
2020-05-19 16:53:54 +00:00
< input type = "submit" class = "btn btn-sm btn-secondary" name = "unset_autostart" onclick = "return confirm('{% trans " Are you sure ? " % } ' ) " value = "{% trans " Disable " % } " >
2020-06-04 12:40:57 +00:00
{% endif %}
2019-07-31 08:03:48 +00:00
< / form >
2020-05-19 16:53:54 +00:00
< / dd >
< / dl >
2019-07-31 08:03:48 +00:00
< / div >
2019-11-07 07:33:36 +00:00
2021-07-07 11:12:38 +00:00
< div class = "d-grid col-lg-12" >
< button class = "btn btn-light" role = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseXML" aria-expanded = "true" aria-controls = "collapseXML" >
2023-08-09 06:20:18 +00:00
< span > {% bs_icon 'chevron-down' %} < / span >
2020-05-19 16:53:54 +00:00
{% trans 'XML' %}
< / button >
< div class = "collapse" id = "collapseXML" >
< div class = "card card-body" >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "Network edit with XML form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< div id = "xmlheight" >
2019-07-31 08:03:48 +00:00
< input type = "hidden" name = "edit_xml" / >
< textarea id = "edit_editor" > {{ xml }}< / textarea >
2020-05-19 16:53:54 +00:00
< / div >
2021-07-07 11:12:38 +00:00
< button type = "submit" class = "btn btn-primary float-end" name = "edit_network" >
2019-07-31 08:03:48 +00:00
{% trans "Edit" %}
2020-05-19 16:53:54 +00:00
< / button >
< / form >
2019-01-24 12:02:19 +00:00
< / div >
2019-07-31 08:03:48 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< h5 class = "page-header" > {% trans "IPv4 Configuration" %}< / h5 >
2021-07-07 11:12:38 +00:00
< dl class = "ms-3 row" >
2020-05-19 16:53:54 +00:00
< dt class = "col-6" > {% trans "IPv4 Forwarding" %}< / dt >
< dd class = "col-6" >
2020-06-04 12:40:57 +00:00
{% if net_forward.0 == 'nat' %}
2020-05-19 16:53:54 +00:00
{% trans "NAT" %}
2020-06-04 12:40:57 +00:00
{% endif %}
{% if net_forward.0 == 'route' %}
2020-05-19 16:53:54 +00:00
{% trans "ROUTE" %}
2020-06-04 12:40:57 +00:00
{% endif %}
{% if net_forward.0 == 'bridge' %}
2020-05-19 16:53:54 +00:00
{% trans "BRIDGE" %}
2020-06-04 12:40:57 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
{% if not net_forward.0 %}
{% trans "ISOLATE" %}
{% endif %}
< / dd >
< dt class = "col-6" > {% trans "Network" %}< / dt >
< dd class = "col-6" > {{ ipv4_network|default:"-" }}< / dd >
< dt class = "col-6" > {% trans "DHCP" %}:< / dt >
< dd class = "col-6" >
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
< span class = "text-success" > {% trans "ON" %}< / span >
{% else %}
< span class = "text-danger" > {% trans "OFF" %}< / span >
{% endif %}
< / dd >
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
{% if state %}
< dt class = "col-6" > {% trans "Start" %}< / dt >
< dd class = "col-6" > {{ ipv4_dhcp_range_start }}< / dd >
< dt class = "col-6" > {% trans "End" %}< / dt >
< dd class = "col-6" > {{ ipv4_dhcp_range_end }}< / dd >
{% else %}
2021-07-07 11:12:38 +00:00
< form class = "col-lg-12 ps-0" method = "post" role = "form" aria-label = "Edit dhcp range form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< dt class = "col-6" > {% trans "Start" %}< / dt >
< dd class = "col-6" > < input name = "range_start" value = "{{ ipv4_dhcp_range_start }}" / > < / dd >
< dt class = "col-6" > {% trans "End" %}< / dt >
< dd class = "col-6" > < input name = "range_end" value = "{{ ipv4_dhcp_range_end }}" / > < / dd >
< dt class = "col-6" > < / dt >
< dd class = "col-6 " >
< input type = "submit"
class="btn btn-primary"
value="Apply"
name="modify_dhcp_range"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit DHCP Range" %}"
2020-05-19 16:53:54 +00:00
onclick="return confirm('{% trans "Are you sure?" %}')"/>
< / dd >
< input hidden name = "family" value = "ipv4" / >
< / form >
{% endif %}
{% endif %}
< / dl >
2019-11-07 07:33:36 +00:00
{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %}
2019-07-31 08:03:48 +00:00
{% if state %}
2019-11-07 07:33:36 +00:00
{% include 'modify_ipv4_fixed_address.html' %}
2019-07-31 08:03:48 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
2020-06-10 08:15:14 +00:00
< h5 class = "page-header" > {% trans "IPv4 Fixed Addresses" %}< / h5 >
2020-05-19 16:53:54 +00:00
2019-11-07 07:33:36 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
2019-11-07 07:33:36 +00:00
{% if ipv4_fixed_address %}
2020-05-19 16:53:54 +00:00
2021-07-07 11:12:38 +00:00
< div class = "d-grid col-12" >
< button class = "btn btn-light" role = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseipv4fix" aria-expanded = "true" aria-controls = "collapseXML" >
2023-08-09 06:20:18 +00:00
< span > {% bs_icon 'chevron-down' %} < / span >
2020-05-19 16:53:54 +00:00
{% trans 'Show' %}
< / button >
< div id = "collapseipv4fix" class = "collapse" >
2021-07-07 11:12:38 +00:00
< div class = "col-4 float-end mt-2" >
< div class = "input-group " >
2020-05-19 16:53:54 +00:00
< input type = "text" class = "form-control" id = "filter_input" >
2021-07-07 11:12:38 +00:00
< input type = "button" class = "btn btn-secondary" id = "filter_button" value = "Filter" >
< button type = "button" class = "btn btn-secondary" id = "filter_clear" > {% trans 'Clear' %}< / button >
2019-11-07 07:33:36 +00:00
< / div >
< / div >
2020-05-19 16:53:54 +00:00
< table id = "ipv4_table" class = "table table-hover" >
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "MAC" %}< / th >
< th scope = "col" > {% trans "Address" %}< / th >
< th scope = "col" > {% trans "Name" %}< / th >
< th scope = "col" > {% trans "Actions" %}< / th >
2020-05-19 16:53:54 +00:00
< / tr >
< / thead >
< tbody >
{% for fix4 in ipv4_fixed_address %}
< tr >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "IPv4 edit/delete form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< td > < input class = "form-control" value = "{{ fix4.mac }}" name = "mac" readonly / > < / td >
< td > < input class = "form-control" value = "{{ fix4.ip }}" name = "address" / > < / td >
< td > < input class = "form-control" value = "{{ fix4.name }}" name = "name" / > < / td >
< td class = "text-nowrap" >
< input hidden name = "family" value = "ipv4" / >
< button type = "submit" class = "btn btn-sm btn-primary"
name="modify_fixed_address"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit entry" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
{% bs_icon 'save' %}
2020-05-19 16:53:54 +00:00
< / button >
< button type = "submit" class = "btn btn-sm btn-danger"
name="delete_fixed_address"
2020-05-20 13:18:27 +00:00
title="{% trans "Delete entry" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
{% bs_icon 'trash' %}
2020-05-19 16:53:54 +00:00
< / button >
< / td >
< / form >
< / tr >
{% endfor %}
< / tbody >
< / table >
< / div >
2019-11-07 07:33:36 +00:00
< / div >
{% endif %}
2020-05-19 16:53:54 +00:00
< h5 class = "page-header" > {% trans "IPv6 Configuration" %}< / h5 >
2019-11-07 07:33:36 +00:00
2021-07-07 11:12:38 +00:00
< dl class = "ms-3 row" >
2020-05-19 16:53:54 +00:00
< dt class = "col-6" > {% trans "IPv6 Forwarding" %}< / dt >
< dd class = "col-6" >
{% if not net_forward.0 %}
{% trans "ISOLATE" %}
{% else %}
{% trans "ROUTE" %}
{% endif %}
< / dd >
< dt class = "col-6" > {% trans "Network" %}< / dt >
< dd class = "col-6" > {{ ipv6_network|default:"-" }}< / dd >
< dt class = "col-6" > {% trans "DHCP" %}< / dt >
< dd class = "col-6" >
{% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %}
< span class = "text-success" > {% trans "ON" %}< / span >
{% else %}
< span class = "text-danger" > {% trans "OFF" %}< / span >
{% endif %}
< / dd >
{% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %}
{% if state %}
< dt class = "col-6" > {% trans "Start" %}< / dt >
< dd class = "col-6" > {{ ipv6_dhcp_range_start }}< / dd >
< dt class = "col-6" > {% trans "End" %}< / dt >
< dd class = "col-6" > {{ ipv6_dhcp_range_end }}< / dd >
{% else %}
2021-07-07 11:12:38 +00:00
< form class = "col-lg-12 ps-0" method = "post" role = "form" aria-label = "Edit dhcp range form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< dt class = "col-6" > {% trans "Start" %}< / dt >
< dd class = "col-6" > < input name = "range_start" value = "{{ ipv6_dhcp_range_start }}" / > < / dd >
< dt class = "col-6" > {% trans "End" %}< / dt >
< dd class = "col-6" > < input name = "range_end" value = "{{ ipv6_dhcp_range_end }}" / > < / dd >
< dt class = "col-6" > < / dt >
2021-07-07 11:12:38 +00:00
< dd class = "d-grid col-6" >
2020-05-19 16:53:54 +00:00
< input
type="submit"
2021-07-07 11:12:38 +00:00
class="btn btn-primary"
2020-05-19 16:53:54 +00:00
value="Apply"
name="modify_dhcp_range"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit DHCP Range" %}"
2020-05-19 16:53:54 +00:00
onclick="return confirm('{% trans "Are you sure?" %}')"/>
< / dd >
< input hidden name = "family" value = "ipv6" / >
< / form >
{% endif %}
{% endif %}
< / dl >
{% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %}
2019-11-07 07:33:36 +00:00
{% if state %}
{% include 'modify_ipv6_fixed_address.html' %}
{% endif %}
2020-06-10 08:15:14 +00:00
< h5 class = "page-header" > {% trans "IPv6 Fixed Addresses" %}< / h5 >
2019-11-07 07:33:36 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
{% if ipv6_fixed_address %}
2021-07-07 11:12:38 +00:00
< div class = "d-grid col-12" >
< button class = "btn btn-light" role = "button" data-bs-toggle = "collapse" data-bs-target = "#collapseipv6fix" aria-expanded = "true" aria-controls = "collapseipv6fix" >
2023-08-09 06:20:18 +00:00
< span > {% bs_icon 'chevron-down' %} < / span >
2020-05-19 16:53:54 +00:00
{% trans 'Show' %}
< / button >
< div id = "collapseipv6fix" class = "collapse" >
2021-07-07 11:12:38 +00:00
< div class = "col-4 float-end mt-2" >
< div class = "input-group" >
2020-05-19 16:53:54 +00:00
< input type = "text" class = "form-control" id = "filter_input_ipv6" >
2021-07-07 11:12:38 +00:00
< input type = "button" class = "btn btn-secondary" id = "filter_button_ipv6" value = "Filter" >
< button type = "button" class = "btn btn-secondary" id = "filter_clear_ipv6" > {% trans 'Clear' %}< / button >
2015-03-06 07:42:25 +00:00
< / div >
2019-01-24 12:02:19 +00:00
< / div >
2020-05-19 16:53:54 +00:00
< table id = "ipv6_table" class = "table table-hover" >
2019-11-20 05:42:09 +00:00
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "ID" %}< / th >
< th scope = "col" > {% trans "Address" %}< / th >
< th scope = "col" > {% trans "Name" %}< / th >
< th scope = "col" > {% trans "Actions" %}< / th >
2019-11-20 05:42:09 +00:00
< / tr >
< / thead >
< tbody >
2020-05-19 16:53:54 +00:00
{% for fix6 in ipv6_fixed_address %}
< tr >
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "IP v6 edit/delete form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< td > < input class = "form-control" value = "{{ fix6.id }}" name = "id" readonly / > < / td >
< td > < input class = "form-control" value = "{{ fix6.ip }}" name = "address" / > < / td >
< td > < input class = "form-control" value = "{{ fix6.name }}" name = "name" / > < / td >
< td class = "text-nowrap" >
< input hidden name = "family" value = "ipv6" / >
2019-11-20 05:42:09 +00:00
< button type = "submit" class = "btn btn-sm btn-primary"
2020-05-19 16:53:54 +00:00
name="modify_fixed_address"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit entry" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
< span > {% bs_icon 'save' %} < / span >
2019-11-20 05:42:09 +00:00
< / button >
< button type = "submit" class = "btn btn-sm btn-danger"
2020-05-19 16:53:54 +00:00
name="delete_fixed_address"
2020-05-20 13:18:27 +00:00
title="{% trans "Delete entry" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
< span > {% bs_icon 'trash' %} < / span >
2019-11-20 05:42:09 +00:00
< / button >
< / td >
2020-05-19 16:53:54 +00:00
< / form >
< / tr >
2019-11-20 05:42:09 +00:00
{% endfor %}
< / tbody >
< / table >
< / div >
2019-11-15 08:44:48 +00:00
< / div >
2019-11-20 05:42:09 +00:00
{% endif %}
2020-05-19 16:53:54 +00:00
{% if net_forward.0 == 'route' or net_forward.0 == 'nat' or net_forward.0 == 'isolated' %}
{% if state == 0 and qos.items|length != 2%}
2020-05-26 13:18:38 +00:00
< form method = "post" name = "set_qos" role = "form" aria-label = "Create network qos form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
{% include 'add_network_qos.html' %}
< / form >
{% endif %}
2020-05-20 13:18:27 +00:00
< h5 class = "page-header" > {% trans "QoS Configuration" %}< / h5 >
2020-05-19 16:53:54 +00:00
< div class = "col-sm-12" >
< table class = "table table-hover" >
< thead >
< tr >
2020-05-26 10:52:52 +00:00
< th scope = "col" > {% trans "Direction" %}< / th >
< th scope = "col" > {% trans "Average" %}< / th >
< th scope = "col" > {% trans "Peak" %}< / th >
< th scope = "col" > {% trans "Burst" %}< / th >
< th scope = "col" > {% trans "Actions" %}< / th >
2020-05-19 16:53:54 +00:00
< / tr >
< / thead >
< tbody >
{% for q, att in qos.items %}
2020-05-26 13:18:38 +00:00
< form method = "post" role = "form" aria-label = "QoS configuration form" > {% csrf_token %}
2020-05-19 16:53:54 +00:00
< tr >
< td > < label class = "col-form-label" > {{ q | capfirst }}< / label > < / td >
< td > < input id = "qos_average" class = "form-control" name = "qos_average"
value="{{ att.average|default:'' }}"/>
< / td >
< td > < input id = "qos_peak" class = "form-control" name = "qos_peak"
value="{{ att.peak|default:'' }}"/>
< / td >
< td > < input id = "qos_burst" class = "form-control" name = "qos_burst"
value="{{ att.burst|default:'' }}"/>
< / td >
< td class = "text-nowrap" >
< input name = "qos_direction" value = "{{ q }}" hidden / >
< button type = "submit" class = "btn btn-sm btn-primary"
2021-07-07 11:12:38 +00:00
name="set_qos" data-bs-toggle="modal"
2020-05-20 13:18:27 +00:00
title="{% trans "Edit QoS" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
{% bs_icon 'save' %}
2020-05-19 16:53:54 +00:00
< / button >
< button type = "submit" class = "btn btn-sm btn-danger"
name="unset_qos"
2020-05-20 13:18:27 +00:00
title="{% trans "Delete QoS" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
2023-08-09 06:20:18 +00:00
{% bs_icon 'trash' %}
2020-05-19 16:53:54 +00:00
< / button >
< / td >
< / tr >
< / form >
{% endfor %}
< / tbody >
< / table >
< / div >
{% endif %}
2015-03-06 07:42:25 +00:00
{% endblock %}
{% block script %}
2015-04-06 07:51:50 +00:00
< script >
$.expr[':'].Contains = $.expr.createPseudo(function (arg) {
return function (elem) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
$(document).ready(function () {
// add event button labeled "filter"
$('#filter_button').click(function (event) {
// get value
2019-11-07 07:33:36 +00:00
let filter_val = $('#filter_input').val();
2015-04-06 07:51:50 +00:00
if (filter_val == '') {
// show all
2019-11-07 07:33:36 +00:00
$('#ipv4_table tbody tr').show();
2015-04-06 07:51:50 +00:00
} else {
// hide non-matching items
2019-11-07 07:33:36 +00:00
let row_not_contains4 = $('#ipv4_table tbody tr input:not([value*=\'' + filter_val + '\'])');
row_not_contains4.closest('tr').hide();
// show only matches
let row_contains4 = $('#ipv4_table tbody tr input[value*=\'' + filter_val + '\']');
row_contains4.closest('tr').show();
2015-04-06 07:51:50 +00:00
}
2015-03-06 07:42:25 +00:00
});
2015-04-06 07:51:50 +00:00
// add event button labeled "clear"
$('#filter_clear').click(function (event) {
$('#filter_input').val('');
$('#filter_button').click();
});
2015-03-06 07:42:25 +00:00
2015-04-06 07:51:50 +00:00
// trigger filter when enter key pressed
$('#filter_input').keyup(function (event) {
if (event.keyCode == 13) {
2015-03-06 07:42:25 +00:00
$('#filter_button').click();
2015-04-06 07:51:50 +00:00
}
2015-03-06 07:42:25 +00:00
});
2019-11-07 07:33:36 +00:00
// add event button labeled "filter"
$('#filter_button_ipv6').click(function (event) {
// get value
let filter_val = $('#filter_input_ipv6').val();
if (filter_val == '') {
// show all
$('#ipv6_table tbody tr').show();
} else {
// hide non-matching items
let row_not_contains6 = $('#ipv6_table tbody tr input:not([value*=\'' + filter_val + '\'])');
row_not_contains6.closest('tr').hide();
// show only matches
let row_contains6 = $('#ipv6_table tbody tr input[value*=\'' + filter_val + '\']');
row_contains6.closest('tr').show();
}
});
// add event button labeled "clear"
$('#filter_clear_ipv6').click(function (event) {
$('#filter_input_ipv6').val('');
$('#filter_button_ipv6').click();
});
// trigger filter when enter key pressed
$('#filter_input_ipv6').keyup(function (event) {
if (event.keyCode == 13) {
$('#filter_button_ipv6').click();
}
});
2015-04-06 07:51:50 +00:00
});
< / script >
2020-05-14 16:59:22 +00:00
< script src = "{% static " js / ace / ace . js " % } " > < / script >
2019-01-24 12:02:19 +00:00
< script >
var editor = ace.edit("edit_editor");
editor.getSession().setMode("ace/mode/xml");
var edit_input = $('input[name="edit_xml"]');
editor.getSession().on("change", function () {
edit_input.val(editor.getSession().getValue());
});
< / script >
2015-03-06 07:42:25 +00:00
{% endblock %}