SELECT host
,max(updated) as last_updated
,min(updated) as first_updated
- ,(SELECT count(path.val) FROM host_info path WHERE path.host=hi.host AND path.key LIKE 'git.%.path') as repos
+ ,0 as count
,(SELECT max(CAST(ex.val as INTEGER)) as exit FROM host_info ex
WHERE ex.host=hi.host AND ex.key LIKE 'git.%.exit_code'
) as exit
+ ,(SELECT string_agg((name.val),' ') as repos FROM host_info name WHERE name.host=hi.host AND name.key LIKE 'git.%.name') as repos
FROM host_info hi
WHERE key LIKE 'git.%'
GROUP BY host ORDER BY last_updated DESC, host
"),
'row_parse_pre' => function(&$row,$t) {
+
+ #$repos = array_map(function($a){return basename($a);},explode(' ',$row['repos']));
+ if (isset($row['repos'])) {
+ $repos = explode(' ',$row['repos']);
+ sort($repos);
+ $row['repos'] = join(' ',$repos);
+ $row['count'] = count($repos);
+ }
+
foreach ($row as $k=>$v) {
if (strpos($k,'updated') !== false) {
$row[$k] = preg_replace('/\..*$/','',$v);
* Does what it says
*/
public static function ar_map($return,$array,$as_hash=false) {
- # NB 15.12.22: Depreciated use direct php arra_map functions
+ # NB 15.12.22: Depreciated use direct php array_map functions
$map = $array;
# NB 30.11.22: Does not work get error message mb_strlen does not exists
#bye($return);