Skip to content

Commit

Permalink
[#1150] fix alternate table row colors
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-pavel committed Feb 2, 2024
1 parent 4282de9 commit 24c6ce9
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
3 changes: 2 additions & 1 deletion webui/src/app/apps-page/apps-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
currentPageReportTemplate="{currentPage} of {totalPages} pages"
stateStorage="session"
stateKey="apps-table-session"
styleClass="alternate-list"
>
<ng-template pTemplate="header">
<tr>
Expand All @@ -88,7 +89,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-a>
<tr class="alternate-list">
<tr>
<td>
<a routerLink="/apps/{{ appType }}/{{ a.id }}">{{ a.name }}</a>
</td>
Expand Down
4 changes: 2 additions & 2 deletions webui/src/app/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ <h2 class="section-heading dashboard-section__header">Statistics</h2>

<h1 class="section-heading">Services Status</h1>
<div style="display: flex; flex-wrap: wrap; justify-content: space-between">
<table style="width: 100%" class="dhcp-services-table">
<table style="width: 100%" class="alternate-list dhcp-services-table">
<tr>
<th style="vertical-align: top">Host</th>
<th style="vertical-align: top">App Version</th>
Expand All @@ -297,7 +297,7 @@ <h1 class="section-heading">Services Status</h1>
<th style="vertical-align: top">Uptime</th>
</tr>

<tr *ngFor="let d of overview.dhcpDaemons" class="alternate-list">
<tr *ngFor="let d of overview.dhcpDaemons">
<td>
<a routerLink="/machines/{{ d.machineId }}">{{ d.machine }}</a>
</td>
Expand Down
3 changes: 0 additions & 3 deletions webui/src/app/dashboard/dashboard.component.sass
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
.dhcp-services-table td
padding: 5px

.dhcp-services-table tr:nth-child(2n)
background-color: #f4f4f4

h1.section-heading
font-size: 1.4em
border-bottom: 3px solid #e1e1e1
Expand Down
3 changes: 2 additions & 1 deletion webui/src/app/hosts-page/hosts-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
stateStorage="session"
stateKey="hosts-table-session"
currentPageReportTemplate="{currentPage} of {totalPages} pages"
styleClass="alternate-list"
>
<ng-template pTemplate="header">
<tr>
Expand All @@ -159,7 +160,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-h>
<tr id="host-row-{{ h.id }}" class="alternate-list">
<tr id="host-row-{{ h.id }}">
<td>
<app-identifier
*ngFor="let i of h.hostIdentifiers"
Expand Down
5 changes: 3 additions & 2 deletions webui/src/app/machines-page/machines-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
stateStorage="session"
stateKey="machines-table-session"
currentPageReportTemplate="{currentPage} of {totalPages} pages"
styleClass="alternate-list"
>
<ng-template pTemplate="emptymessage" let-columns>
<tr>
Expand Down Expand Up @@ -380,7 +381,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-m>
<tr class="alternate-list" *ngIf="!showUnauthorized">
<tr *ngIf="!showUnauthorized">
<td>
<a routerLink="/machines/{{ m.id }}">{{ m.hostname || m.address }}</a>
</td>
Expand Down Expand Up @@ -410,7 +411,7 @@
></button>
</td>
</tr>
<tr class="alternate-list" *ngIf="showUnauthorized">
<tr *ngIf="showUnauthorized">
<td>
<p-tableCheckbox [value]="m"></p-tableCheckbox>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
currentPageReportTemplate="{currentPage} of {totalPages} pages"
stateStorage="session"
stateKey="networks-table-session"
styleClass="alternate-list"
>
<ng-template pTemplate="header">
<tr>
Expand All @@ -105,7 +106,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-net>
<tr class="alternate-list">
<tr>
<td>
<app-entity-link
entity="shared-network"
Expand Down
3 changes: 2 additions & 1 deletion webui/src/app/subnets-page/subnets-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
currentPageReportTemplate="{currentPage} of {totalPages} pages"
stateStorage="session"
stateKey="subnets-table-session"
styleClass="alternate-list"
>
<ng-template pTemplate="header">
<tr>
Expand Down Expand Up @@ -143,7 +144,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-sn>
<tr class="alternate-list">
<tr>
<td>
<app-subnet-bar [subnet]="sn"></app-subnet-bar>
</td>
Expand Down
5 changes: 3 additions & 2 deletions webui/src/app/users-page/users-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
currentPageReportTemplate="{currentPage} of {totalPages} pages"
stateStorage="session"
stateKey="users-table-session"
styleClass="alternate-list"
>
<ng-template pTemplate="header">
<tr>
Expand All @@ -86,7 +87,7 @@
</tr>
</ng-template>
<ng-template pTemplate="body" let-u>
<tr class="alternate-list">
<tr>
<td align="center">
<a routerLink="/users/{{ u.id }}">{{ u.login | placeholder }}</a>
<sup *ngIf="auth.currentUserValue.id === u.id"><span id="youtag">It's you</span></sup>
Expand Down Expand Up @@ -222,7 +223,7 @@
severity="info"
text="The external authorization service '{{
userTab.user.authenticationMethodId
}}' manages this user
}}' manages this user
profile. It can be only modified via the administrator panel of the authentication service."
>
</p-message>
Expand Down
5 changes: 3 additions & 2 deletions webui/src/styles.sass
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ p-header
margin-left: 20px
color: #848484

// Utility class for highlighting every even list item or table row.
.alternate-list:nth-child(2n), .alternate-list tr:nth-child(2n)
// Utility class for highlighting every even-numbered table row.
// The first rule is for plain tables. The second rule is for p-tables.
.alternate-list > tr:nth-child(2n), .alternate-list tbody > tr:nth-child(2n)
background-color: #f4f4f4

// Allows breaking long lines of text on small
Expand Down

0 comments on commit 24c6ce9

Please sign in to comment.