mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-06-07 21:04:36 +00:00
instance/clone added Guess mac address button. search for mac address of Clone Name via ajax request. Currently scans only local dhcpd configuration file.
This commit is contained in:
@@ -730,6 +730,8 @@
|
||||
<div class="col-sm-4">
|
||||
<button type="button" class="btn btn-sm btn-success pull-left" name="random-mac-{{ forloop.counter0 }}"
|
||||
onclick="random_mac({{ forloop.counter0 }})" style="margin-top: 2px;">{% trans "Random" %}</button>
|
||||
<button type="button" class="btn btn-sm btn-success pull-left" name="guess-mac-{{ forloop.counter0 }}"
|
||||
onclick="guess_mac_address({{ forloop.counter0 }})" style="margin-top: 2px;">{% trans "Guess" %}</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -964,6 +966,14 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function guess_mac_address(net) {
|
||||
new_vname = $('#clone_name').val();
|
||||
$.getJSON('/instance/guess_mac_address/' + new_vname + '/', function(data) {
|
||||
$('input[name="net-'+net+'"]').val(data['mac']);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function update_clone_disk_name(new_vname) {
|
||||
vname = '{{ vname }}-clone';
|
||||
|
||||
Reference in New Issue
Block a user