1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

bootstrap 4.5 fixations & Update strings style to f-string

This commit is contained in:
catborise 2020-05-22 01:13:39 +03:00 committed by catborise
parent ccd947a04c
commit 7c93ee1e2f
12 changed files with 60 additions and 61 deletions

View file

@ -16,7 +16,7 @@
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h3 class="page-header">{% trans "Edit Profile" %}</h3> <h3 class="page-header">{% trans "Edit Profile" %}</h3>
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %} <form method="post" action="" role="form">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 col-form-label">{% trans "Login" %}</label> <label class="col-sm-2 col-form-label">{% trans "Login" %}</label>
<div class="col-sm-4"> <div class="col-sm-4">
@ -43,7 +43,7 @@
</form> </form>
{% if perms.accounts.change_password %} {% if perms.accounts.change_password %}
<h3 class="page-header">{% trans "Edit Password" %}</h3> <h3 class="page-header">{% trans "Edit Password" %}</h3>
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %} <form method="post" action="" role="form">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 col-form-label">{% trans "Old" %}</label> <label class="col-sm-2 col-form-label">{% trans "Old" %}</label>
<div class="col-sm-4"> <div class="col-sm-4">
@ -93,7 +93,7 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %} <form method="post" action="" role="form">{% csrf_token %}
<div class="form-group bridge_name_form_group_dhcp"> <div class="form-group bridge_name_form_group_dhcp">
<label class="col-sm-2 col-form-label">{% trans "Key name" %}</label> <label class="col-sm-2 col-form-label">{% trans "Key name" %}</label>
<div class="col-sm-4"> <div class="col-sm-4">
@ -114,7 +114,7 @@
</form> </form>
{% if request.user.is_superuser %} {% if request.user.is_superuser %}
<h3 class="page-header">{% trans "Themes" %}</h3> <h3 class="page-header">{% trans "Themes" %}</h3>
<form class="form-horizontal" method="post" action="" role="form">{% csrf_token %} <form method="post" action="" role="form">{% csrf_token %}
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 col-form-label">{% trans "Themes" %}</label> <label class="col-sm-2 col-form-label">{% trans "Themes" %}</label>
<div class="col-sm-4"> <div class="col-sm-4">

View file

@ -1,7 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load staticfiles %} {% load staticfiles %}
{% block title %}{% trans "Create new instance - Select Type" %}{% endblock %} {% block title %}{% trans "Create new instanc" %} - {% trans "Select Type" %}{% endblock %}
{% block content %} {% block content %}
<!-- Page Heading --> <!-- Page Heading -->
@ -84,7 +84,7 @@
</div> </div>
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="addFromXML"> <div role="tabpanel" class="tab-pane tab-pane-bordered" id="addFromXML">
<div class="well"> <div class="well">
<form class="form-horizontal" method="post" role="form">{% csrf_token %} <form method="post" role="form">{% csrf_token %}
<div class="col-sm-12" id="xmlheight"> <div class="col-sm-12" id="xmlheight">
<input type="hidden" name="dom_xml"/> <input type="hidden" name="dom_xml"/>
<textarea id="editor"></textarea> <textarea id="editor"></textarea>

View file

@ -286,7 +286,7 @@
</a> </a>
</td> </td>
<td style="width:5px;"> <td style="width:5px;">
<form class="form-horizontal" action="" method="post" role="form">{% csrf_token %} <form action="" method="post" role="form">{% csrf_token %}
<input type="hidden" name="flavor" value="{{ flavor.id }}"> <input type="hidden" name="flavor" value="{{ flavor.id }}">
<button type="submit" class="btn btn-sm btn-secondary" name="delete_flavor" onclick="return confirm('{% trans "Are you sure?" %}')"> <button type="submit" class="btn btn-sm btn-secondary" name="delete_flavor" onclick="return confirm('{% trans "Are you sure?" %}')">
<span class="fa fa-trash"></span> <span class="fa fa-trash"></span>
@ -373,7 +373,7 @@
<div class="col-sm-3"> <div class="col-sm-3">
<select id="storage-control" name="storage-control" class="form-control" onchange="get_cust_vols({{ compute_id }}, value);"> <select id="storage-control" name="storage-control" class="form-control" onchange="get_cust_vols({{ compute_id }}, value);">
{% if storages %} {% if storages %}
<option value disabled selected>{% trans "Select pool..." %}</option> <option value disabled selected>{% trans "Select pool" %}...</option>
{% for storage in storages %} {% for storage in storages %}
<option value="{{ storage }}" >{{ storage }}</option> <option value="{{ storage }}" >{{ storage }}</option>
{% endfor %} {% endfor %}

