]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/host.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Oct 2024 20:29:42 +0000 (22:29 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 17 Oct 2024 20:29:42 +0000 (22:29 +0200)
lib/postgres/host.sql

index a5232d679d389935d89e473170e171fa5c6c2ab6..dd1351fbddb1ddf6457ae89c4c04ec030b1ed1af 100644 (file)
@@ -4,8 +4,14 @@ CREATE VIEW host AS
                ,LEFT(CAST(MAX(updated) AS TEXT),19) as updated
                ,count(*) as infos
                -- ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'git.%.name' THEN val ELSE null END),' ') as installed
+               ,count(DISTINCT CASE WHEN key LIKE 'git.%.path' THEN val ELSE null END) as repos
                ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'git.%.branch' THEN val ELSE null END),' ') as branches
-               ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.width','sys.product' ) THEN val ELSE null END),chr(10)) as product
+               ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.model','sys.os' ) THEN val ELSE null END),chr(10)) as product
+               -- NB 17.10.24 ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.width','sys.product' ) THEN val ELSE null END),chr(10)) as product
        FROM host_info
        GROUP BY host
+       ORDER BY updated DESC,host
 ;
+GRANT ALL PRIVILEGES ON host TO nico;
+GRANT ALL PRIVILEGES ON host TO www;
+GRANT ALL PRIVILEGES ON host TO root;