From 22d0a4bac3b416b6906ab3acad5e1ae9068e8630 Mon Sep 17 00:00:00 2001 From: Senyoret1 <34079003+Senyoret1@users.noreply.github.com> Date: Thu, 9 Apr 2020 18:58:58 -0400 Subject: [PATCH] Improvements for the manager --- .../src/app/app.datatypes.ts | 2 ++ .../pages/node-list/node-list.component.html | 5 ++- .../pages/node-list/node-list.component.ts | 8 +++++ .../node-apps-list.component.html | 22 ++++++------ .../node-apps-list.component.ts | 8 ++--- .../skysocks-client-settings.component.ts | 21 ++++++++--- .../skysocks-settings.component.ts | 9 ++--- .../startup-config.component.ts | 1 - .../transport-details.component.html | 6 ++++ .../transport-list.component.html | 15 ++++++-- .../transport-list.component.ts | 36 +++++++++++++++++++ .../src/app/services/auth.service.ts | 15 ++++---- .../src/app/services/node.service.ts | 10 +++++- .../src/assets/i18n/en.json | 13 ++++++- .../src/assets/i18n/es.json | 13 ++++++- .../src/assets/i18n/es_base.json | 13 ++++++- .../src/assets/scss/_icons.scss | 25 ++++++++++++- .../src/assets/scss/_responsive_tables.scss | 4 +++ 18 files changed, 186 insertions(+), 40 deletions(-) diff --git a/static/skywire-manager-src/src/app/app.datatypes.ts b/static/skywire-manager-src/src/app/app.datatypes.ts index d782d62ef..a65271220 100644 --- a/static/skywire-manager-src/src/app/app.datatypes.ts +++ b/static/skywire-manager-src/src/app/app.datatypes.ts @@ -23,6 +23,7 @@ export interface Application { autostart: boolean; port: number; status: number; + args?: any[]; } export interface Transport { @@ -31,6 +32,7 @@ export interface Transport { remote_pk: string; type: string; log?: TransportLog; + is_up: boolean; } export interface TransportLog { diff --git a/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.html b/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.html index b5ea44c7b..0daae8ee4 100644 --- a/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.html +++ b/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.html @@ -35,7 +35,10 @@ > - + + + {{ sortingArrow }} + {{ 'nodes.label' | translate }} {{ sortingArrow }} diff --git a/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.ts b/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.ts index dcdbf67b4..8c2c18ab2 100644 --- a/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.ts +++ b/static/skywire-manager-src/src/app/components/pages/node-list/node-list.component.ts @@ -21,6 +21,7 @@ import { processServiceError } from 'src/app/utils/errors'; * List of the columns that can be used to sort the data. */ enum SortableColumns { + State = 'transports.state', Label = 'nodes.label', Key = 'nodes.key', } @@ -275,6 +276,13 @@ export class NodeListComponent implements OnInit, OnDestroy { let response: number; if (this.sortBy === SortableColumns.Key) { response = !this.sortReverse ? a.local_pk.localeCompare(b.local_pk) : b.local_pk.localeCompare(a.local_pk); + } else if (this.sortBy === SortableColumns.State) { + if (a.online && !b.online) { + response = -1; + } else if (!a.online && b.online) { + response = 1; + } + response = response * (this.sortReverse ? -1 : 1); } else if (this.sortBy === SortableColumns.Label) { response = !this.sortReverse ? a.label.localeCompare(b.label) : b.label.localeCompare(a.label); } else { diff --git a/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/node-apps-list/node-apps-list.component.html b/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/node-apps-list/node-apps-list.component.html index 3950e0b23..898701b7f 100644 --- a/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/node-apps-list/node-apps-list.component.html +++ b/static/skywire-manager-src/src/app/components/pages/node/apps/node-apps/node-apps-list/node-apps-list.component.html @@ -51,6 +51,10 @@ + + + {{ sortingArrow }} + {{ 'apps.apps-list.app-name' | translate }} {{ sortingArrow }} @@ -59,10 +63,6 @@ {{ 'apps.apps-list.port' | translate }} {{ sortingArrow }} - - {{ 'apps.apps-list.status' | translate }} - {{ sortingArrow }} - {{ 'apps.apps-list.auto-start' | translate }} {{ sortingArrow }} @@ -77,18 +77,18 @@ (change)="changeSelection(app)"> - - {{ app.name }} - - - {{ app.port }} - + + {{ app.name }} + + + {{ app.port }} +