From ad9ad128b90b29928c6e8e40c8ee93d774375d14 Mon Sep 17 00:00:00 2001 From: Victek Date: Sat, 12 Mar 2011 00:04:12 +0700 Subject: [PATCH] click to add MAC from device list to QoS/BW Limiter --- release/src/router/www/new-qoslimit.asp | 24 +++++++++++++++++++++--- release/src/router/www/status-devices.asp | 11 +++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/release/src/router/www/new-qoslimit.asp b/release/src/router/www/new-qoslimit.asp index 6c95a81562..efa4c32e13 100644 --- a/release/src/router/www/new-qoslimit.asp +++ b/release/src/router/www/new-qoslimit.asp @@ -78,8 +78,26 @@ qosg.dataToView = function(data) { } qosg.resetNewEditor = function() { + var f, c, n; + var f = fields.getAll(this.newEditor); - + ferror.clearAll(f); + if ((c = cookie.get('addbwlimit')) != null) { + cookie.set('addbwlimit', '', 0); + c = c.split(','); + if (c.length == 2) { + f[0].value = c[0]; + f[1].value = c[1]; + f[2].value = ''; + f[3].value = ''; + f[4].value = ''; + f[5].selectedIndex = '2'; + f[6].selectedIndex = '0'; + f[7].selectedIndex = '0'; + return; + } + } + f[0].value = ''; f[1].value = ''; f[2].value = ''; @@ -88,8 +106,8 @@ qosg.resetNewEditor = function() { f[5].selectedIndex = '2'; f[6].selectedIndex = '0'; f[7].selectedIndex = '0'; - ferror.clearAll(fields.getAll(this.newEditor)); -} + + } qosg.exist = function(f, v) { diff --git a/release/src/router/www/status-devices.asp b/release/src/router/www/status-devices.asp index fb69b0662e..04ca77daaf 100644 --- a/release/src/router/www/status-devices.asp +++ b/release/src/router/www/status-devices.asp @@ -147,6 +147,12 @@ function addWF(n) location.href = 'basic-wfilter.asp'; } +function addbwlimit(n) +{ + var e = list[n]; + cookie.set('addbwlimit', [e.mac, e.name.split(',')[0]].join(','), 1); + location.href = 'new-qoslimit.asp'; +} var ref = new TomatoRefresh('update.cgi', 'exec=devlist', 0, 'status_devices_refresh'); @@ -271,7 +277,8 @@ dg.populate = function() if (e.mac.match(/^(..):(..):(..)/)) { b += '
' + '[oui] ' + - '[static]'; + '[static]' + + '[bwlimit]'; if (e.rssi != '') { b += ' [wfilter]'; @@ -321,7 +328,7 @@ function init() -- 2.11.4.GIT