This is an automated email from the ASF dual-hosted git repository.

jfthomps pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/vcl.git


The following commit(s) were added to refs/heads/develop by this push:
     new de4f72c1 computer.js: -modified Computer.prototype.nocasesort: 
somewhat handle things passed in that are not strings -modified initPage and 
refreshcompdata: set vmhost to be sorted using nocasesort
de4f72c1 is described below

commit de4f72c11ec39fae6c0fe511c4bfb2dcfca6127f
Author: Josh Thompson <jftho...@ncsu.edu>
AuthorDate: Wed Mar 13 15:15:30 2024 -0400

    computer.js:
    -modified Computer.prototype.nocasesort: somewhat handle things passed in 
that are not strings
    -modified initPage and refreshcompdata: set vmhost to be sorted using 
nocasesort
---
 web/js/resources/computer.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/web/js/resources/computer.js b/web/js/resources/computer.js
index dd08e374..ab7d18c4 100644
--- a/web/js/resources/computer.js
+++ b/web/js/resources/computer.js
@@ -197,6 +197,12 @@ Computer.prototype.Selection = function() {
 }
 
 Computer.prototype.nocasesort = function(a, b) {
+       if(typeof a != 'string' && typeof b != 'string')
+               return 0;
+       if(typeof a != 'string')
+               return -1;
+       if(typeof b != 'string')
+               return 1;
        var al = a.toLowerCase();
        var bl = b.toLowerCase();
        if(al.match(/[0-9]/) ||
@@ -319,6 +325,7 @@ function initPage() {
                resourcestore.comparatorMap['network'] = resource.nocasesort;
                resourcestore.comparatorMap['IPaddress'] = resource.ipsort;
                resourcestore.comparatorMap['privateIPaddress'] = 
resource.ipsort;
+               resourcestore.comparatorMap['vmhost'] = resource.nocasesort;
 
                dojo.connect(resourcegrid, '_onFetchComplete', function() 
{dojo.byId('computercount').innerHTML = 'Computers in table: ' + 
resourcegrid.rowCount;});
        }
@@ -1245,6 +1252,7 @@ function refreshcompdata(refreshcount) {
                                       procspeed: resource.nocasesort,
                                       network: resource.nocasesort,
                                       ram: resource.nocasesort,
+                                      vmhost: resource.nocasesort,
                                       IPaddress: resource.ipsort,
                                       privateIPaddress: resource.ipsort};
        resourcestore.fetch();

Reply via email to