mirror of
				https://github.com/retspen/webvirtcloud
				synced 2025-07-31 12:41:08 +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:
		
							parent
							
								
									33916c6a82
								
							
						
					
					
						commit
						39f3c9e12b
					
				
					 3 changed files with 26 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue