Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions openhtf/output/web_gui/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<head><link href="/css/app.5800c558eb6fed0e89c5.css" rel="stylesheet"></head><!doctype html>
<head><link href="/css/app.f3e7df6d1c0fcf19f10e.css" rel="stylesheet"></head><!doctype html>
<!--
Copyright 2022 Google LLC

Expand All @@ -22,4 +22,4 @@

<base href="/">
<htf-app config="{{ json_encode(config) }}">Loading...</htf-app>
<script type="text/javascript" src="/js/polyfills.5800c558eb6fed0e89c5.js"></script><script type="text/javascript" src="/js/vendor.5800c558eb6fed0e89c5.js"></script><script type="text/javascript" src="/js/app.5800c558eb6fed0e89c5.js"></script>
<script type="text/javascript" src="/js/polyfills.f3e7df6d1c0fcf19f10e.js"></script><script type="text/javascript" src="/js/vendor.f3e7df6d1c0fcf19f10e.js"></script><script type="text/javascript" src="/js/app.f3e7df6d1c0fcf19f10e.js"></script>

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions openhtf/output/web_gui/src/app/shared/models/station.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export class Station {
host: string;
hostPort: string; // Used to uniquely identify stations.
label: string;
lockoutLastUpdatedAt: string|null;
lockoutLastUpdatedBy: string|null;
lockoutLocked: boolean|null;
lockoutReason: string|null;
port: string;
stationId: string;
status: StationStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ interface RawStation {
ddns_hostname?: string|null;
ddns_resolved_ip?: string|null;
ddns_status?: string|null;
// The lockout fields are only emitted by the single-station dashboard
// server on Halter stations; absent elsewhere, in which case the UI shows
// no lockout banner.
lockout_locked?: boolean|null;
lockout_reason?: string|null;
lockout_last_updated_by?: string|null;
lockout_last_updated_at?: string|null;
}

interface DashboardApiResponse {
Expand Down Expand Up @@ -113,6 +120,18 @@ export class DashboardService extends Subscription {
host: rawStation.host,
hostPort,
label: DashboardService.getStationLabel(rawStation),
lockoutLastUpdatedAt: rawStation.lockout_last_updated_at != null ?
rawStation.lockout_last_updated_at :
null,
lockoutLastUpdatedBy: rawStation.lockout_last_updated_by != null ?
rawStation.lockout_last_updated_by :
null,
lockoutLocked: typeof rawStation.lockout_locked === 'boolean' ?
rawStation.lockout_locked :
null,
lockoutReason: rawStation.lockout_reason != null ?
rawStation.lockout_reason :
null,
port: rawStation.port,
stationId: rawStation.station_id,
status: dashboardStatusMap[rawStation.status],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@

<div class="station">

<div
*ngIf="selectedStation.lockoutLocked"
class="lockout-banner">
<div class="lockout-banner-title">
&#x26A0; STATION LOCKED OUT: testing restricted to control units
</div>
<div
*ngIf="selectedStation.lockoutReason"
class="lockout-banner-reason">
{{ selectedStation.lockoutReason }}
</div>
<div
*ngIf="lockoutUpdatedText"
class="lockout-banner-meta">
{{ lockoutUpdatedText }}
</div>
</div>

<div class="nav-bar">
<button
*ngIf="dashboardEnabled"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@
margin-bottom: 12px;
}

.lockout-banner {
background-color: $theme-red;
border-radius: 3px;
color: $text-white;
margin-bottom: $gutter-small;
padding: 12px $widget-inner-padding;
}

.lockout-banner-title {
font-size: $font-size-large;
font-weight: bold;
}

.lockout-banner-reason {
margin-top: 4px;
}

.lockout-banner-meta {
font-size: $font-size-small;
margin-top: 4px;
opacity: .85;
}

.status-bar {
margin-bottom: ($gutter-small - 2px);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ class HostComponent {
host: 'localhost',
hostPort: 'localhost:12000',
label: 'mock-station-id',
lockoutLastUpdatedAt: null,
lockoutLastUpdatedBy: null,
lockoutLocked: null,
lockoutReason: null,
port: '12000',
stationId: 'mock-station-id',
status: StationStatus.online,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,27 @@ export class StationComponent implements OnDestroy, OnInit {
return !(this.hasError || this.isLoading);
}

// Attribution line for the lockout banner; empty when there is nothing
// beyond the locked flag to show.
get lockoutUpdatedText(): string {
const station = this.selectedStation;
if (!station || !station.lockoutLocked) {
return '';
}
const by = station.lockoutLastUpdatedBy;
const at = station.lockoutLastUpdatedAt;
if (by && at) {
return `Locked by ${by} at ${at}`;
}
if (by) {
return `Locked by ${by}`;
}
if (at) {
return `Locked at ${at}`;
}
return '';
}

// Human-readable explanation of the DDNS indicator, shown on hover.
get ddnsTooltip(): string {
const station = this.selectedStation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const mockStation = new Station({
host: 'localhost',
hostPort: 'localhost:12000',
label: 'mock-station-id',
lockoutLastUpdatedAt: null,
lockoutLastUpdatedBy: null,
lockoutLocked: null,
lockoutReason: null,
port: '12000',
stationId: 'mock-station-id',
status: StationStatus.online,
Expand All @@ -55,6 +59,10 @@ const mockStation2 = new Station({
host: 'localhost',
hostPort: 'localhost:12001',
label: 'mock-station-id',
lockoutLastUpdatedAt: null,
lockoutLastUpdatedBy: null,
lockoutLocked: null,
lockoutReason: null,
port: '12001',
stationId: 'mock-station-id',
status: StationStatus.online,
Expand Down
Loading