Lines 580-592
Link Here
|
580 |
n.append("<legend>" + _("Interface details") + "</legend>"); |
580 |
n.append("<legend>" + _("Interface details") + "</legend>"); |
581 |
n.append(`<input type="hidden" name="interface_counter" value="${i}" />`); |
581 |
n.append(`<input type="hidden" name="interface_counter" value="${i}" />`); |
582 |
let ol = $('<ol class="interface-form"></ol>'); |
582 |
let ol = $('<ol class="interface-form"></ol>'); |
583 |
ol.append(`<li><label for="interface_name_${i}">` + _("Name: ") + `</label><input type="text" size="40" id="interface_name_${i}" name="interface_name_${i}" value="${interface.name}" /></li>`); |
583 |
let attributes = [ |
584 |
ol.append(`<li><label for="interface_type_${i}">` + _("Type: ") + `</label><input type="text" size="40" id="interface_type_${i}" name="interface_type_${i}" value="${interface.type}" /></li>`); |
584 |
{ label: _("Name"), name: 'name', node: 'input' }, |
585 |
ol.append(`<li><label for="interface_uri_${i}">` + _("URI: ") + `</label><input type="text" size="40" id="interface_uri_${i}" name="interface_uri_${i}" value="${interface.uri}" /></li>`); |
585 |
{ label: _("Type"), name: 'type', node: 'input' }, |
586 |
ol.append(`<li><label for="interface_login_${i}">` + _("Login: ") + `</label><input type="text" size="40" id="interface_login_${i}" name="interface_login_${i}" value="${interface.login}" /></li>`); |
586 |
{ label: _("URI"), name: 'uri', node: 'input' }, |
587 |
ol.append(`<li><label for="interface_password_${i}">` + _("Password: ") + `</label><input type="text" size="40" id="interface_password_${i}" name="interface_password_${i}" value="${interface.password}" /></li>`); |
587 |
{ label: _("Login"), name: 'login', node: 'input' }, |
588 |
ol.append(`<li><label for="interface_account_email_${i}">` + _("Account email: ") + `</label><input type="text" size="40" id="interface_account_email_${i}" name="interface_account_email_${i}" value="${interface.account_email}" /></li>`); |
588 |
{ label: _("Password"), name: 'password', node: 'input' }, |
589 |
ol.append(`<li><label for="interface_notes_${i}">` + _("Notes: ") + `</label><textarea cols="40" rows="3" id="interface_notes_${i}" name="interface_notes_${i}">${interface.notes}</textarea></li>`); |
589 |
{ label: _("Account email"), name: 'account_email', node: 'input' }, |
|
|
590 |
{ label: _("Notes"), name: 'notes', node: 'textarea' } |
591 |
]; |
592 |
attributes.forEach((attribute, ii) => { |
593 |
let li = $('<li></li>'); |
594 |
li.append(`<label for="interface_${attribute.name}_${i}">${attribute.label}</label>`); |
595 |
if( attribute.node == 'input' ) { |
596 |
li.append(`<input type="text" size="40" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}" value="${interface[attribute.name]}" />`); |
597 |
} else if ( attribute.node == 'textarea' ) { |
598 |
li.append(`<textarea cols="40" rows="3" id="interface_${attribute.name}_${i}" name="interface_${attribute.name}_${i}">${interface[attribute.name]}</textarea>`); |
599 |
} |
600 |
ol.append(li); |
601 |
}); |
590 |
ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> Delete interface</li>`); |
602 |
ol.append(`<li><button class="btn btn-default" onclick="remove_interface(${i});"><i class="fa fa-trash"></i> Delete interface</li>`); |
591 |
n.append(ol); |
603 |
n.append(ol); |
592 |
nodes.append(n); |
604 |
nodes.append(n); |
593 |
- |
|
|