diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-11-10 14:51:41 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-11-10 15:13:13 -0500 |
commit | 2f4e37b1196be724d00746eab5a1ff5ba6d27b00 (patch) | |
tree | 88303e08bf473ddf26308a19f59a0ab456e28f0c /src/usr | |
parent | e98cb9335e5756ab2cf4638b612b8ce43305b60f (diff) | |
download | pfsense-2f4e37b1196be724d00746eab5a1ff5ba6d27b00.zip pfsense-2f4e37b1196be724d00746eab5a1ff5ba6d27b00.tar.gz |
Fixed #5405
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/diag_routes.php | 39 | ||||
-rwxr-xr-x | src/usr/local/www/foot.inc | 2 | ||||
-rwxr-xr-x | src/usr/local/www/sortable/sortable.min.js | 2 | ||||
-rw-r--r-- | src/usr/local/www/status_lb_vs.php | 10 | ||||
-rw-r--r-- | src/usr/local/www/status_wireless.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/system_usermanager.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/openvpn.widget.php | 4 |
7 files changed, 39 insertions, 22 deletions
diff --git a/src/usr/local/www/diag_routes.php b/src/usr/local/www/diag_routes.php index 1311f91..bb05957 100644 --- a/src/usr/local/www/diag_routes.php +++ b/src/usr/local/www/diag_routes.php @@ -161,9 +161,15 @@ function update_routes_callback(html) { var thead = '<tr>'; for (var i = 0; i < responseTextArr.length; i++) { + if (responseTextArr[i] == "") continue; - var tmp = '<tr>'; + + if (i == 0) + var tmp = ''; + else + var tmp = '<tr>'; + var j = 0; var entry = responseTextArr[i].split(" "); for (var k = 0; k < entry.length; k++) { @@ -176,16 +182,27 @@ function update_routes_callback(html) { j++; } - tmp += '<td><\/td>'; - if (i == 0) thead += tmp; - else + else { + tmp += '<td><\/td>' tbody += tmp; + } } $('#' + section + ' > thead').html(thead); $('#' + section + ' > tbody').html(tbody); + + $('div.panel').find('*').removeAttr('data-sortable'); + $('div.panel').find('*').removeAttr('data-sortable-initialized'); + $('div.panel').find('*').removeAttr('data-sorted-direction'); + $('div.panel').find('*').removeAttr('data-sorted'); + + exampleTable = document.querySelector('#IPv4'); + Sortable.initTable(exampleTable); + + exampleTable = document.querySelector('#IPv6'); + Sortable.initTable(exampleTable); } function update_all_routes() { @@ -194,7 +211,7 @@ function update_all_routes() { } events.push(function(){ - setInterval('update_all_routes()', 5000); +// setInterval('update_all_routes()', 5000); update_all_routes(); $(document.forms[0]).on('submit', function(e){ @@ -208,9 +225,11 @@ events.push(function(){ <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title">IPv4 Routes</h2></div> <div class="panel panel-body"> - <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable id="IPv4"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" id="IPv4" data-sortable> <thead> - <!-- filled by xhr --> + <tr> + <th><!-- filled by xhr --></th> + </tr> </thead> <tbody> <tr> @@ -224,9 +243,11 @@ events.push(function(){ <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title">IPv6 Routes</h2></div> <div class="panel panel-body"> - <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable id="IPv6"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" id="IPv6" data-sortable> <thead> - <!-- filled by xhr --> + <tr> + <th><!-- filled by xhr --></th> + </tr> </thead> <tbody> <tr> diff --git a/src/usr/local/www/foot.inc b/src/usr/local/www/foot.inc index d900474..980de3f 100755 --- a/src/usr/local/www/foot.inc +++ b/src/usr/local/www/foot.inc @@ -26,7 +26,7 @@ <script src="/bootstrap/js/bootstrap.min.js"></script> <script src="/jquery/pfSense.js"></script> <script src="/jquery/pfSenseHelpers.js"></script> - <script src="sortable/sortable.min.js"></script> + <script src="sortable/sortable.js"></script> <script> // Un-hide the "Top of page" icons if the page is larger than the window diff --git a/src/usr/local/www/sortable/sortable.min.js b/src/usr/local/www/sortable/sortable.min.js deleted file mode 100755 index 8278f50..0000000 --- a/src/usr/local/www/sortable/sortable.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! sortable.js 0.8.0 */ -(function(){var a,b,c,d,e,f,g;a="table[data-sortable]",d=/^-?[£$¤]?[\d,.]+%?$/,g=/^\s+|\s+$/g,c=["click"],f="ontouchstart"in document.documentElement,f&&c.push("touchstart"),b=function(a,b,c){return null!=a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)},e={init:function(b){var c,d,f,g,h;for(null==b&&(b={}),null==b.selector&&(b.selector=a),d=document.querySelectorAll(b.selector),h=[],f=0,g=d.length;g>f;f++)c=d[f],h.push(e.initTable(c));return h},initTable:function(a){var b,c,d,f,g,h;if(1===(null!=(h=a.tHead)?h.rows.length:void 0)&&"true"!==a.getAttribute("data-sortable-initialized")){for(a.setAttribute("data-sortable-initialized","true"),d=a.querySelectorAll("th"),b=f=0,g=d.length;g>f;b=++f)c=d[b],"false"!==c.getAttribute("data-sortable")&&e.setupClickableTH(a,c,b);return a}},setupClickableTH:function(a,d,f){var g,h,i,j,k,l;for(i=e.getColumnType(a,f),h=function(b){var c,g,h,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;if(b.handled===!0)return!1;for(b.handled=!0,m="true"===this.getAttribute("data-sorted"),n=this.getAttribute("data-sorted-direction"),h=m?"ascending"===n?"descending":"ascending":i.defaultSortDirection,p=this.parentNode.querySelectorAll("th"),s=0,w=p.length;w>s;s++)d=p[s],d.setAttribute("data-sorted","false"),d.removeAttribute("data-sorted-direction");if(this.setAttribute("data-sorted","true"),this.setAttribute("data-sorted-direction",h),o=a.tBodies[0],l=[],m){for(D=o.rows,v=0,z=D.length;z>v;v++)g=D[v],l.push(g);for(l.reverse(),B=0,A=l.length;A>B;B++)k=l[B],o.appendChild(k)}else{for(r=null!=i.compare?i.compare:function(a,b){return b-a},c=function(a,b){return a[0]===b[0]?a[2]-b[2]:i.reverse?r(b[0],a[0]):r(a[0],b[0])},C=o.rows,j=t=0,x=C.length;x>t;j=++t)k=C[j],q=e.getNodeValue(k.cells[f]),null!=i.comparator&&(q=i.comparator(q)),l.push([q,k,j]);for(l.sort(c),u=0,y=l.length;y>u;u++)k=l[u],o.appendChild(k[1])}return"function"==typeof window.CustomEvent&&"function"==typeof a.dispatchEvent?a.dispatchEvent(new CustomEvent("Sortable.sorted",{bubbles:!0})):void 0},l=[],j=0,k=c.length;k>j;j++)g=c[j],l.push(b(d,g,h));return l},getColumnType:function(a,b){var c,d,f,g,h,i,j,k,l,m,n;if(d=null!=(l=a.querySelectorAll("th")[b])?l.getAttribute("data-sortable-type"):void 0,null!=d)return e.typesObject[d];for(m=a.tBodies[0].rows,h=0,j=m.length;j>h;h++)for(c=m[h],f=e.getNodeValue(c.cells[b]),n=e.types,i=0,k=n.length;k>i;i++)if(g=n[i],g.match(f))return g;return e.typesObject.alpha},getNodeValue:function(a){var b;return a?(b=a.getAttribute("data-value"),null!==b?b:"undefined"!=typeof a.innerText?a.innerText.replace(g,""):a.textContent.replace(g,"")):""},setupTypes:function(a){var b,c,d,f;for(e.types=a,e.typesObject={},f=[],c=0,d=a.length;d>c;c++)b=a[c],f.push(e.typesObject[b.name]=b);return f}},e.setupTypes([{name:"numeric",defaultSortDirection:"descending",match:function(a){return a.match(d)},comparator:function(a){return parseFloat(a.replace(/[^0-9.-]/g,""),10)||0}},{name:"date",defaultSortDirection:"ascending",reverse:!0,match:function(a){return!isNaN(Date.parse(a))},comparator:function(a){return Date.parse(a)||0}},{name:"alpha",defaultSortDirection:"ascending",match:function(){return!0},compare:function(a,b){return a.localeCompare(b)}}]),setTimeout(e.init,0),"function"==typeof define&&define.amd?define(function(){return e}):"undefined"!=typeof exports?module.exports=e:window.Sortable=e}).call(this);
\ No newline at end of file diff --git a/src/usr/local/www/status_lb_vs.php b/src/usr/local/www/status_lb_vs.php index 94f3c71..ad50b5c 100644 --- a/src/usr/local/www/status_lb_vs.php +++ b/src/usr/local/www/status_lb_vs.php @@ -101,11 +101,11 @@ else { <div class="table-responsive"></div> <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> <tr> - <td><?=gettext("Name"); ?></td> - <td><?=gettext("Address"); ?></td> - <td><?=gettext("Servers"); ?></td> - <td><?=gettext("Status"); ?></td> - <td><?=gettext("Description"); ?></td> + <th><?=gettext("Name"); ?></th> + <th><?=gettext("Address"); ?></th> + <th><?=gettext("Servers"); ?></th> + <th><?=gettext("Status"); ?></th> + <th><?=gettext("Description"); ?></th> </tr> <?php $i = 0; diff --git a/src/usr/local/www/status_wireless.php b/src/usr/local/www/status_wireless.php index 8595f52..62d336c 100644 --- a/src/usr/local/www/status_wireless.php +++ b/src/usr/local/www/status_wireless.php @@ -185,7 +185,7 @@ display_top_tabs($tab_array); <div class="panel-heading"><h2 class="panel-title"><?=gettext("Associated or ad-hoc peers")?></h2></div> <div class="panel-body"> <div class="table-responsive"> - <table class="table table-striped table-hover table-condensed"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> <thead> <tr> <th>ADDR</font></th> diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index a226eee..5cd0b5d 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -481,8 +481,6 @@ if (!($act == "new" || $act == "edit" || $input_errors)) { </tr> </thead> <tbody> - </tbody> - <tbody> <?php foreach($a_user as $i => $userent): ?> diff --git a/src/usr/local/www/widgets/widgets/openvpn.widget.php b/src/usr/local/www/widgets/widgets/openvpn.widget.php index c8b71b5..d64043c 100644 --- a/src/usr/local/www/widgets/widgets/openvpn.widget.php +++ b/src/usr/local/www/widgets/widgets/openvpn.widget.php @@ -197,7 +197,7 @@ $clients = openvpn_get_active_clients(); <div class="widget panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?=gettext("Peer to Peer Server Instance Statistics");?></h2></div> <div class="table-responsive"> - <table class="table table striped table-hover table-condensed"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> <thead> <tr> <th>Remote/Virtual IP</th> @@ -247,7 +247,7 @@ $clients = openvpn_get_active_clients(); <div class="widget panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?=gettext("Client Instance Statistics");?></h2></div> <div class="table-responsive"> - <table class="table table striped table-hover table-condensed"> + <table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable> <thead> <tr> <th>Name/Time</th> |