View file

@ -15,7 +15,7 @@
<div class="modal-body"> <div class="modal-body">
<form method="post" action="" role="form">{% csrf_token %} <form method="post" action="" role="form">{% csrf_token %}
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans "Mac" %}</label> <label class="col-sm-4 col-form-label">{% trans "MAC" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<input type="text" class="form-control" name="add-net-mac"> <input type="text" class="form-control" name="add-net-mac">
</div> </div>

View file

@ -100,13 +100,12 @@
<label class="col-sm-3 col-form-label">{% trans "Storage" %}</label> <label class="col-sm-3 col-form-label">{% trans "Storage" %}</label>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="dropdown"> <div class="dropdown">
<button id="select_storage" class="btn btn-secondary dropdown-toggle form-control" type="button" data-toggle="dropdown">{% trans 'Select Pool...' %} <button id="select_storage" class="btn btn-secondary dropdown-toggle form-control" type="button" data-toggle="dropdown">{% trans 'Select Pool' %}...</button>
<span class="caret"></span></button> <div class="dropdown-menu">
<ul class="dropdown-menu">
{% for storage in storages_host %} {% for storage in storages_host %}
<li><a href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a></li> <a class="dropdown-item" href="#" onclick="get_volumes({{ compute_id }}, '{{ storage }}')">{{ storage }}</a>
{% endfor %} {% endfor %}
</ul> </div>
<input id="selected_storage" name="selected_storage" hidden/> <input id="selected_storage" name="selected_storage" hidden/>
</div> </div>
</div> </div>

View file

@ -2,18 +2,18 @@
<table class="table table-hover sortable-theme-bootstrap" data-sortable> <table class="table table-hover sortable-theme-bootstrap" data-sortable>
<thead> <thead>
<tr style="border: 2px solid transparent; "> <tr style="border: 2px solid transparent; ">
<th><a class="text-secondary" href="#" id="hide_all_instances" onclick="hide_all_host_instances()">#</a></th> <th data-sortable="false"><a class="text-secondary" href="#" id="hide_all_instances" onclick="hide_all_host_instances()">#</a></th>
<th>{% trans "Name" %}<br>{% trans "Description" %}</th> <th>{% trans "Name" %}<br>{% trans "Description" %}</th>
<th class="d-none d-sm-table-cell">{% trans "User"%}</th> <th class="d-none d-sm-table-cell">{% trans "User"%}</th>
<th>{% trans "Status" %}</th> <th>{% trans "Status" %}</th>
<th class="d-none d-sm-table-cell">{% trans "VCPU" %}</th> <th class="d-none d-sm-table-cell">{% trans "VCPU" %}</th>
<th class="d-none d-sm-table-cell">{% trans "Memory" %}</th> <th class="d-none d-sm-table-cell">{% trans "Memory" %}</th>
<th style="width:200px;" data-sortable="false">{% trans "Actions & Mem Usage" %}</th> <th style="width:200px;" data-sortable="false">{% trans "Actions" %} & {% trans "Mem Usage" %}</th>
</tr> </tr>
</thead> </thead>
<tbody class="searchable"> <tbody class="searchable">
{% for host, insts in all_host_vms.items %} {% for host, insts in all_host_vms.items %}
<tr class="active font-weight-bold" style="border-bottom: 2px solid darkgray;border-top: 2px solid darkgray;"> <tr class="font-weight-bold active" style="border-bottom: 2px solid darkgray;border-top: 2px solid darkgray;">
<td> <td>
<span id="collapse_host_instances_{{ host.1 }}" class="fa fa-chevron-up" onclick="hide_host_instances('{{ host.1 }}');"></span> <span id="collapse_host_instances_{{ host.1 }}" class="fa fa-chevron-up" onclick="hide_host_instances('{{ host.1 }}');"></span>
</td> </td>
@ -23,9 +23,9 @@
</td> </td>
<td class="d-none d-sm-table-cell"></td> <td class="d-none d-sm-table-cell"></td>
<td> <td>
{% ifequal host.2 1 %}<span class="label label-success">{% trans "Active" %}</span>{% endifequal %} {% ifequal host.2 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
{% ifequal host.2 2 %}<span class="label label-danger">{% trans "Not Active" %}</span>{% endifequal %} {% ifequal host.2 2 %}<span class="text-warning">{% trans "Not Active" %}</span>{% endifequal %}
{% ifequal host.2 3 %}<span class="label label-danger">{% trans "Connection Failed" %}</span>{% endifequal %} {% ifequal host.2 3 %}<span class="text-danger">{% trans "Connection Failed" %}</span>{% endifequal %}
</td> </td>
<td class="d-none d-sm-table-cell text-center">{{ host.3 }}</td> <td class="d-none d-sm-table-cell text-center">{{ host.3 }}</td>
<td class="d-none d-sm-table-cell text-right">{{ host.4|filesizeformat }}</td> <td class="d-none d-sm-table-cell text-right">{{ host.4|filesizeformat }}</td>
@ -74,14 +74,14 @@ function hide_all_host_instances() {
all_host_rows = rows.filter('[host]'); all_host_rows = rows.filter('[host]');
all_host_rows.toggle(); all_host_rows.toggle();
$('span[id^=collapse_host_instances_]').toggleClass("fa-chevron-down").toggleClass("fa-chevron-up"); $('span[id^=collapse_host_instances_]').toggleClass("fa-chevron-down").toggleClass("fa-chevron-up");
$('span[id^=inst_count_badge_]').toggleClass("hidden"); $('span[id^=inst_count_badge_]').toggleClass("d-none");
} }
function hide_host_instances(host) { function hide_host_instances(host) {
var rows = $('table tr'); var rows = $('table tr');
host_rows = rows.filter("[host='"+host+"']"); host_rows = rows.filter("[host='"+host+"']");
host_rows.toggle(); host_rows.toggle();
$("span[id='collapse_host_instances_"+host+"']").toggleClass("fa-chevron-down").toggleClass("fa-chevron-up"); $("span[id='collapse_host_instances_"+host+"']").toggleClass("fa-chevron-down").toggleClass("fa-chevron-up");
$("span[id='inst_count_badge_"+host+"']").toggleClass("hidden"); $("span[id='inst_count_badge_"+host+"']").toggleClass("d-none");
} }
</script> </script>
{% endblock %} {% endblock %}

View file

@ -14,20 +14,20 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<ul class="nav nav-tabs"> <ul class="nav nav-tabs mb-3" role="tablist">
<li class="nav-item"> <li class="nav-item" role="presentation">
<a class="nav-link active" href="#VirtualDisk{{ id }}" data-toggle="tab">{% trans 'Virtual Disk' %}</a> <a class="nav-link active" href="#VirtualDisk{{ id }}" data-toggle="tab">{% trans 'Virtual Disk' %}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item" role="presentation">
<a class="nav-link" href="#PerformanceVolume{{ id }}" data-toggle="tab">{% trans 'Performance' %}</a> <a class="nav-link" href="#PerformanceVolume{{ id }}" data-toggle="tab">{% trans 'Performance' %}</a>
</li> </li>
<li class="nav-item"> <li class="nav-item" role="presentation">
<a class="nav-link" href="#AdvancedVolume{{ id }}" data-toggle="tab">{% trans 'Advanced' %}</a> <a class="nav-link" href="#AdvancedVolume{{ id }}" data-toggle="tab">{% trans 'Advanced' %}</a>
</li> </li>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="VirtualDisk{{ id }}"> <div class="tab-pane active" role="tabpanel" id="VirtualDisk{{ id }}">
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans 'Volume Path' %}</label> <label class="col-sm-4 col-form-label">{% trans 'Volume Path' %}</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -36,19 +36,19 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans 'Readonly' %}</label> <label class="col-sm-4 col-form-label">{% trans 'Readonly' %}</label>
<div class="col-sm-8"> <div class="form-check">
<input class="form-control-static" type="checkbox" name="vol_readonly" value="True" {% if disk.readonly %}checked{% endif %}/> <input class="form-check-input position-static" type="checkbox" name="vol_readonly" value="True" {% if disk.readonly %}checked{% endif %}/>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans 'Shareable' %}</label> <label class="col-sm-4 col-form-label">{% trans 'Shareable' %}</label>
<div class="col-sm-8"> <div class="form-check">
<input class="form-control-static" type="checkbox" name="vol_shareable" value="True" {% if disk.shareable %}checked{% endif %}/> <input class="form-check-input position-static" type="checkbox" name="vol_shareable" value="True" {% if disk.shareable %}checked{% endif %}/>
</div> </div>
</div> </div>
</div> </div>
<div class="tab-pane" id="AdvancedVolume{{ id }}"> <div class="tab-pane" role="tabpanel" id="AdvancedVolume{{ id }}">
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans 'Bus' %}</label> <label class="col-sm-4 col-form-label">{% trans 'Bus' %}</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -73,7 +73,7 @@
</div> </div>
</div> </div>
<div class="tab-pane" id="PerformanceVolume{{ id }}"> <div class="tab-pane" role="tabpanel" id="PerformanceVolume{{ id }}">
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{% trans 'Cache mode' %}</label> <label class="col-sm-4 col-form-label">{% trans 'Cache mode' %}</label>
<div class="col-sm-8"> <div class="col-sm-8">

