Exclude restart operations from activity log
This commit is contained in:
@@ -101,7 +101,7 @@ items AS (
|
||||
'Beta test #' || b.id,NULL,bs.server,bs.server_deleted_at,NULL,NULL,'beta',CAST(b.id AS TEXT)
|
||||
FROM betas b JOIN beta_servers bs ON bs.beta_id=b.id
|
||||
UNION ALL
|
||||
SELECT 'host:' || o.id,o.created_at,'host','|host|',
|
||||
SELECT 'host:' || o.id,o.created_at,CASE WHEN o.kind='instance.restart' THEN 'restart' ELSE 'host' END,'|host|',
|
||||
CASE WHEN o.state='completed' AND o.routine=1 AND o.observation_success=0 THEN 'observation-failed'
|
||||
WHEN o.state='completed' AND COALESCE(o.error,'')<>'' THEN 'warning' ELSE o.state END,
|
||||
${labelCase('o.kind', hostOperationTitles, 'Host operation')},
|
||||
@@ -153,7 +153,7 @@ export function activityHistory(input: ActivityQuery = {}, now = Date.now()): Ac
|
||||
const conditions: string[] = [];
|
||||
// Keep lifecycle jobs in Provisioning, including jobs triggered by automation.
|
||||
// Apply this before totals and pagination; resource histories can still include them.
|
||||
if (query.excludeProvisioning) conditions.push("route <> 'provisioning'");
|
||||
if (query.excludeProvisioning) conditions.push("route <> 'provisioning' AND type <> 'restart'");
|
||||
const bindings: Record<string, string | number> = {};
|
||||
for (const key of ['server', 'type', 'state'] as const) if (query[key]) { conditions.push(`${key}=@${key}`); bindings[key] = query[key]; }
|
||||
if (query.host) { conditions.push('(hostId=@host OR secondaryHostId=@host)'); bindings.host = query.host; }
|
||||
|
||||
Reference in New Issue
Block a user