diff --git a/src/controllers/networkController.js b/src/controllers/networkController.js index c02970a..7effc51 100644 --- a/src/controllers/networkController.js +++ b/src/controllers/networkController.js @@ -363,6 +363,8 @@ exports.v4AssignMode = async function (req, res) { v4AssignMode: { zt: req.body.zt } }; + console.log('v4AssignMode: ' + JSON.stringify(v4AssignMode)); + try { const network = await zt.network_object(req.params.nwid, v4AssignMode); nav.whence = '/controller/network/' + network.nwid; @@ -385,11 +387,13 @@ exports.v6AssignMode = async function (req, res) { v6AssignMode: { '6plane': req.body['6plane'], - rfc4193: req.body.rfc4193, - zt: req.body.zt + 'rfc4193': req.body.rfc4193, + 'zt': req.body.zt } }; + console.log('v6AssignMode: ' + JSON.stringify(v6AssignMode)); + try { const network = await zt.network_object(req.params.nwid, v6AssignMode); nav.whence = '/controller/network/' + network.nwid; diff --git a/src/views/members.pug b/src/views/members.pug index 92ca2bb..909b5dd 100644 --- a/src/views/members.pug +++ b/src/views/members.pug @@ -9,19 +9,19 @@ block net_content script. $(function() { $('#authCheckBox').on('click', function() { - $.post('', {id: this.value, auth: this.checked}); + $.post('', {'id': this.value, 'auth': this.checked}); }); }); $(function() { $('#activeBridgeCheckBox').on('click', function() { - $.post('', {id: this.value, activeBridge: this.checked}); + $.post('', {'id': this.value, 'activeBridge': this.checked}); }); }); $(function() { $('.text').on('change', function() { - $.post('', {id: this.name, name: this.value}); + $.post('', {'id': this.name, 'name': this.value}); }); }); diff --git a/src/views/v4AssignMode.pug b/src/views/v4AssignMode.pug index b00ff00..41d2ee6 100644 --- a/src/views/v4AssignMode.pug +++ b/src/views/v4AssignMode.pug @@ -6,24 +6,21 @@ extends network_layout block net_content - p Let ZT assign IPv4 addresses? + script. + $(function() { + $('.checkbox').on('click', function() { + $.post('', {'zt': $('#v4AssignModeCheckBox').is(':checked')}); + }); + }); form(method='POST' action='') - .radio - label - input(type='radio' name='zt' value='true' checked=network.v4AssignMode.zt) - | Yes - .radio - label - input(type='radio' name='zt' value='false' checked=!network.v4AssignMode.zt) - | No + table.table.table-responsive.table-striped.table-hover + tr + td(width='3%') + input#v4AssignModeCheckBox.checkbox(type='checkbox' checked=(network.v4AssignMode.zt? true : false)) + td Auto-assign from IP Assignment Pool - .form-group(style='padding-top: 10px') - button.btn.btn-primary(type='submit') Submit - = ' ' - a.btn.btn-default(href='/controller/network/' + network.nwid name='cancel' role='button') Cancel - - if errors - ul - for err in errors - li!= err.msg + if errors + ul + for err in errors + li!= err.msg diff --git a/src/views/v6AssignMode.pug b/src/views/v6AssignMode.pug index a421d8d..490e782 100644 --- a/src/views/v6AssignMode.pug +++ b/src/views/v6AssignMode.pug @@ -6,49 +6,29 @@ extends network_layout block net_content + script. + $(function() { + $('.checkbox').on('click', function() { + $.post('', {'6plane': $('#6planeCheckBox').is(':checked'), 'rfc4193': $('#rfc4193CheckBox').is(':checked'), 'zt': $('#ztCheckBox').is(':checked')}); + }); + }); + form(method='POST' action='') table.table.table-responsive.table-striped.table-hover tr - th(width='25%') - th(width='2%') Yes - th(width='73%') No - tr + td(width='3%') + input#6planeCheckBox.checkbox(type='checkbox' checked=(network.v6AssignMode['6plane']? true : false)) td ZT 6plane (/80 routable for each device) - td - .radio - label - input(type='radio' name='6plane' value='true' checked=network.v6AssignMode['6plane']) - td - .radio - label - input(type='radio' name='6plane' value='false' checked=!network.v6AssignMode['6plane']) tr + td + input#rfc4193CheckBox.checkbox(type='checkbox' checked=(network.v6AssignMode['rfc4193']? true : false)) td ZT rfc4193 (/128 for each device) - td - .radio - label - input(type='radio' name='rfc4193' value='true' checked=network.v6AssignMode.rfc4193) - td - .radio - label - input(type='radio' name='rfc4193' value='false' checked=!network.v6AssignMode.rfc4193) tr + td + input#ztCheckBox.checkbox(type='checkbox' checked=(network.v6AssignMode['zt']? true : false)) td Auto-assign from IP Assignment Pool - td - .radio - label - input(type='radio' name='zt' value='true' checked=network.v6AssignMode.zt) - td - .radio - label - input(type='radio' name='zt' value='false' checked=!network.v6AssignMode.zt) - .form-group(style='padding-top: 10px') - button.btn.btn-primary(type='submit') Submit - = ' ' - a.btn.btn-default(href='/controller/network/' + network.nwid name='cancel' role='button') Cancel - - if errors - ul - for err in errors - li!= err.msg + if errors + ul + for err in errors + li!= err.msg