View file

@ -287,8 +287,8 @@
<span class="sr-only">{% trans 'Toggle Dropdown' %}</span> <span class="sr-only">{% trans 'Toggle Dropdown' %}</span>
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
<a class="dropdown-item" href="#" title="{% trans "Console port" %}: {{ console_port }}" onclick="open_console('lite')">{% trans "Console - Lite" %}</a> <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 - Full" %}</a> <a class="dropdown-item" href="#" title="{% trans "Console port" %}: {{ console_port }}" onclick="open_console('full')">{% trans "Console" %} - {% trans "Full" %}</a>
</div> </div>
</div> </div>
{% else %} {% else %}
@ -302,7 +302,7 @@
<form class="form-inline" method="post" role="form">{% csrf_token %} <form class="form-inline" method="post" role="form">{% csrf_token %}
<div class="form-group row"> <div class="form-group row">
<div class="col-sm-12"> <div class="col-sm-12">
<input type="text" class="form-control input-lg" name="passwd" placeholder="{% trans "Enter Password" %}" maxlength="24"> <input type="text" class="form-control-lg" name="passwd" placeholder="{% trans "Enter Password" %}" maxlength="24">
</div> </div>
</div> </div>
{% ifequal status 5 %} {% ifequal status 5 %}
@ -1179,7 +1179,7 @@
</div> </div>
<div role="tabpanel" class="tab-pane tab-pane-bordered" id="xmledit"> <div role="tabpanel" class="tab-pane tab-pane-bordered" id="xmledit">
<p>{% trans "If you need to edit xml please Power Off the instance" %}</p> <p>{% trans "If you need to edit xml please Power Off the instance" %}</p>
<form class="form-horizontal" method="post" role="form">{% csrf_token %} <form method="post" role="form">{% csrf_token %}
<div class="col-sm-12" id="xmlheight"> <div class="col-sm-12" id="xmlheight">
<textarea id="editor">{{ inst_xml }}</textarea> <textarea id="editor">{{ inst_xml }}</textarea>
</div> </div>

