Compare commits

..

No commits in common. "bf21671a1f34aec3e81e57190d3f3b375f0e89fc" and "b6639c7bfcb70236e1ed4c3f33615ea48ae6ff6f" have entirely different histories.

2 changed files with 8 additions and 52 deletions

View File

@ -76,27 +76,9 @@ class HubStats extends Dynamic
$output .= "| FTN | ECHO | NET |FILES| LAST SESSION | MODE |AUTOHLD|\r\n";
$output .= "+--------------+------+-----+-----+------------------+-------+-------+\r\n";
$havedown = FALSE;
$havehold = FALSE;
foreach($r->get() as $o) {
if ($o->uncollected_echomail > 10000)
$o->uncollected_echomail = 9999;
if ($o->uncollected_netmail > 10000)
$o->uncollected_netmail = 9999;
if ($o->uncollected_files > 10000)
$o->uncollected_files = 9999;
if ((! $havedown) && $o->is_down)
$havedown = TRUE;
if ((! $havehold) && $o->is_hold)
$havehold = TRUE;
$output .= sprintf($header,
sprintf('%s %s',$o->ftn4d,$o->is_down ? 'd' : ($o->is_hold ? 'h' : ' ')),
$o->ftn4d,
$o->uncollected_echomail ?? 0,
$o->uncollected_netmail ?? 0,
$o->uncollected_files ?? 0,
@ -107,14 +89,6 @@ class HubStats extends Dynamic
$output .= "+--------------+------+-----+-----+------------------+-------+-------+\r\n";
$output .= "\r\n";
if ($havehold)
$output .= "(h) Node is on HOLD status.\r\n";
if ($havedown)
$output .= "(d) Node is on DOWN status.\r\n";
return $output;
}

View File

@ -60,37 +60,19 @@ class AbsentNodes extends Echomails
$msg->addText("The following nodes have had their status changed, because they are absent from the network.\r\r");
// Nodes marked HOLD - will be marked down ...
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_HOLD))->count()) {
$msg->addText("The following nodes have been marked HOLD:\r");
foreach ($x as $ao)
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
$msg->addText("\r");
}
foreach ($this->aos->filter(fn($item)=>$item->role & Address::NODE_HOLD) as $ao)
$msg->addText(sprintf('* %s marked HOLD, last seen %d days ago',$ao->ftn4d,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
// Nodes marked DOWN - will be delisted on...
if (($x=$this->aos->filter(fn($item)=>$item->role & Address::NODE_DOWN))->count()) {
$msg->addText("The following nodes have been marked DOWN:\r");
foreach ($x as $ao)
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
$msg->addText("\r");
}
foreach ($this->aos->filter(fn($item)=>$item->role & Address::NODE_DOWN) as $ao)
$msg->addText(sprintf('* %s marked DOWN, last seen %d days ago',$ao->ftn4d,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
// Nodes DELISTED
if (($x=$this->aos->filter(fn($item)=>! $item->active))->count()) {
$msg->addText("The following nodes have been DE-LISTED:\r");
foreach ($x as $ao)
$msg->addText(sprintf('* %s (%s), last seen %d days ago',$ao->ftn4d,$ao->system->name,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
$msg->addText("\r");
}
foreach ($this->aos->filter(fn($item)=>! $item->active) as $ao)
$msg->addText(sprintf('* %s DE-LISTED, last seen %d days ago',$ao->ftn4d,$ao->system->last_session->diffInDays($now)).($ao->contacted ? '': ' ^')."\r");
if ($this->aos->filter(fn($item)=>(! $item->contacted))->count())
$msg->addText("^ Unable to contact these nodes.\r");
$msg->addText("\r^ Unable to contact these nodes.\r");
$msg->addText("\rEmails and/or Netmails have been sent to these nodes. If you can help let them know that they have outstanding mail on the Hub, that would be helpful :)");