-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor status and child bridge widgets
- Loading branch information
Showing
50 changed files
with
515 additions
and
541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
ui/src/app/modules/status/widgets/bridges-widget/bridges-widget.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<div class="flex-column d-flex align-items-stretch h-100 w-100 pb-3 overflow-auto no-scrollbars"> | ||
<div class="drag-handler p-2" [ngClass]="{ 'widget-cursor': widget.draggable }"> | ||
{{ 'child_bridge.bridges' | translate }} | ||
</div> | ||
<div | ||
class="d-flex flex-wrap w-100 mt-0 justify-content-start gridster-item-content overflow-auto no-scrollbars align-items-center" | ||
> | ||
<div class="hb-status-item d-flex flex-row w-100 px-3 mt-2 mb-1" style="min-width: max(25%, 225px)"> | ||
<div class="hb-status-icon d-flex align-items-center"> | ||
<i | ||
class="fas fa-fw" | ||
[ngClass]="{ | ||
'fa-bridge-circle-check green-text': homebridgeStatus.status === 'up', | ||
'fa-bridge-circle-exclamation text-warning': homebridgeStatus.status === 'pending', | ||
'fa-bridge-circle-xmark red-text': homebridgeStatus.status === 'down' | ||
}" | ||
container="body" | ||
placement="right" | ||
openDelay="150" | ||
triggers="hover" | ||
[ngbTooltip]="(homebridgeStatus.status === 'up' ? 'status.services.label_running' : (homebridgeStatus.status === | ||
'pending' ? 'status.services.label_running' : 'status.services.label_not_running')) | translate" | ||
[attr.aria-label]="(homebridgeStatus.status === 'up' ? 'status.services.label_running' : (homebridgeStatus.status === | ||
'pending' ? 'status.services.label_running' : 'status.services.label_not_running')) | translate" | ||
></i> | ||
</div> | ||
<div class="align-self-center flex-child px-3">{{ homebridgeStatus.name || 'Homebridge' }}</div> | ||
<div class="grey-text ml-auto d-flex align-items-center"> | ||
@if (homebridgeStatus.status === 'up') { | ||
<i | ||
class="icon-button fas fa-fw fa-power-off" | ||
href="javascript:void(0)" | ||
(click)="restartHomebridge()" | ||
[ngbTooltip]="'menu.tooltip_restart' | translate" | ||
container="body" | ||
openDelay="150" | ||
triggers="hover" | ||
placement="left" | ||
></i> | ||
} @if (homebridgeStatus.status !== 'up') { | ||
<i class="fas icon-button fa-fw fa-spinner fa-pulse"></i> | ||
} | ||
<i | ||
class="fas fa-fw ml-2 fa-link" | ||
[ngbTooltip]="(homebridgeStatus.paired ? 'status.widget.qr_paired' : 'status.widget.qr_unpaired') | translate" | ||
container="body" | ||
openDelay="150" | ||
triggers="hover" | ||
placement="left" | ||
[ngClass]="{ | ||
'green-text': homebridgeStatus.paired, | ||
'grey-text': !homebridgeStatus.paired | ||
}" | ||
></i> | ||
</div> | ||
</div> | ||
@for (bridge of childBridges; track bridge) { | ||
<div class="hb-status-item d-flex flex-row w-100 px-3 mt-2 mb-1" style="min-width: max(25%, 225px)"> | ||
<div class="hb-status-icon d-flex align-items-center"> | ||
<i | ||
class="fas fa-fw" | ||
[ngClass]="{ | ||
'fa-bridge-circle-check green-text': bridge.status === 'ok', | ||
'fa-bridge-circle-exclamation text-warning': bridge.status === 'pending', | ||
'fa-bridge-circle-xmark red-text': bridge.status === 'down' | ||
}" | ||
container="body" | ||
placement="right" | ||
openDelay="150" | ||
triggers="hover" | ||
[ngbTooltip]="(bridge.status === 'ok' ? 'status.services.label_running' : (bridge.status === | ||
'pending' ? 'status.services.label_running' : 'status.services.label_not_running')) | translate" | ||
[attr.aria-label]="(bridge.status === 'ok' ? 'status.services.label_running' : (bridge.status === | ||
'pending' ? 'status.services.label_running' : 'status.services.label_not_running')) | translate" | ||
></i> | ||
</div> | ||
<div class="align-self-center flex-child px-3">{{ bridge.name }}</div> | ||
<div class="grey-text ml-auto d-flex align-items-center"> | ||
@if (bridge.status === 'ok') { | ||
<i | ||
class="icon-button fas fa-fw fa-power-off" | ||
href="javascript:void(0)" | ||
(click)="restartChildBridge(bridge)" | ||
[ngbTooltip]="'menu.tooltip_restart' | translate" | ||
container="body" | ||
openDelay="150" | ||
triggers="hover" | ||
placement="left" | ||
></i> | ||
} @if (bridge.status !== 'ok') { | ||
<i class="fas icon-button fa-fw fa-spinner fa-pulse"></i> | ||
} | ||
<i | ||
class="fas fa-fw ml-2 fa-link" | ||
[ngbTooltip]="(bridge.paired ? 'status.widget.qr_paired' : 'status.widget.qr_unpaired') | translate" | ||
container="body" | ||
openDelay="150" | ||
triggers="hover" | ||
placement="left" | ||
[ngClass]="{ | ||
'green-text': bridge.paired, | ||
'grey-text': !bridge.paired | ||
}" | ||
></i> | ||
</div> | ||
</div> | ||
} | ||
</div> | ||
</div> |
Oops, something went wrong.