View file

@ -829,7 +829,7 @@ def instance(request, compute_id, vname):
if status == 'False': if status == 'False':
conn.remove_guest_agent() conn.remove_guest_agent()
msg = _("Set Quest Agent {}".format(status)) msg = _(f"Set Quest Agent {status}")
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#options') return HttpResponseRedirect(request.get_full_path() + '#options')
@ -901,7 +901,7 @@ def instance(request, compute_id, vname):
state = request.POST.get('set_link_state') state = request.POST.get('set_link_state')
state = 'down' if state == 'up' else 'up' state = 'down' if state == 'up' else 'up'
conn.set_link_state(mac_address, state) conn.set_link_state(mac_address, state)
msg = _("Set Link State: {}".format(state)) msg = _(f"Set Link State: {state}")
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#network') return HttpResponseRedirect(request.get_full_path() + '#network')
@ -917,11 +917,11 @@ def instance(request, compute_id, vname):
try: try:
conn.set_qos(mac, qos_dir, average, peak, burst) conn.set_qos(mac, qos_dir, average, peak, burst)
if conn.get_status() == 5: if conn.get_status() == 5:
messages.success(request, "{} QoS is set".format(qos_dir.capitalize())) messages.success(request, _(f"{qos_dir.capitalize()} QoS is set"))
else: else:
messages.success(request, messages.success(request,
"{} QoS is set. Network XML is changed.".format(qos_dir.capitalize()) + _(f"{qos_dir.capitalize()} QoS is set. Network XML is changed.") +
"Stop and start network to activate new config") _("Stop and start network to activate new config"))
except libvirtError as le: except libvirtError as le:
messages.error(request, le) messages.error(request, le)
@ -932,10 +932,10 @@ def instance(request, compute_id, vname):
conn.unset_qos(mac, qos_dir) conn.unset_qos(mac, qos_dir)
if conn.get_status() == 5: if conn.get_status() == 5:
messages.success(request, "{} QoS is deleted".format(qos_dir.capitalize())) messages.success(request, _(f"{qos_dir.capitalize()} QoS is deleted"))
else: else:
messages.success(request, messages.success(request,
"{} QoS is deleted. Network XML is changed. ".format(qos_dir.capitalize()) + f"{qos_dir.capitalize()} QoS is deleted. Network XML is changed. " +
"Stop and start network to activate new config.") "Stop and start network to activate new config.")
return HttpResponseRedirect(request.get_full_path() + '#network') return HttpResponseRedirect(request.get_full_path() + '#network')
@ -953,7 +953,7 @@ def instance(request, compute_id, vname):
else: else:
add_user_inst = UserInstance(instance=instance, user_id=user_id) add_user_inst = UserInstance(instance=instance, user_id=user_id)
add_user_inst.save() add_user_inst.save()
msg = _("Added owner %d" % user_id) msg = _(f"Added owner {user_id}")
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#users') return HttpResponseRedirect(request.get_full_path() + '#users')
@ -961,7 +961,7 @@ def instance(request, compute_id, vname):
userinstance_id = int(request.POST.get('userinstance', '')) userinstance_id = int(request.POST.get('userinstance', ''))
userinstance = UserInstance.objects.get(pk=userinstance_id) userinstance = UserInstance.objects.get(pk=userinstance_id)
userinstance.delete() userinstance.delete()
msg = _("Deleted owner %d" % userinstance_id) msg = _(f"Deleted owner {userinstance_id}")
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#users') return HttpResponseRedirect(request.get_full_path() + '#users')

