1616
1717var Table = require ( 'cli-table' ) ;
1818var util = require ( "util" ) ;
19- var colors = require ( "colors/safe" ) ;
2019
2120var outputFormat = "text" ;
2221
@@ -34,8 +33,8 @@ function logModule(result) {
3433 return ;
3534 }
3635 var table = plainTable ( { plain :true } ) ;
37- table . push ( [ colors . bold ( "Module:" ) , result . name ] ) ;
38- table . push ( [ colors . bold ( "Version:" ) , result . version ] ) ;
36+ table . push ( [ "Module:" , result . name ] ) ;
37+ table . push ( [ "Version:" , result . version ] ) ;
3938 console . log ( table . toString ( ) ) ;
4039 console . log ( ) ;
4140 logNodeList ( result . nodes ) ;
@@ -64,12 +63,12 @@ function logNodeSet(node) {
6463 }
6564 }
6665 var table = plainTable ( { plain :true } ) ;
67- table . push ( [ colors . bold ( "Name:" ) , colors . cyan ( colors . bold ( node . id ) ) ] ) ;
68- table . push ( [ colors . bold ( "Module:" ) , node . module ] ) ;
69- table . push ( [ colors . bold ( "Version:" ) , node . version ] ) ;
66+ table . push ( [ "Name:" , node . id ] ) ;
67+ table . push ( [ "Module:" , node . module ] ) ;
68+ table . push ( [ "Version:" , node . version ] ) ;
7069
71- table . push ( [ colors . bold ( "Types:" ) , node . types . join ( ", " ) ] ) ;
72- table . push ( [ colors . bold ( "State:" ) , ( node . err ?colors . red ( node . err ) :( node . enabled ?"enabled" :"disabled" ) ) ] ) ;
70+ table . push ( [ "Types:" , node . types . join ( ", " ) ] ) ;
71+ table . push ( [ "State:" , ( node . err ?node . err :( node . enabled ?"enabled" :"disabled" ) ) ] ) ;
7372
7473 console . log ( table . toString ( ) ) ;
7574}
@@ -94,23 +93,23 @@ function logNodeList(nodes) {
9493 return 0 ;
9594 } ) ;
9695 var nodeTable = plainTable ( ) ;
97- nodeTable . push ( [ colors . bold ( "Nodes" ) , colors . bold ( "Types" ) , colors . bold ( "State" ) ] ) ;
96+ nodeTable . push ( [ "Nodes" , "Types" , "State" ] ) ;
9897
9998 for ( var i = 0 ; i < nodes . length ; i ++ ) {
10099 var node = nodes [ i ] ;
101- var state = node . enabled ?( node . err ?colors . red ( "error" ) :"enabled" ) :colors . grey ( "disabled" ) ;
100+ var state = node . enabled ?( node . err ?"error" :"enabled" ) :"disabled" ;
102101 var enabled = node . enabled && ! node . err ;
103102
104103 var types = "" ;
105104 for ( var j = 0 ; j < node . types . length ; j ++ ) {
106- types += ( j > 0 ?"\n" :"" ) + ( enabled ?node . types [ j ] :colors . grey ( node . types [ j ] ) ) ;
105+ types += ( j > 0 ?"\n" :"" ) + ( enabled ?node . types [ j ] :node . types [ j ] ) ;
107106 }
108107 if ( types . length === 0 ) {
109- types = colors . grey ( "none" ) ;
108+ types = "none" ;
110109 }
111110
112- nodeTable . push ( [ enabled ?colors . cyan ( colors . bold ( node . id ) ) : colors . grey ( node . id ) ,
113- enabled ?types :colors . grey ( types ) ,
111+ nodeTable . push ( [ enabled ?node . id : node . id ,
112+ enabled ?types :types ,
114113 state ] ) ;
115114 }
116115 console . log ( nodeTable . toString ( ) ) ;
@@ -150,22 +149,22 @@ module.exports = {
150149 warn :function ( msg ) {
151150 if ( msg . response ) {
152151 if ( msg . response . status === 401 ) {
153- console . warn ( "Not logged in. Use '" + colors . yellow ( colors . bold ( " node-red-admin login" ) ) + " ' to log in.") ;
152+ console . warn ( "Not logged in. Use 'node-red-admin login' to log in." ) ;
154153 } else if ( msg . response . data ) {
155- console . warn ( colors . magenta ( msg . response . status + ": " + msg . response . data . message ) ) ;
154+ console . warn ( msg . response . status + ": " + msg . response . data . message ) ;
156155 } else {
157- console . warn ( colors . magenta ( msg . response . status + ": " + msg . toString ( ) ) ) ;
156+ console . warn ( msg . response . status + ": " + msg . toString ( ) ) ;
158157 }
159158 } else {
160- console . warn ( colors . magenta ( msg . toString ( ) ) ) ;
159+ console . warn ( msg . toString ( ) ) ;
161160 }
162161 } ,
163162 help :function ( command ) {
164- var helpText = colors . bold ( "Usage:" ) + "\n" +
163+ var helpText = "Usage:" + "\n" +
165164 " node-red-admin " + command . usage + "\n\n" +
166- colors . bold ( "Description:" ) + "\n" +
165+ "Description:" + "\n" +
167166 " " + command . description + "\n\n" +
168- colors . bold ( "Options:" ) + "\n" +
167+ "Options:" + "\n" +
169168 ( command . options ? " " + command . options + "\n" : "" ) +
170169 " -h|? --help display this help text and exit" ;
171170 console . log ( helpText ) ;
0 commit comments