- // returns a tuple ( label, class)
- // $node needs at least 'run_level' 'boot_state'
- function status_label_class () {
- $label= $this->run_level ? $this->run_level : ( $this->boot_state . '*' ) ;
- if ($this->stale()) $label .= '...';
+
+ function timeaway($val) {
+ if ( $val != NULL ) {
+ $ret = timeDiff(intval($val));
+ } else {
+ $ret = "Never";
+ }
+ return $ret;
+ }
+
+ // code needs to be accessible from outside an object too
+ // b/c of the performance overhead of creating as many objects as nodes
+ static function status_label_class__ ($boot_state, $run_level, $last_contact, $peer_id) {
+ $label= $run_level ? $run_level : ( $boot_state . '*' ) ;
+ if (Node::stale_($last_contact,$peer_id)) $label .= '...';