View file

@ -171,7 +171,7 @@ def network(request, compute_id, pool):
try: try:
ret_val = conn.modify_fixed_address(name, address, mac_duid, family) ret_val = conn.modify_fixed_address(name, address, mac_duid, family)
messages.success(request, _("{} Fixed Address Operation Completed.").format(family.upper())) messages.success(request, _(f"{family.upper()} Fixed Address Operation Completed."))
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
except libvirtError as lib_err: except libvirtError as lib_err:
error_messages.append(lib_err) error_messages.append(lib_err)
@ -181,7 +181,7 @@ def network(request, compute_id, pool):
ip = request.POST.get('address', '') ip = request.POST.get('address', '')
family = request.POST.get('family', 'ipv4') family = request.POST.get('family', 'ipv4')
conn.delete_fixed_address(ip, family) conn.delete_fixed_address(ip, family)
messages.success(request, _("{} Fixed Address is Deleted.").format(family.upper())) messages.success(request, _(f"{family.upper()} Fixed Address is Deleted."))
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
if 'modify_dhcp_range' in request.POST: if 'modify_dhcp_range' in request.POST:
range_start = request.POST.get('range_start', '') range_start = request.POST.get('range_start', '')
@ -189,7 +189,7 @@ def network(request, compute_id, pool):
family = request.POST.get('family', 'ipv4') family = request.POST.get('family', 'ipv4')
try: try:
conn.modify_dhcp_range(range_start, range_end, family) conn.modify_dhcp_range(range_start, range_end, family)
messages.success(request, _("{} DHCP Range is Changed.").format(family.upper())) messages.success(request, _(f"{family.upper()} DHCP Range is Changed."))
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
except libvirtError as lib_err: except libvirtError as lib_err:
error_messages.append(lib_err) error_messages.append(lib_err)
@ -213,7 +213,7 @@ def network(request, compute_id, pool):
if conn.is_active(): if conn.is_active():
messages.success( messages.success(
request, request,
_("{} Qos is set. Network XML is changed.").format(qos_dir.capitalize()) + _(f"{qos_dir.capitalize()} QoS is set. Network XML is changed.") +
_("Stop and start network to activate new config")) _("Stop and start network to activate new config"))
else: else:
messages.success(request, _("{} QoS is set").format(qos_dir.capitalize())) messages.success(request, _("{} QoS is set").format(qos_dir.capitalize()))
@ -227,10 +227,10 @@ def network(request, compute_id, pool):
if conn.is_active(): if conn.is_active():
messages.success( messages.success(
request, request,
_("{} Qos is deleted. Network XML is changed. ").format(qos_dir.capitalize()) + _(f"{qos_dir.capitalize()} QoS is deleted. Network XML is changed. ") +
_("Stop and start network to activate new config.")) _("Stop and start network to activate new config."))
else: else:
messages.success(request, _("{} QoS is deleted").format(qos_dir.capitalize())) messages.success(request, _(f"{qos_dir.capitalize()} QoS is deleted"))
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
conn.close() conn.close()

