Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

Commit

Permalink
webui: preserve DHCP static hostname when editing networkmap entry
Browse files Browse the repository at this point in the history
  • Loading branch information
RMerl committed Oct 30, 2015
1 parent 557ddef commit 4106a5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions release/src/router/www/client_function.js
Expand Up @@ -155,6 +155,7 @@ var totalClientNum = {
}
var setClientAttr = function(){
this.hostname = "";
this.type = "";
this.defaultType = "0";
this.name = "";
Expand Down Expand Up @@ -623,6 +624,7 @@ function genClientList(){
continue;
}
clientList[thisClientMacAddr].hostname = thisClient[2];
if(typeof clientList[thisClientMacAddr] != "undefined"){
if(clientList[thisClientMacAddr].ipMethod == "DHCP") {
if(clientList[thisClientMacAddr].ip == thisClient[1] || clientList[thisClientMacAddr].ip == "offline")
Expand Down
7 changes: 7 additions & 0 deletions release/src/router/www/index.asp
Expand Up @@ -985,6 +985,8 @@ function validForm(){
tmpArray[index] = document.getElementById("macaddr_field").value;
tmpArray[index] += ">";
tmpArray[index] += document.getElementById("ipaddr_field").value;
tmpArray[index] += ">";
tmpArray[index] += document.getElementById("hostname_field").value;
document.list_form.dhcp_staticlist.value = tmpArray.join("<");
}
});
Expand Down Expand Up @@ -1431,6 +1433,8 @@ function popupEditBlock(clientObj){
document.getElementById('ipaddr_field_orig').value = clientObj.ip;
document.getElementById('ipaddr_field').value = clientObj.ip;
document.getElementById('hostname_field').value = clientObj.hostname;
document.getElementById('ipaddr_field').disabled = true;
$("#ipaddr_field").addClass("client_input_text_disabled");
if(sw_mode == "1") {
Expand Down Expand Up @@ -1719,6 +1723,8 @@ function addToList(macAddr){
document.list_form.dhcp_staticlist.value += macAddr;
document.list_form.dhcp_staticlist.value += ">";
document.list_form.dhcp_staticlist.value += document.getElementById("ipaddr_field").value;
document.list_form.dhcp_staticlist.value += ">";
document.list_form.dhcp_staticlist.value += document.getElementById("hostname_field").value;
}
}
Expand Down Expand Up @@ -2049,6 +2055,7 @@ function setDefaultIcon() {
<td style="vertical-align:top;width:280px;">
<div>
<input id="client_name" name="client_name" type="text" value="" class="input_32_table" maxlength="32" style="width:275px;" autocorrect="off" autocapitalize="off">
<input id="hostname_field" type="hidden" value="">
</div>
<div style="margin-top:10px;">
<input id="ipaddr_field_orig" type="hidden" value="" disabled="">
Expand Down

0 comments on commit 4106a5e

Please sign in to comment.