Phase 2: dashboard tabs + popups, chart fixes, shell relocation

Built via parallel Workflow (5 builders + adversarial verifiers), then
live-rendered and fixed in a headless browser against the running gateway.

Tabs (PrimeControls/Tabs/*):
- Overview: priority cards, KPI status row, alarm-rate timeline, insights, top-5
- Analysis: hour x day heatmap, priority donut vs ISA 80/15/5, MTTA/MTTR, floods
- BadActors: chattering/standing/fleeting tables, focus chip, AlarmDetail wiring
- Journal: paginated getJournalPage table, CSV export, EventDetail wiring

Popups (PrimeControls/Popups/*): HealthScore, ShiftReport, AlarmDetail, EventDetail

Chart fixes (verified rendering in-browser):
- Overview timeline: seeded dataSources.rate, switched to static fills, split
  flood bins into their own red stacked series (per-point deriveFieldsFromData
  fill was crashing render with React.cloneElement null).
- BadActors: removed the dual-axis Pareto XY chart (scaling was unusable);
  replaced with a ranked "Top Sources" table (share-of-total progress bar +
  cumulative %). Same insight, no axis scaling to break.

Structural / hygiene:
- Relocated Header + FilterBar from Dashboard/ to Shell/ and updated the two
  embed paths. A Perspective view cannot resolve sub-views nested inside another
  view's folder, so both were rendering as "view does not exist" placeholders.
- Set persistent:false on all view input params. persistent:true caused the
  gateway to bake the live bundle (with sim tag paths) into Tabs/Analysis on
  render; nulled that baked data and reset the session query range to 0.

lint_project.py: 0 failures / 0 warnings.

Verified in-browser: Overview, BadActors. NOT yet live-verified: Analysis,
Journal, and the four popups (schema-verified only). Header content is next
phase (renders now, but a benign cloneElement console warning remains).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-16 14:45:17 -05:00
parent ecb10b9b7b
commit 83b23431c6
30 changed files with 8678 additions and 312 deletions

View File

@@ -207,7 +207,8 @@ Critical `#D64550`. Accent: `#3B7DD8`. Agents may ADD classes only under
## View ownership (Phase 2/3) ## View ownership (Phase 2/3)
A: `Dashboard/Header` + `Dashboard/FilterBar` · B: `Tabs/Overview` · C: `Tabs/Analysis` · A: `Shell/Header` + `Shell/FilterBar` (relocated out of `Dashboard/` — a view cannot
nest sub-views under another view's folder) · B: `Tabs/Overview` · C: `Tabs/Analysis` ·
D: `Tabs/BadActors` · E: `Tabs/Journal` · F: `Popups/HealthScore`+`Popups/ShiftReport` · D: `Tabs/BadActors` · E: `Tabs/Journal` · F: `Popups/HealthScore`+`Popups/ShiftReport` ·
G: `Popups/AlarmDetail`+`Popups/EventDetail` · H: `Components/HealthGauge` upgrade. G: `Popups/AlarmDetail`+`Popups/EventDetail` · H: `Components/HealthGauge` upgrade.
Integrator-only: `Dashboard/view.json`, session-props, page-config, shared Components, Integrator-only: `Dashboard/view.json`, session-props, page-config, shared Components,

View File

@@ -2,18 +2,18 @@
"custom": { "custom": {
"PrimeControls": { "PrimeControls": {
"query": { "query": {
"startMs": 0,
"endMs": 0,
"rangePreset": "8h",
"priorities": [],
"areas": [], "areas": [],
"states": [], "endMs": 0,
"priorities": [],
"rangePreset": "8h",
"refreshToken": 0,
"search": "", "search": "",
"refreshToken": 0 "startMs": 0,
"states": []
}, },
"ui": { "ui": {
"selectedTab": 0, "badActorFocus": "",
"badActorFocus": "" "selectedTab": 0
} }
} }
}, },
@@ -68,15 +68,28 @@
"props.lastActivity": { "props.lastActivity": {
"access": "SYSTEM", "access": "SYSTEM",
"persistent": false "persistent": false
},
"props.offline.capable": {
"access": "SYSTEM",
"persistent": false
},
"props.offline.enabled": {
"access": "SYSTEM",
"persistent": false
},
"props.offline.lastSynced": {
"access": "SYSTEM",
"persistent": false
} }
}, },
"props": { "props": {
"address": "172.18.0.5", "address": "172.23.0.1",
"device": {}, "device": {},
"geolocation": {}, "geolocation": {},
"locale": "en-US", "locale": "en-US",
"offline": {},
"securityLevels": [], "securityLevels": [],
"theme": "light-cool", "theme": "light-cool",
"timeZoneId": "America/Los_Angeles" "timeZoneId": "America/Chicago"
} }
} }

View File

@@ -7,11 +7,11 @@
"propConfig": { "propConfig": {
"params.icon": { "params.icon": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.message": { "params.message": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -90,4 +90,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -6,7 +6,7 @@
"propConfig": { "propConfig": {
"params.health": { "params.health": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -134,4 +134,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -1,17 +1,17 @@
{ {
"custom": {}, "custom": {},
"params": { "params": {
"count": 0, "count": null,
"max": 0 "max": null
}, },
"propConfig": { "propConfig": {
"params.count": { "params.count": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.max": { "params.max": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -91,4 +91,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -2,26 +2,26 @@
"custom": {}, "custom": {},
"params": { "params": {
"icon": null, "icon": null,
"severity": 3, "severity": null,
"tab": null, "tab": null,
"text": null "text": null
}, },
"propConfig": { "propConfig": {
"params.icon": { "params.icon": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.severity": { "params.severity": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.tab": { "params.tab": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.text": { "params.text": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -118,4 +118,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -2,26 +2,26 @@
"custom": {}, "custom": {},
"params": { "params": {
"delta": null, "delta": null,
"label": "KPI", "label": null,
"unit": null, "unit": null,
"value": null "value": null
}, },
"propConfig": { "propConfig": {
"params.delta": { "params.delta": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.label": { "params.label": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.unit": { "params.unit": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.value": { "params.value": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -181,4 +181,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -1,22 +1,22 @@
{ {
"custom": {}, "custom": {},
"params": { "params": {
"count": 0, "count": null,
"pct": null, "pct": null,
"priority_name": null "priority_name": null
}, },
"propConfig": { "propConfig": {
"params.count": { "params.count": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.pct": { "params.pct": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.priority_name": { "params.priority_name": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -134,4 +134,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -10,23 +10,23 @@
"propConfig": { "propConfig": {
"params.detail": { "params.detail": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.key": { "params.key": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.label": { "params.label": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.score": { "params.score": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.weight": { "params.weight": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -204,4 +204,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -1,7 +1,7 @@
{ {
"custom": {}, "custom": {},
"params": { "params": {
"count": 0, "count": null,
"label": null, "label": null,
"pct": null, "pct": null,
"rank": null, "rank": null,
@@ -10,23 +10,23 @@
"propConfig": { "propConfig": {
"params.count": { "params.count": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.label": { "params.label": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.pct": { "params.pct": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.rank": { "params.rank": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.source": { "params.source": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -189,4 +189,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -1,17 +1,17 @@
{ {
"custom": {}, "custom": {},
"params": { "params": {
"index": 0, "index": null,
"title": "Tab" "title": null
}, },
"propConfig": { "propConfig": {
"params.index": { "params.index": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}, },
"params.title": { "params.title": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
} }
}, },
"props": {}, "props": {},
@@ -66,4 +66,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -1,68 +0,0 @@
{
"custom": {},
"params": {
"bundle": null
},
"propConfig": {
"params.bundle": {
"paramDirection": "input",
"persistent": true
}
},
"props": {},
"root": {
"children": [
{
"meta": {
"name": "ph"
},
"props": {
"style": {
"classes": "PrimeControls/Empty"
},
"text": "Filter bar - built in Phase 2"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "evt"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn 'bundle: %s events in range' % value['meta']['event_count']\n\texcept:\n\t\treturn 'bundle: not loaded'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"alignItems": "center",
"classes": "PrimeControls/Card",
"justifyContent": "center"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -1,68 +0,0 @@
{
"custom": {},
"params": {
"bundle": null
},
"propConfig": {
"params.bundle": {
"paramDirection": "input",
"persistent": true
}
},
"props": {},
"root": {
"children": [
{
"meta": {
"name": "ph"
},
"props": {
"style": {
"classes": "PrimeControls/Empty"
},
"text": "Header - built in Phase 2"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "evt"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn 'bundle: %s events in range' % value['meta']['event_count']\n\texcept:\n\t\treturn 'bundle: not loaded'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"alignItems": "center",
"classes": "PrimeControls/Card",
"justifyContent": "center"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -1,7 +1,5 @@
{ {
"custom": { "custom": {},
"bundle": null
},
"events": { "events": {
"system": { "system": {
"onStartup": { "onStartup": {
@@ -44,7 +42,6 @@
}, },
"position": { "position": {
"basis": "150px", "basis": "150px",
"grow": 0,
"shrink": 0 "shrink": 0
}, },
"propConfig": { "propConfig": {
@@ -58,8 +55,7 @@
} }
}, },
"props": { "props": {
"params": {}, "path": "PrimeControls/Shell/Header"
"path": "PrimeControls/Dashboard/Header"
}, },
"type": "ia.display.view" "type": "ia.display.view"
}, },
@@ -69,7 +65,6 @@
}, },
"position": { "position": {
"basis": "56px", "basis": "56px",
"grow": 0,
"shrink": 0 "shrink": 0
}, },
"propConfig": { "propConfig": {
@@ -83,8 +78,7 @@
} }
}, },
"props": { "props": {
"params": {}, "path": "PrimeControls/Shell/FilterBar"
"path": "PrimeControls/Dashboard/FilterBar"
}, },
"type": "ia.display.view" "type": "ia.display.view"
}, },
@@ -164,11 +158,9 @@
}, },
"position": { "position": {
"basis": "42px", "basis": "42px",
"grow": 0,
"shrink": 0 "shrink": 0
}, },
"props": { "props": {
"direction": "row",
"style": { "style": {
"borderBottomColor": "var(--neutral-40)", "borderBottomColor": "var(--neutral-40)",
"borderBottomStyle": "solid", "borderBottomStyle": "solid",
@@ -205,7 +197,6 @@
} }
}, },
"props": { "props": {
"params": {},
"path": "PrimeControls/Tabs/Overview" "path": "PrimeControls/Tabs/Overview"
}, },
"type": "ia.display.view" "type": "ia.display.view"
@@ -236,7 +227,6 @@
} }
}, },
"props": { "props": {
"params": {},
"path": "PrimeControls/Tabs/Analysis" "path": "PrimeControls/Tabs/Analysis"
}, },
"type": "ia.display.view" "type": "ia.display.view"
@@ -267,7 +257,6 @@
} }
}, },
"props": { "props": {
"params": {},
"path": "PrimeControls/Tabs/BadActors" "path": "PrimeControls/Tabs/BadActors"
}, },
"type": "ia.display.view" "type": "ia.display.view"
@@ -298,7 +287,6 @@
} }
}, },
"props": { "props": {
"params": {},
"path": "PrimeControls/Tabs/Journal" "path": "PrimeControls/Tabs/Journal"
}, },
"type": "ia.display.view" "type": "ia.display.view"
@@ -328,4 +316,4 @@
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }

View File

@@ -0,0 +1,792 @@
{
"custom": {
"detail": null
},
"params": {
"label": null,
"source": null
},
"propConfig": {
"custom.detail": {
"binding": {
"config": {
"expression": "{view.params.source} + '|' + {session.custom.PrimeControls.query.startMs} + '|' + {session.custom.PrimeControls.query.endMs}"
},
"transforms": [
{
"code": "\ttry:\n\t\tsrc = self.view.params.source\n\texcept:\n\t\tsrc = None\n\tif not src:\n\t\treturn None\n\ttry:\n\t\tq = self.session.custom.PrimeControls.query\n\t\treturn PrimeControls.alarms.getSourceDetail(src, q.startMs, q.endMs)\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "expr"
}
},
"params.label": {
"paramDirection": "input",
"persistent": false
},
"params.source": {
"paramDirection": "input",
"persistent": false
}
},
"props": {
"defaultSize": {
"height": 660,
"width": 720
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "lblTitle"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.label"
},
"transforms": [
{
"code": "\tif value:\n\t\treturn value\n\ttry:\n\t\treturn self.view.params.source or 'Alarm Detail'\n\texcept:\n\t\treturn 'Alarm Detail'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Big"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "lblArea"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['area'] or ''\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "headerCol"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"meta": {
"name": "kpiCount"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['stats']['count'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Activations"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiTta"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.dur(value['stats']['avg_tta_ms'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Avg Time to Ack"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiActive"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.dur(value['stats']['avg_active_ms'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Avg Active Time"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiFleeting"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.value": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['stats']['fleeting_count'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Fleeting"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "statsRow"
},
"position": {
"basis": "88px",
"shrink": 0
},
"props": {
"alignItems": "stretch",
"style": {
"gap": "10px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblDailyTitle"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/CardTitle"
},
"text": "Daily activity"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "repDaily"
},
"position": {
"basis": "30px",
"shrink": 0
},
"propConfig": {
"props.instances": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\tdaily = list(value['daily'] or [])\n\texcept:\n\t\tdaily = []\n\tcounts = []\n\tfor d in daily:\n\t\ttry:\n\t\t\tcounts.append(int(d['count']))\n\t\texcept:\n\t\t\tcounts.append(0)\n\tif not counts:\n\t\treturn []\n\tm = max(counts)\n\treturn [{'count': c, 'max': m} for c in counts]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"direction": "row",
"elementPosition": {
"basis": "12px",
"grow": 1,
"shrink": 1
},
"path": "PrimeControls/Components/HeatmapCell"
},
"type": "ia.display.flex-repeater"
},
{
"meta": {
"name": "lblDailyRange"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\tdaily = list(value['daily'] or [])\n\texcept:\n\t\tdaily = []\n\tif not daily:\n\t\treturn 'No activity in range'\n\ttry:\n\t\treturn 'Activations per day, %s - %s' % (PrimeControls.fmt.day_clock(daily[0]['t0']), PrimeControls.fmt.day_clock(daily[-1]['t0']))\n\texcept:\n\t\treturn 'Activations per day'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "cardDaily"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "6px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblAckTitle"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/CardTitle"
},
"text": "Top ack users"
},
"type": "ia.display.label"
},
{
"children": [
{
"meta": {
"name": "ack0"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['stats']['top_ack_users']) > 0\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\tu = value['stats']['top_ack_users'][0]\n\t\treturn '%s (%d)' % (u['user'], u['count'])\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Chip/Flat",
"paddingBottom": "2px",
"paddingTop": "2px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "ack1"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['stats']['top_ack_users']) > 1\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\tu = value['stats']['top_ack_users'][1]\n\t\treturn '%s (%d)' % (u['user'], u['count'])\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Chip/Flat",
"paddingBottom": "2px",
"paddingTop": "2px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "ack2"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['stats']['top_ack_users']) > 2\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\tu = value['stats']['top_ack_users'][2]\n\t\treturn '%s (%d)' % (u['user'], u['count'])\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Chip/Flat",
"paddingBottom": "2px",
"paddingTop": "2px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "lblNoAcks"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['stats']['top_ack_users']) == 0\n\texcept:\n\t\treturn True",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "No acknowledgements in range"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "ackRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"style": {
"gap": "6px"
},
"wrap": "wrap"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "cardAcks"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "6px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblEvTitle"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/CardTitle"
},
"text": "Recent events"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "tblEvents"
},
"position": {
"grow": 1
},
"propConfig": {
"props.data": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\tout = []\n\ttry:\n\t\trows = list(value['events'] or [])\n\texcept:\n\t\trows = []\n\tfor r in rows[:25]:\n\t\ttry:\n\t\t\tout.append({'time_label': r['time_label'], 'state_label': r['state_label'], 'ack_user': r['ack_user'] or ''})\n\t\texcept:\n\t\t\tpass\n\treturn out",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"columns": [
{
"field": "time_label",
"header": {
"title": "Time"
},
"render": "string",
"sortable": false,
"strictWidth": true,
"width": 160
},
{
"field": "state_label",
"header": {
"title": "State"
},
"render": "string",
"sortable": false,
"strictWidth": true,
"width": 110
},
{
"field": "ack_user",
"header": {
"title": "Ack by"
},
"render": "string",
"sortable": false
}
],
"emptyMessage": {
"noData": {
"text": "No events in range"
}
},
"pager": {
"bottom": false,
"top": false
}
},
"type": "ia.display.table"
}
],
"meta": {
"name": "cardEvents"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "6px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "bodyCol"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\tif value is None:\n\t\treturn False\n\ttry:\n\t\treturn not value['error']\n\texcept:\n\t\treturn True",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"direction": "column",
"style": {
"gap": "10px"
}
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "emptyWrap"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.detail"
},
"transforms": [
{
"code": "\tif value is None:\n\t\treturn True\n\ttry:\n\t\treturn bool(value['error'])\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"icon": "notifications_off",
"message": "No journal data for this alarm in the selected range"
},
"path": "PrimeControls/Components/EmptyState"
},
"type": "ia.display.view"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup('PC_AlarmDetail')"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnClose"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Close"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "footerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"justify": "flex-end"
},
"type": "ia.container.flex"
}
],
"custom": {},
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/PageBg",
"gap": "10px",
"padding": "16px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -0,0 +1,660 @@
{
"custom": {
"props": []
},
"params": {
"event": null
},
"propConfig": {
"custom.props": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\tev = value\n\tif not ev:\n\t\treturn []\n\ttry:\n\t\tres = PrimeControls.alarms.getEventData(ev['id'], ev['time_ms'], ev['source'])\n\t\treturn res['props'] or []\n\texcept:\n\t\treturn []",
"type": "script"
}
],
"type": "property"
}
},
"params.event": {
"paramDirection": "input",
"persistent": false
}
},
"props": {
"defaultSize": {
"height": 580,
"width": 580
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "lblTitle"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['label'] or value['source'] or 'Event Detail'\n\texcept:\n\t\treturn 'Event Detail'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Big"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "chipState"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\treturn value is not None",
"type": "script"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\ts = value['state']\n\texcept:\n\t\ts = None\n\tif s == 'ack':\n\t\treturn 'PrimeControls/State/Acked'\n\tif s == 'clear':\n\t\treturn 'PrimeControls/State/Cleared'\n\treturn 'PrimeControls/State/Active'",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['state_label'] or ''\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"borderRadius": "10px",
"fontSize": "11px",
"paddingBottom": "2px",
"paddingLeft": "8px",
"paddingRight": "8px",
"paddingTop": "2px"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "chipPriority"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\treturn value is not None",
"type": "script"
}
],
"type": "property"
}
},
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\tp = value['priority_name']\n\texcept:\n\t\tp = None\n\tif p not in ['Diagnostic', 'Low', 'Medium', 'High', 'Critical']:\n\t\tp = 'Diagnostic'\n\treturn 'PrimeControls/Priority/' + p",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['priority_name'] or ''\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"borderRadius": "10px",
"fontSize": "11px",
"paddingBottom": "2px",
"paddingLeft": "8px",
"paddingRight": "8px",
"paddingTop": "2px"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "headerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "k"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Time"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "v"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['time_label'] or PrimeControls.fmt.day_clock(value['time_ms'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {},
"type": "ia.display.label"
}
],
"meta": {
"name": "rowTime"
},
"props": {
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "k"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Source"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "v"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['source'] or '--'\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"overflowWrap": "anywhere"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "rowSource"
},
"props": {
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "k"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Area"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "v"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['area'] or '--'\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {},
"type": "ia.display.label"
}
],
"meta": {
"name": "rowArea"
},
"props": {
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "k"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Ack by"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "v"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['ack_user'] or '--'\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {},
"type": "ia.display.label"
}
],
"meta": {
"name": "rowAck"
},
"props": {
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "cardCore"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "4px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblPropsTitle"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/CardTitle"
},
"text": "Event properties"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "tblProps"
},
"position": {
"grow": 1
},
"propConfig": {
"props.data": {
"binding": {
"config": {
"path": "view.custom.props"
},
"transforms": [
{
"code": "\tout = []\n\tfor p in (value or []):\n\t\ttry:\n\t\t\tv = p['value']\n\t\t\tout.append({'name': '%s' % p['name'], 'value': '' if v is None else '%s' % v})\n\t\texcept:\n\t\t\tpass\n\treturn out",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"columns": [
{
"field": "name",
"header": {
"title": "Property"
},
"render": "string",
"sortable": false,
"strictWidth": true,
"width": 180
},
{
"field": "value",
"header": {
"title": "Value"
},
"render": "string",
"sortable": false
}
],
"emptyMessage": {
"noData": {
"text": "No extended properties for this event"
}
},
"pager": {
"bottom": false,
"top": false
}
},
"type": "ia.display.table"
}
],
"meta": {
"name": "cardProps"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "6px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "bodyCol"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\treturn value is not None",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"direction": "column",
"style": {
"gap": "10px"
}
},
"type": "ia.container.flex"
},
{
"meta": {
"name": "emptyWrap"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.event"
},
"transforms": [
{
"code": "\treturn value is None",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"icon": "info",
"message": "No event selected"
},
"path": "PrimeControls/Components/EmptyState"
},
"type": "ia.display.view"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup('PC_EventDetail')"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnClose"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Close"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "footerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"justify": "flex-end"
},
"type": "ia.container.flex"
}
],
"custom": {},
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/PageBg",
"gap": "10px",
"padding": "16px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -0,0 +1,10 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"view.json"
],
"attributes": {}
}

View File

@@ -0,0 +1,316 @@
{
"custom": {},
"params": {
"health": null
},
"propConfig": {
"params.health": {
"paramDirection": "input",
"persistent": false
}
},
"props": {
"defaultSize": {
"height": 540,
"width": 540
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "gradeChip"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.params.health"
},
"transforms": [
{
"code": "\ttry:\n\t\tg = value['grade']\n\texcept:\n\t\tg = None\n\treturn 'PrimeControls/Grade/' + (g if g in ['A', 'B', 'C', 'D', 'F'] else 'NA')",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.health"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['grade'] or 'N/A'\n\texcept:\n\t\treturn 'N/A'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"fontSize": "38px",
"paddingBottom": "4px",
"paddingLeft": "18px",
"paddingRight": "18px",
"paddingTop": "4px",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"children": [
{
"meta": {
"name": "lblTitle"
},
"props": {
"style": {
"classes": "PrimeControls/Text/Big"
},
"text": "Alarm Health Score"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "lblScore"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.health"
},
"transforms": [
{
"code": "\ttry:\n\t\ts = value['score']\n\texcept:\n\t\ts = None\n\tif s is None:\n\t\treturn 'No data in selected range'\n\treturn 'Overall score %s / 100' % PrimeControls.fmt.num(s, 1)",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "titleCol"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"justify": "center"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "headerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"style": {
"gap": "14px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblSubsTitle"
},
"position": {
"shrink": 0
},
"props": {
"style": {
"classes": "PrimeControls/CardTitle"
},
"text": "Component scores"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "repSubs"
},
"position": {
"grow": 1
},
"propConfig": {
"props.instances": {
"binding": {
"config": {
"path": "view.params.health"
},
"transforms": [
{
"code": "\ttry:\n\t\tsubs = value['subs'] or []\n\texcept:\n\t\tsubs = []\n\tout = []\n\tfor s in subs:\n\t\ttry:\n\t\t\tout.append({'key': s['key'], 'label': s['label'], 'score': s['score'], 'weight': s['weight'], 'detail': s['detail']})\n\t\texcept:\n\t\t\tpass\n\treturn out",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"direction": "column",
"elementPosition": {
"basis": "64px",
"grow": 0,
"shrink": 0
},
"path": "PrimeControls/Components/ScoreBar",
"style": {
"overflowY": "auto"
}
},
"type": "ia.display.flex-repeater"
},
{
"meta": {
"name": "emptyWrap"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.health"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn not (value and value['subs'])\n\texcept:\n\t\treturn True",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"icon": "assessment",
"message": "No health data in the selected range"
},
"path": "PrimeControls/Components/EmptyState"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "cardSubs"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"gap": "6px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblCaption"
},
"position": {
"grow": 1,
"shrink": 1
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Weighted ISA-18.2 composite: rate, flood, chattering, standing, priority mix"
},
"type": "ia.display.label"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup('PC_HealthScore')"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnClose"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Close"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "footerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"justify": "space-between",
"style": {
"gap": "12px"
}
},
"type": "ia.container.flex"
}
],
"custom": {},
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/PageBg",
"gap": "12px",
"padding": "16px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -0,0 +1,10 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"view.json"
],
"attributes": {}
}

View File

@@ -0,0 +1,204 @@
{
"custom": {
"report": null
},
"params": {},
"propConfig": {
"custom.report": {
"binding": {
"config": {
"expression": "{session.custom.PrimeControls.query.refreshToken}"
},
"transforms": [
{
"code": "\ttry:\n\t\tr = PrimeControls.alarms.getShiftReportText()\n\t\tif r and r['text']:\n\t\t\treturn r\n\texcept:\n\t\tpass\n\treturn {'text': 'Report unavailable', 'start_ms': 0, 'end_ms': 0, 'label': ''}",
"type": "script"
}
],
"type": "expr"
}
}
},
"props": {
"defaultSize": {
"height": 560,
"width": 620
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "lblTitle"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.report"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['label'] or 'Shift Report'\n\texcept:\n\t\treturn 'Shift Report'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Big"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "lblWindow"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.report"
},
"transforms": [
{
"code": "\ttry:\n\t\ts = value['start_ms']\n\t\te = value['end_ms']\n\texcept:\n\t\treturn ''\n\tif not s or not e:\n\t\treturn ''\n\treturn '%s - %s' % (PrimeControls.fmt.day_clock(s), PrimeControls.fmt.day_clock(e))",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "headerCol"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "lblText"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.report"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['text'] or 'Report unavailable'\n\texcept:\n\t\treturn 'Report unavailable'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"fontFamily": "monospace",
"fontSize": "12px",
"lineHeight": "1.5",
"whiteSpace": "pre-wrap"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "cardText"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card",
"overflowY": "auto"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.closePopup('PC_ShiftReport')"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnClose"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Close"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "footerRow"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"justify": "flex-end"
},
"type": "ia.container.flex"
}
],
"custom": {},
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/PageBg",
"gap": "12px",
"padding": "16px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -0,0 +1,10 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"view.json"
],
"attributes": {}
}

View File

@@ -0,0 +1,269 @@
{
"custom": {},
"params": {
"bundle": null
},
"propConfig": {
"params.bundle": {
"paramDirection": "input",
"persistent": false
}
},
"props": {
"defaultSize": {
"height": 56,
"width": 1600
}
},
"root": {
"children": [
{
"meta": {
"name": "ddPriority"
},
"position": {
"basis": "170px",
"shrink": 0
},
"propConfig": {
"props.options": {
"binding": {
"config": {
"path": "view.params.bundle.meta.priorities_seen"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn [{'value': p['value'], 'label': p['label']} for p in (value or [])]\n\texcept:\n\t\treturn []",
"type": "script"
}
],
"type": "property"
}
},
"props.value": {
"binding": {
"bidirectional": true,
"config": {
"path": "session.custom.PrimeControls.query.priorities"
},
"type": "property"
}
}
},
"props": {
"multiSelect": true,
"placeholder": {
"text": "Priority"
}
},
"type": "ia.input.dropdown"
},
{
"meta": {
"name": "ddArea"
},
"position": {
"basis": "170px",
"shrink": 0
},
"propConfig": {
"props.options": {
"binding": {
"config": {
"path": "view.params.bundle.meta.areas"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn [{'value': a, 'label': a} for a in (value or [])]\n\texcept:\n\t\treturn []",
"type": "script"
}
],
"type": "property"
}
},
"props.value": {
"binding": {
"bidirectional": true,
"config": {
"path": "session.custom.PrimeControls.query.areas"
},
"type": "property"
}
}
},
"props": {
"multiSelect": true,
"placeholder": {
"text": "Area"
}
},
"type": "ia.input.dropdown"
},
{
"meta": {
"name": "ddState"
},
"position": {
"basis": "170px",
"shrink": 0
},
"propConfig": {
"props.value": {
"binding": {
"bidirectional": true,
"config": {
"path": "session.custom.PrimeControls.query.states"
},
"type": "property"
}
}
},
"props": {
"multiSelect": true,
"options": [
{
"label": "Active",
"value": "active"
},
{
"label": "Cleared",
"value": "cleared"
},
{
"label": "Acked",
"value": "acked"
},
{
"label": "Unacked",
"value": "unacked"
}
],
"placeholder": {
"text": "State"
}
},
"type": "ia.input.dropdown"
},
{
"meta": {
"name": "txtSearch"
},
"position": {
"basis": "240px",
"shrink": 1
},
"propConfig": {
"props.text": {
"binding": {
"bidirectional": true,
"config": {
"path": "session.custom.PrimeControls.query.search"
},
"type": "property"
}
}
},
"props": {
"deferUpdates": true,
"placeholder": "Search source/label..."
},
"type": "ia.input.text-field"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tq = self.session.custom.PrimeControls.query\n\tq.refreshToken = q.refreshToken + 1"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnApply"
},
"position": {
"basis": "80px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Apply"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tq = self.session.custom.PrimeControls.query\n\tq.priorities = []\n\tq.areas = []\n\tq.states = []\n\tq.search = ''\n\tq.refreshToken = q.refreshToken + 1"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnClear"
},
"position": {
"basis": "80px",
"shrink": 0
},
"props": {
"primary": false,
"text": "Clear"
},
"type": "ia.input.button"
},
{
"meta": {
"name": "lblEventCount"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\tn = value['meta']['event_count']\n\texcept:\n\t\tn = None\n\tif n is None:\n\t\treturn ''\n\treturn '%s events in range' % PrimeControls.fmt.num(n)",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"textStyle": {
"textAlign": "right"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"alignItems": "center",
"direction": "row",
"style": {
"classes": "PrimeControls/Toolbar",
"gap": "8px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -0,0 +1,10 @@
{
"scope": "G",
"version": 1,
"restricted": false,
"overridable": true,
"files": [
"view.json"
],
"attributes": {}
}

View File

@@ -0,0 +1,674 @@
{
"custom": {},
"params": {
"bundle": null
},
"propConfig": {
"params.bundle": {
"paramDirection": "input",
"persistent": false
}
},
"props": {
"defaultSize": {
"height": 150,
"width": 1600
}
},
"root": {
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "lblTitle"
},
"props": {
"style": {
"classes": "PrimeControls/Text/Big"
},
"text": "Alarm Analysis"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "lblSubtitle"
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"text": "Prime Controls Build-a-Thon"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "titles"
},
"position": {
"shrink": 0
},
"props": {
"direction": "column",
"justify": "center"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "chipTruncated"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn bool(value['meta']['truncated'])\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted",
"color": "#E8883A"
},
"text": "data truncated \u2014 narrow the range"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "chipError"
},
"position": {
"shrink": 0
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn bool(value['meta']['error'])\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['meta']['error'] or ''\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted",
"color": "#D64550"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "chips"
},
"position": {
"grow": 1
},
"props": {
"alignItems": "center",
"justify": "flex-end",
"style": {
"gap": "8px",
"paddingRight": "12px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tspans = {'4h': 4, '8h': 8, '24h': 24, '7d': 168}\n\tpreset = event.value\n\tif preset in spans:\n\t\tq = self.session.custom.PrimeControls.query\n\t\tnow = system.date.toMillis(system.date.now())\n\t\tq.endMs = now\n\t\tq.startMs = now - spans[preset] * 3600 * 1000\n\t\tq.refreshToken = q.refreshToken + 1"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "ddRange"
},
"position": {
"basis": "150px",
"shrink": 0
},
"propConfig": {
"props.value": {
"binding": {
"bidirectional": true,
"config": {
"path": "session.custom.PrimeControls.query.rangePreset"
},
"type": "property"
}
}
},
"props": {
"options": [
{
"label": "Last 4 hours",
"value": "4h"
},
{
"label": "Last 8 hours",
"value": "8h"
},
{
"label": "Last 24 hours",
"value": "24h"
},
{
"label": "Last 7 days",
"value": "7d"
}
],
"placeholder": {
"text": "Range"
}
},
"type": "ia.input.dropdown"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tq = self.session.custom.PrimeControls.query\n\tspans = {'4h': 4, '8h': 8, '24h': 24, '7d': 168}\n\tnow = system.date.toMillis(system.date.now())\n\thours = spans.get(q.rangePreset)\n\tif hours is not None:\n\t\tspan = hours * 3600 * 1000\n\telse:\n\t\tspan = q.endMs - q.startMs\n\tif span > 0:\n\t\tq.endMs = now\n\t\tq.startMs = now - span\n\tq.refreshToken = q.refreshToken + 1"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnRefresh"
},
"position": {
"basis": "90px",
"shrink": 0
},
"props": {
"primary": false,
"text": "Refresh"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.openPopup('PC_ShiftReport', 'PrimeControls/Popups/ShiftReport', params = {}, showCloseIcon = True, draggable = True)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnShiftReport"
},
"position": {
"basis": "120px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Shift Report"
},
"type": "ia.input.button"
}
],
"meta": {
"name": "controls"
},
"position": {
"shrink": 0
},
"props": {
"alignItems": "center",
"style": {
"gap": "8px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "rowTop"
},
"position": {
"basis": "52px",
"grow": 0,
"shrink": 0
},
"props": {
"alignItems": "center",
"justify": "space-between",
"style": {
"gap": "12px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "gauge"
},
"position": {
"basis": "230px",
"shrink": 0
},
"propConfig": {
"props.params.health": {
"binding": {
"config": {
"path": "view.params.bundle.health"
},
"type": "property"
}
}
},
"props": {
"params": {},
"path": "PrimeControls/Components/HealthGauge"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiActivations"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['activations']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['kpis']['activations']['value'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Activations"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiRate"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['rate_per_hr']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['kpis']['rate_per_hr']['value'], 1)\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Rate",
"unit": "/hr"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiActiveNow"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['active_now']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['kpis']['active_now']['value'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Active Now"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiUnacked"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['unacked_now']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['kpis']['unacked_now']['value'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Unacked"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiMtta"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['mtta_ms']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.dur(value['kpis']['mtta_ms']['value'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "MTTA"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiFlood"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['flood_pct']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.pct(value['kpis']['flood_pct']['value'], 1)\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Flood Time"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "kpiChatter"
},
"position": {
"basis": "100px",
"grow": 1
},
"propConfig": {
"props.params.delta": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['kpis']['chatter_count']\n\texcept:\n\t\treturn None",
"type": "script"
}
],
"type": "property"
}
},
"props.params.value": {
"binding": {
"config": {
"path": "view.params.bundle"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn PrimeControls.fmt.num(value['kpis']['chatter_count']['value'])\n\texcept:\n\t\treturn '--'",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"label": "Chattering"
},
"path": "PrimeControls/Components/KpiCard"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "rowKpis"
},
"position": {
"grow": 1
},
"props": {
"alignItems": "stretch",
"style": {
"gap": "10px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Toolbar",
"gap": "8px"
}
},
"type": "ia.container.flex"
}
}

View File

@@ -1,55 +1,463 @@
{ {
"custom": {}, "custom": {
"page": 0,
"pageData": null
},
"params": { "params": {
"bundle": null "bundle": null
}, },
"propConfig": { "propConfig": {
"custom.pageData": {
"binding": {
"config": {
"expression": "{session.custom.PrimeControls.query.refreshToken} + '|' + {session.custom.PrimeControls.query.startMs} + '|' + {session.custom.PrimeControls.query.endMs} + '|' + {view.custom.page}"
},
"transforms": [
{
"code": "\tsafe = {'rows': [], 'total': 0, 'page': 0, 'page_size': 50, 'truncated': False, 'error': None}\n\ttry:\n\t\tq = self.session.custom.PrimeControls.query\n\t\tif not q.startMs or not q.endMs:\n\t\t\treturn safe\n\t\ttry:\n\t\t\tpage = max(0, int(self.view.custom.page or 0))\n\t\texcept:\n\t\t\tpage = 0\n\t\treturn PrimeControls.alarms.getJournalPage(q.startMs, q.endMs, {'priorities': list(q.priorities), 'areas': list(q.areas), 'states': list(q.states), 'search': q.search}, page, 50)\n\texcept:\n\t\timport sys\n\t\tsafe['error'] = '%s' % (sys.exc_info()[1],)\n\t\treturn safe",
"type": "script"
}
],
"type": "expr"
}
},
"params.bundle": { "params.bundle": {
"paramDirection": "input", "paramDirection": "input",
"persistent": true "persistent": false
}
},
"props": {
"defaultSize": {
"height": 800,
"width": 1600
} }
}, },
"props": {},
"root": { "root": {
"children": [ "children": [
{ {
"meta": { "children": [
"name": "ph" {
}, "meta": {
"props": { "name": "lblTotal"
"style": { },
"classes": "PrimeControls/Empty" "position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\ttotal = int(value['total'] or 0)\n\texcept:\n\t\ttotal = 0\n\ttry:\n\t\ttxt = '%s events' % PrimeControls.fmt.num(total)\n\texcept:\n\t\ttxt = '%d events' % total\n\ttry:\n\t\tif value['truncated']:\n\t\t\ttxt = txt + ' (truncated)'\n\texcept:\n\t\tpass\n\treturn txt",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"textStyle": {
"fontWeight": "bold"
}
},
"type": "ia.display.label"
}, },
"text": "Journal - built in Phase 2" {
}, "meta": {
"type": "ia.display.label" "name": "lblError"
}, },
{ "position": {
"meta": { "shrink": 1
"name": "evt" },
}, "propConfig": {
"propConfig": { "position.display": {
"props.text": { "binding": {
"binding": { "config": {
"config": { "path": "view.custom.pageData"
"path": "view.params.bundle" },
"transforms": [
{
"code": "\ttry:\n\t\treturn bool(value['error'])\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
}, },
"transforms": [ "props.text": {
{ "binding": {
"code": "\ttry:\n\t\treturn 'bundle: %s events in range' % value['meta']['event_count']\n\texcept:\n\t\treturn 'bundle: not loaded'", "config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn value['error'] or ''\n\texcept:\n\t\treturn ''",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted",
"color": "#D64550"
}
},
"type": "ia.display.label"
},
{
"children": [],
"meta": {
"name": "spacer"
},
"position": {
"grow": 1
},
"props": {},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttry:\n\t\tp = int(self.view.custom.page or 0)\n\texcept:\n\t\tp = 0\n\tif p > 0:\n\t\tself.view.custom.page = p - 1"
},
"scope": "G",
"type": "script" "type": "script"
} }
], }
"type": "property" },
} "meta": {
"name": "btnPrev"
},
"position": {
"basis": "80px",
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn int(value['page'] or 0) > 0\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"primary": false,
"text": "Prev"
},
"type": "ia.input.button"
},
{
"meta": {
"name": "lblPage"
},
"position": {
"shrink": 0
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\ttotal = int(value['total'] or 0)\n\t\tsize = int(value['page_size'] or 50)\n\t\tpage = int(value['page'] or 0)\n\texcept:\n\t\ttotal = 0\n\t\tsize = 50\n\t\tpage = 0\n\tif size < 1:\n\t\tsize = 50\n\tpages = (total + size - 1) // size\n\tif pages < 1:\n\t\tpages = 1\n\ttry:\n\t\treturn 'Page %s of %s' % (PrimeControls.fmt.num(page + 1), PrimeControls.fmt.num(pages))\n\texcept:\n\t\treturn 'Page %d of %d' % (page + 1, pages)",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"classes": "PrimeControls/Text/Muted"
},
"textStyle": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttry:\n\t\tp = int(self.view.custom.page or 0)\n\texcept:\n\t\tp = 0\n\ttry:\n\t\td = self.view.custom.pageData\n\t\ttotal = int(d['total'] or 0)\n\t\tsize = int(d['page_size'] or 50)\n\texcept:\n\t\ttotal = 0\n\t\tsize = 50\n\tif size < 1:\n\t\tsize = 50\n\tpages = (total + size - 1) // size\n\tif pages < 1:\n\t\tpages = 1\n\tif p < pages - 1:\n\t\tself.view.custom.page = p + 1"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnNext"
},
"position": {
"basis": "80px",
"shrink": 0
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\ttotal = int(value['total'] or 0)\n\t\tsize = int(value['page_size'] or 50)\n\t\tpage = int(value['page'] or 0)\n\texcept:\n\t\treturn False\n\tif size < 1:\n\t\tsize = 50\n\treturn (page + 1) * size < total",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"primary": false,
"text": "Next"
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttry:\n\t\tq = self.session.custom.PrimeControls.query\n\t\tcsv = PrimeControls.alarms.journalCsv(q.startMs, q.endMs, {'priorities': list(q.priorities), 'areas': list(q.areas), 'states': list(q.states), 'search': q.search})\n\t\tsystem.perspective.download('alarm_journal.csv', csv)\n\texcept:\n\t\tpass"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "btnExport"
},
"position": {
"basis": "110px",
"shrink": 0
},
"props": {
"primary": true,
"text": "Export CSV"
},
"type": "ia.input.button"
} }
],
"meta": {
"name": "toolbar"
},
"position": {
"shrink": 0
}, },
"props": { "props": {
"alignItems": "center",
"style": { "style": {
"classes": "PrimeControls/Text/Muted" "classes": "PrimeControls/Toolbar",
"gap": "8px"
} }
}, },
"type": "ia.display.label" "type": "ia.container.flex"
},
{
"children": [
{
"events": {
"component": {
"onRowClick": {
"config": {
"script": "\trow = event.value\n\tevt = {}\n\ttry:\n\t\tfor k in row:\n\t\t\tv = row[k]\n\t\t\ttry:\n\t\t\t\tevt[k] = v['value']\n\t\t\texcept:\n\t\t\t\tevt[k] = v\n\texcept:\n\t\tevt = {}\n\ttry:\n\t\tif evt:\n\t\t\tsystem.perspective.openPopup('PC_EventDetail', 'PrimeControls/Popups/EventDetail', params = {'event': evt}, showCloseIcon = True, draggable = True)\n\texcept:\n\t\tpass"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "tblJournal"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['rows'] or []) > 0\n\texcept:\n\t\treturn False",
"type": "script"
}
],
"type": "property"
}
},
"props.data": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\tstate_cls = {'active': 'PrimeControls/State/Active', 'ack': 'PrimeControls/State/Acked', 'clear': 'PrimeControls/State/Cleared'}\n\tprio_cls = {'Diagnostic': 'PrimeControls/PrioritySoft/Diagnostic', 'Low': 'PrimeControls/PrioritySoft/Low', 'Medium': 'PrimeControls/PrioritySoft/Medium', 'High': 'PrimeControls/PrioritySoft/High', 'Critical': 'PrimeControls/PrioritySoft/Critical'}\n\ttry:\n\t\trows = value['rows'] or []\n\texcept:\n\t\trows = []\n\tout = []\n\tfor r in rows:\n\t\ttry:\n\t\t\tsc = state_cls.get(r['state'], '')\n\t\t\tpc = prio_cls.get(r['priority_name'], '')\n\t\t\tout.append({'time_label': r['time_label'] or '', 'state_label': {'value': r['state_label'] or '', 'style': {'classes': sc}}, 'priority_name': {'value': r['priority_name'] or '', 'style': {'classes': pc}}, 'label': r['label'] or '', 'area': r['area'] or '', 'ack_user': r['ack_user'] or '', 'id': r['id'] or '', 'time_ms': r['time_ms'] or 0, 'source': r['source'] or '', 'state': r['state'] or '', 'priority': r['priority']})\n\t\texcept:\n\t\t\tpass\n\treturn out",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"columns": [
{
"field": "time_label",
"header": {
"title": "Time"
},
"sortable": false,
"strictWidth": true,
"width": 150
},
{
"field": "state_label",
"header": {
"title": "State"
},
"justify": "center",
"sortable": false,
"strictWidth": true,
"width": 110
},
{
"field": "priority_name",
"header": {
"title": "Priority"
},
"justify": "center",
"sortable": false,
"strictWidth": true,
"width": 110
},
{
"field": "label",
"header": {
"title": "Alarm"
},
"sortable": false
},
{
"field": "area",
"header": {
"title": "Area"
},
"sortable": false,
"strictWidth": true,
"width": 160
},
{
"field": "ack_user",
"header": {
"title": "Ack By"
},
"sortable": false,
"strictWidth": true,
"width": 120
},
{
"field": "id",
"visible": false
},
{
"field": "time_ms",
"visible": false
},
{
"field": "source",
"visible": false
},
{
"field": "state",
"visible": false
},
{
"field": "priority",
"visible": false
}
],
"pager": {
"bottom": false,
"top": false
}
},
"type": "ia.display.table"
},
{
"meta": {
"name": "empty"
},
"position": {
"grow": 1
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"path": "view.custom.pageData"
},
"transforms": [
{
"code": "\ttry:\n\t\treturn len(value['rows'] or []) == 0\n\texcept:\n\t\treturn True",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"params": {
"icon": "search",
"message": "No events match the current filters"
},
"path": "PrimeControls/Components/EmptyState"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "cardTable"
},
"position": {
"grow": 1
},
"props": {
"direction": "column",
"style": {
"classes": "PrimeControls/Card"
}
},
"type": "ia.container.flex"
} }
], ],
"meta": { "meta": {
@@ -58,11 +466,9 @@
"props": { "props": {
"direction": "column", "direction": "column",
"style": { "style": {
"alignItems": "center", "gap": "12px"
"classes": "PrimeControls/Card",
"justifyContent": "center"
} }
}, },
"type": "ia.container.flex" "type": "ia.container.flex"
} }
} }