View file

@ -56,7 +56,7 @@ def nwfilters(request, compute_id):
if 'del_nwfilter' in request.POST: if 'del_nwfilter' in request.POST:
name = request.POST.get('nwfiltername', '') name = request.POST.get('nwfiltername', '')
msg = _("Deleting NWFilter: %s" % name) msg = _(f"Deleting NWFilter: {name}")
in_use = False in_use = False
nwfilter = conn.get_nwfilter(name) nwfilter = conn.get_nwfilter(name)
@ -68,7 +68,7 @@ def nwfilters(request, compute_id):
if name in dom_filterrefs: if name in dom_filterrefs:
in_use = True in_use = True
msg = _("NWFilter is in use by %s. Cannot be deleted." % inst) msg = _(f"NWFilter is in use by {inst}. Cannot be deleted.")
error_messages.append(msg) error_messages.append(msg)
addlogmsg(request.user.username, compute.hostname, msg) addlogmsg(request.user.username, compute.hostname, msg)
i_conn.close() i_conn.close()

View file

@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="WebVirtCloud panel for manage virtual machine"> <meta name="description" content="WebVirtCloud panel for manage virtual machine">
<meta name="author" content="anatoliy.guskov@gmail.com"> <meta name="author" content="anatoliy.guskov@gmail.com">