From 4b4cf76641771f753326649402b7813bd756832a Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Fri, 28 Mar 2025 14:38:49 -0600 Subject: [PATCH] remove ssh, deprecate wifi (#2859) --- .../ui/src/app/i18n/dictionaries/english.ts | 1 - .../ui/src/app/i18n/dictionaries/spanish.ts | 1 - .../system/routes/acme/acme.component.ts | 25 +++++++++++++-- .../routes/sessions/sessions.component.ts | 4 +-- .../system/routes/sessions/table.component.ts | 2 +- .../system/routes/wifi/wifi.component.ts | 32 ++++++++----------- .../portal/routes/system/system.component.ts | 15 +++++++++ .../portal/routes/system/system.const.ts | 4 --- .../portal/routes/system/system.routes.ts | 4 --- .../ui/src/app/services/api/api.types.ts | 4 --- .../ui/src/app/services/api/mock-patch.ts | 2 +- 11 files changed, 56 insertions(+), 38 deletions(-) diff --git a/web/projects/ui/src/app/i18n/dictionaries/english.ts b/web/projects/ui/src/app/i18n/dictionaries/english.ts index 0a21bbe44..79e6da6e0 100644 --- a/web/projects/ui/src/app/i18n/dictionaries/english.ts +++ b/web/projects/ui/src/app/i18n/dictionaries/english.ts @@ -16,7 +16,6 @@ export default { acme: 'ACME', wifi: 'WiFi', sessions: 'Active Sessions', - ssh: 'SSH', password: 'Change Password', }, general: { diff --git a/web/projects/ui/src/app/i18n/dictionaries/spanish.ts b/web/projects/ui/src/app/i18n/dictionaries/spanish.ts index d84118996..334ebfe80 100644 --- a/web/projects/ui/src/app/i18n/dictionaries/spanish.ts +++ b/web/projects/ui/src/app/i18n/dictionaries/spanish.ts @@ -18,7 +18,6 @@ export default { acme: 'ACME', wifi: 'WiFi', sessions: 'Sesiones Activas', - ssh: 'SSH', password: 'Cambiar ContraseƱa', }, general: { diff --git a/web/projects/ui/src/app/routes/portal/routes/system/routes/acme/acme.component.ts b/web/projects/ui/src/app/routes/portal/routes/system/routes/acme/acme.component.ts index 864a8a33b..6ef06ecc0 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/routes/acme/acme.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/routes/acme/acme.component.ts @@ -1,8 +1,15 @@ import { ChangeDetectionStrategy, Component, inject } from '@angular/core' import { toSignal } from '@angular/core/rxjs-interop' +import { RouterLink } from '@angular/router' import { ErrorService, LoadingService } from '@start9labs/shared' import { ISB, utils } from '@start9labs/start-sdk' -import { TuiButton, TuiLink, TuiLoader, TuiTitle } from '@taiga-ui/core' +import { + TuiButton, + TuiIcon, + TuiLink, + TuiLoader, + TuiTitle, +} from '@taiga-ui/core' import { TuiCell, TuiHeader } from '@taiga-ui/layout' import { PatchDB } from 'patch-db-client' import { map } from 'rxjs' @@ -10,11 +17,16 @@ import { FormComponent } from 'src/app/routes/portal/components/form.component' import { ApiService } from 'src/app/services/api/embassy-api.service' import { FormDialogService } from 'src/app/services/form-dialog.service' import { DataModel } from 'src/app/services/patch-db/data-model' +import { TitleDirective } from 'src/app/services/title.service' import { knownACME, toAcmeName } from 'src/app/utils/acme' import { configBuilderToSpec } from 'src/app/utils/configBuilderToSpec' @Component({ template: ` + + Back + ACME +

ACME

@@ -86,7 +98,16 @@ import { configBuilderToSpec } from 'src/app/utils/configBuilderToSpec' `, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, - imports: [TuiButton, TuiLoader, TuiCell, TuiTitle, TuiHeader, TuiLink], + imports: [ + TuiButton, + TuiLoader, + TuiCell, + TuiTitle, + TuiHeader, + TuiLink, + RouterLink, + TitleDirective, + ], }) export default class SystemAcmeComponent { private readonly formDialog = inject(FormDialogService) diff --git a/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/sessions.component.ts b/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/sessions.component.ts index 10f93fc88..faf2504bd 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/sessions.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/sessions.component.ts @@ -10,7 +10,7 @@ import { from, map, merge, Observable, Subject } from 'rxjs' import { ApiService } from 'src/app/services/api/embassy-api.service' import { Session } from 'src/app/services/api/api.types' import { TitleDirective } from 'src/app/services/title.service' -import { SSHTableComponent } from './table.component' +import { SessionsTableComponent } from './table.component' @Component({ template: ` @@ -56,7 +56,7 @@ import { SSHTableComponent } from './table.component' imports: [ CommonModule, TuiButton, - SSHTableComponent, + SessionsTableComponent, TuiLet, RouterLink, TitleDirective, diff --git a/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/table.component.ts b/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/table.component.ts index 18617f4e7..f437e7bd1 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/table.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/routes/sessions/table.component.ts @@ -136,7 +136,7 @@ import { PlatformInfoPipe } from './platform-info.pipe' TableComponent, ], }) -export class SSHTableComponent implements OnChanges { +export class SessionsTableComponent implements OnChanges { readonly selected$ = new BehaviorSubject([]) @Input() diff --git a/web/projects/ui/src/app/routes/portal/routes/system/routes/wifi/wifi.component.ts b/web/projects/ui/src/app/routes/portal/routes/system/routes/wifi/wifi.component.ts index 59545a616..bd1b2861e 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/routes/wifi/wifi.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/routes/wifi/wifi.component.ts @@ -15,6 +15,7 @@ import { TuiDialogOptions, TuiLink, TuiLoader, + TuiNotification, TuiTitle, } from '@taiga-ui/core' import { TuiSwitch } from '@taiga-ui/kit' @@ -41,24 +42,18 @@ import { wifiSpec } from './wifi.const' WiFi
-
-

WiFi

-

- Adding WiFi credentials to StartOS allows you to remove the Ethernet - cable and move the device anywhere you want. StartOS will - automatically connect to available networks. - -

-
+ +
+ Deprecated +
+ WiFi support will be removed in StartOS v0.4.1. If you do not have + access to Ethernet, you can use a WiFi extender to connect to the + local network, then connect your server to the extender via + Ethernet. Please contact Start9 support with any questions or + concerns. +
+
+
@if (status()?.interface) {
@@ -127,6 +122,7 @@ import { wifiSpec } from './wifi.const' TuiHeader, TuiTitle, TuiLink, + TuiNotification, ], }) export default class SystemWifiComponent { diff --git a/web/projects/ui/src/app/routes/portal/routes/system/system.component.ts b/web/projects/ui/src/app/routes/portal/routes/system/system.component.ts index 0e3e6c01e..5279b1d56 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/system.component.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/system.component.ts @@ -8,6 +8,9 @@ import { i18nPipe } from 'src/app/i18n/i18n.pipe' import { BadgeService } from 'src/app/services/badge.service' import { TitleDirective } from 'src/app/services/title.service' import { SYSTEM_MENU } from './system.const' +import { PatchDB } from 'patch-db-client' +import { DataModel } from 'src/app/services/patch-db/data-model' +import { AsyncPipe } from '@angular/common' @Component({ template: ` @@ -22,6 +25,11 @@ import { SYSTEM_MENU } from './system.const' tuiCell="s" routerLinkActive="active" [routerLink]="page.item.split('.').at(-1)" + [style.display]=" + !(wifiEnabled$ | async) && page.item === 'system.outlet.wifi' + ? 'none' + : null + " > @@ -116,9 +124,16 @@ import { SYSTEM_MENU } from './system.const' TitleDirective, TuiBadgeNotification, i18nPipe, + AsyncPipe, ], }) export class SystemComponent { readonly menu = SYSTEM_MENU readonly badge = toSignal(inject(BadgeService).getCount('/portal/system')) + readonly wifiEnabled$ = inject>(PatchDB).watch$( + 'serverInfo', + 'network', + 'wifi', + 'enabled', + ) } diff --git a/web/projects/ui/src/app/routes/portal/routes/system/system.const.ts b/web/projects/ui/src/app/routes/portal/routes/system/system.const.ts index 2cf91c11e..41118958f 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/system.const.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/system.const.ts @@ -38,10 +38,6 @@ export const SYSTEM_MENU = [ icon: '@tui.clock', item: 'system.outlet.sessions', }, - { - icon: '@tui.terminal', - item: 'system.outlet.ssh', - }, { icon: '@tui.key', item: 'system.outlet.password', diff --git a/web/projects/ui/src/app/routes/portal/routes/system/system.routes.ts b/web/projects/ui/src/app/routes/portal/routes/system/system.routes.ts index a4e5cd062..18e43c31d 100644 --- a/web/projects/ui/src/app/routes/portal/routes/system/system.routes.ts +++ b/web/projects/ui/src/app/routes/portal/routes/system/system.routes.ts @@ -53,10 +53,6 @@ export default [ path: 'sessions', loadComponent: () => import('./routes/sessions/sessions.component'), }, - { - path: 'ssh', - loadComponent: () => import('./routes/ssh/ssh.component'), - }, { path: 'password', loadComponent: () => import('./routes/password/password.component'), diff --git a/web/projects/ui/src/app/services/api/api.types.ts b/web/projects/ui/src/app/services/api/api.types.ts index 3f9b94100..d039461f0 100644 --- a/web/projects/ui/src/app/services/api/api.types.ts +++ b/web/projects/ui/src/app/services/api/api.types.ts @@ -149,10 +149,6 @@ export namespace RR { // wifi - // @TODO remove for 040, set at server scope - // export type SetWifiCountryReq = { country: string } - // export type SetWifiCountryRes = null - export type GetWifiReq = {} export type GetWifiRes = { ssids: { diff --git a/web/projects/ui/src/app/services/api/mock-patch.ts b/web/projects/ui/src/app/services/api/mock-patch.ts index b51ea74e0..6b17e6fae 100644 --- a/web/projects/ui/src/app/services/api/mock-patch.ts +++ b/web/projects/ui/src/app/services/api/mock-patch.ts @@ -34,7 +34,7 @@ export const mockPatchData: DataModel = { lastBackup: new Date(new Date().valueOf() - 604800001).toISOString(), network: { wifi: { - enabled: false, + enabled: true, interface: 'wlan0', ssids: [], selected: null,