Author: jfthomps
Date: Fri Feb 26 21:39:24 2016
New Revision: 1732561

URL: http://svn.apache.org/viewvc?rev=1732561&view=rev
Log:
VCL-938 - Add a count of computers listed in the table on the Edit Computer 
Profiles page

computer.php: modified extraResourceFilters: added a span for holding the 
computer count after the button for refreshing the table data

computer.js:
-modified initPage: added a timeout to update the displayed computer count 3 
seconds after the page initializes
-modified applyExtraFilters: update the displayed computer count
-modified compGroupFilterSelectionCB: update the displayed computer count

Modified:
    vcl/trunk/web/.ht-inc/computer.php
    vcl/trunk/web/js/resources/computer.js

Modified: vcl/trunk/web/.ht-inc/computer.php
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/.ht-inc/computer.php?rev=1732561&r1=1732560&r2=1732561&view=diff
==============================================================================
--- vcl/trunk/web/.ht-inc/computer.php (original)
+++ vcl/trunk/web/.ht-inc/computer.php Fri Feb 26 21:39:24 2016
@@ -400,6 +400,9 @@ class Computer extends Resource {
                # refresh button
                $h .= dijitButton('', 'Refresh Computer Data', 
'refreshcompdata(0);');
 
+               # span to list count of computer in table
+               $h .= "<span id=\"computercount\"></span>\n";
+
                $h .= "<div dojoType=dijit.Dialog\n";
                $h .= "      id=\"confirmactiondlg\"\n";
                $h .= "      duration=250\n";

Modified: vcl/trunk/web/js/resources/computer.js
URL: 
http://svn.apache.org/viewvc/vcl/trunk/web/js/resources/computer.js?rev=1732561&r1=1732560&r2=1732561&view=diff
==============================================================================
--- vcl/trunk/web/js/resources/computer.js (original)
+++ vcl/trunk/web/js/resources/computer.js Fri Feb 26 21:39:24 2016
@@ -291,6 +291,10 @@ function initPage() {
                resourcestore.comparatorMap['procnumber'] = resource.nocasesort;
                resourcestore.comparatorMap['procspeed'] = resource.nocasesort;
                resourcestore.comparatorMap['network'] = resource.nocasesort;
+
+               setTimeout(function() {
+                       dojo.byId('computercount').innerHTML = 'Computers in 
table: ' + resourcegrid.rowCount;
+               }, 3000);
        }
 }
 
@@ -496,6 +500,8 @@ function applyExtraFilters(value) {
                resourcegrid.query[this.field] = new RegExp('.*' + value + 
'.*', 'i');
        resourcegrid.setQuery(resourcegrid.query);
 
+       dojo.byId('computercount').innerHTML = 'Computers in table: ' + 
resourcegrid.rowCount;
+
        var savelist = resource.selids;
        resourcegrid.selection.clear();
        var newselids = [];
@@ -1254,4 +1260,6 @@ function compGroupFilterSelectionCB(data
        query['id'] = new RegExp(data.items.regids);
 
        resourcegrid.setQuery(query);
+
+       dojo.byId('computercount').innerHTML = 'Computers in table: ' + 
resourcegrid.rowCount;
 }


Reply via email to