Skip to content

Commit

Permalink
Adding in js bits for proxmox
Browse files Browse the repository at this point in the history
Adding in the javascript bits to mangle the UI to allow for proxmox in addition to esx per @samilliken's request
  • Loading branch information
wilpig committed Oct 27, 2016
1 parent 7ae763f commit f495995
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions devices.php
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,27 @@ function customattrrefresh(TemplateID){
}
resize();
}).change();

$('select#Hypervisor').change(function(){
if($(this).val()=='ProxMox'){
$('#SNMPVersion').val(3).change().parent('div').parent('div').hide();
// Hide the existing labels for the snmp fields
$('.normal').addClass('hide');
// Shwo the proxmox alternatives
$('.proxmox').removeClass('hide');
$(':input[id^="v3"],#SNMPCommunity').parent('div').parent('div').hide();
$(':input[id$="Passphrase"]').parent('div').parent('div').show();
}else{
// Put back any hidden / renamed fields
$('#SNMPVersion').change().parent('div').parent('div').show();
$('#SNMPCommunity').parent('div').parent('div').show();
// Hide the existing labels for the snmp fields
$('.normal').removeClass('hide');
// Shwo the proxmox alternatives
$('.proxmox').addClass('hide');
}
}).change();

$('#firstport button[name=firstport]').click(function(){
// S.U.T. Update the IP and snmp community then click on the switch controls.
// we'll combat that with a limited device update.
Expand Down Expand Up @@ -1973,7 +1994,7 @@ function setPreferredLayout() {<?php if(isset($_COOKIE["layout"]) && strtolower(
</div>
</div>
<div>
<div><label for="v3AuthPassphrase">'.__("SNMPv3 Passphrase").'</label></div>
<div><label for="v3AuthPassphrase" class="normal">'.__("SNMPv3 Passphrase").'</label><label for="v3AuthPassphrase" class="proxmox hide">'.__("API Username").'</label></div>
<div><input type="password" name="v3AuthPassphrase" id="v3AuthPassphrase" value="'.$dev->v3AuthPassphrase.'"></div>
</div>
<div>
Expand All @@ -1990,7 +2011,7 @@ function setPreferredLayout() {<?php if(isset($_COOKIE["layout"]) && strtolower(
</div>
</div>
<div>
<div><label for="v3PrivPassphrase">'.__("SNMPv3 PrivPassphrase").'</label></div>
<div><label for="v3PrivPassphrase" class="normal">'.__("SNMPv3 PrivPassphrase").'</label><label for="v3PrivPassphrase" class="proxmox hide">'.__("API Password").'</label></div>
<div><input type="password" name="v3PrivPassphrase" id="v3PrivPassphrase" value="'.$dev->v3PrivPassphrase.'"></div>
</div>
<div>
Expand Down

0 comments on commit f495995

Please sign in to comment.