don't deprecate wifi

This commit is contained in:
Matt Hill
2024-08-01 21:39:16 -06:00
parent ecd0edc29e
commit 0cfc43c444
5 changed files with 128 additions and 135 deletions

View File

@@ -76,7 +76,7 @@ const routes: Routes = [
import('./ssh-keys/ssh-keys.module').then(m => m.SSHKeysPageModule), import('./ssh-keys/ssh-keys.module').then(m => m.SSHKeysPageModule),
}, },
{ {
path: 'wifi', path: 'wireless',
loadChildren: () => loadChildren: () =>
import('./wifi/wifi.module').then(m => m.WifiPageModule), import('./wifi/wifi.module').then(m => m.WifiPageModule),
}, },

View File

@@ -50,8 +50,7 @@
<ion-item <ion-item
*ngFor="let button of cat.value" *ngFor="let button of cat.value"
button button
[style.display]="((button.title === 'Repair Disk' && !(showDiskRepair$ | async))) || (button.title === 'WiFi' && !(wifiConnected$ | async)) ? 'none' : 'block'" [style.display]="((button.title === 'Repair Disk' && !(showDiskRepair$ | async))) ? 'none' : 'block'"
[color]="button.title === 'WiFi' ? 'warning' : ''"
[detail]="button.detail" [detail]="button.detail"
[disabled]="button.disabled$ | async" [disabled]="button.disabled$ | async"
(click)="button.action()" (click)="button.action()"

View File

@@ -40,7 +40,6 @@ export class ServerShowPage {
readonly server$ = this.patch.watch$('serverInfo') readonly server$ = this.patch.watch$('serverInfo')
readonly showUpdate$ = this.eosService.showUpdate$ readonly showUpdate$ = this.eosService.showUpdate$
readonly showDiskRepair$ = this.ClientStorageService.showDiskRepair$ readonly showDiskRepair$ = this.ClientStorageService.showDiskRepair$
readonly wifiConnected$ = this.patch.watch$('serverInfo', 'wifi', 'selected')
constructor( constructor(
private readonly alertCtrl: AlertController, private readonly alertCtrl: AlertController,
@@ -475,11 +474,14 @@ export class ServerShowPage {
disabled$: of(false), disabled$: of(false),
}, },
{ {
title: 'WiFi', title: 'Wireless',
description: 'WiFi is deprecated. Click to learn more.', description:
'Connect your server to WiFi instead of Ethernet (not recommended)',
icon: 'wifi', icon: 'wifi',
action: () => action: () =>
this.navCtrl.navigateForward(['wifi'], { relativeTo: this.route }), this.navCtrl.navigateForward(['wireless'], {
relativeTo: this.route,
}),
detail: true, detail: true,
disabled$: of(false), disabled$: of(false),
}, },

View File

@@ -3,8 +3,8 @@
<ion-buttons slot="start"> <ion-buttons slot="start">
<ion-back-button defaultHref="system"></ion-back-button> <ion-back-button defaultHref="system"></ion-back-button>
</ion-buttons> </ion-buttons>
<ion-title>WiFi Settings</ion-title> <ion-title>Wireless Settings</ion-title>
<ion-buttons slot="end"> <ion-buttons slot="end" *ngIf="hasWifi$ | async">
<ion-button (click)="getWifi()"> <ion-button (click)="getWifi()">
Refresh Refresh
<ion-icon slot="end" name="refresh"></ion-icon> <ion-icon slot="end" name="refresh"></ion-icon>
@@ -13,27 +13,9 @@
</ion-toolbar> </ion-toolbar>
</ion-header> </ion-header>
<ion-content class="ion-padding-top with-widgets"> <ion-content class="ion-padding with-widgets">
<ion-item-group> <ng-container *ngIf="connection$ | async">
<!-- always --> <ion-item-group *ngIf="hasWifi$ | async; else noWifi">
<ion-item color="warning" class="ion-margin">
<ion-icon slot="start" name="warning-outline"></ion-icon>
<ion-label>
<h2 style="font-weight: bold">WiFi is deprecated</h2>
<p style="font-weight: 600">
WiFi will be eliminated from StartOS in version v0.4.0, expected soon.
Before then, we highly recommend switching your server to a direct,
Ethernet connection, which is faster and more reliable. If using
Ethernet is not possible for you, we recommend using a WiFi extender
instead.
</p>
</ion-label>
<ion-button slot="end" color="light" (click)="openDocs()">
Learn More
<ion-icon slot="end" name="open-outline"></ion-icon>
</ion-button>
</ion-item>
<ion-item-divider>Country</ion-item-divider> <ion-item-divider>Country</ion-item-divider>
<!-- not loading --> <!-- not loading -->
@@ -172,4 +154,8 @@
</ion-item> </ion-item>
</ng-container> </ng-container>
</ion-item-group> </ion-item-group>
<ng-template #noWifi>
<p>No wireless interface detected.</p>
</ng-template>
</ng-container>
</ion-content> </ion-content>

View File

@@ -9,11 +9,14 @@ import { WINDOW } from '@ng-web-apis/common'
import { ErrorService, LoadingService, pauseFor } from '@start9labs/shared' import { ErrorService, LoadingService, pauseFor } from '@start9labs/shared'
import { CT } from '@start9labs/start-sdk' import { CT } from '@start9labs/start-sdk'
import { TuiDialogOptions } from '@taiga-ui/core' import { TuiDialogOptions } from '@taiga-ui/core'
import { PatchDB } from 'patch-db-client'
import { FormComponent, FormContext } from 'src/app/components/form.component' import { FormComponent, FormContext } from 'src/app/components/form.component'
import { RR } from 'src/app/services/api/api.types' import { RR } from 'src/app/services/api/api.types'
import { ApiService } from 'src/app/services/api/embassy-api.service' import { ApiService } from 'src/app/services/api/embassy-api.service'
import { ConfigService } from 'src/app/services/config.service' import { ConfigService } from 'src/app/services/config.service'
import { ConnectionService } from 'src/app/services/connection.service'
import { FormDialogService } from 'src/app/services/form-dialog.service' import { FormDialogService } from 'src/app/services/form-dialog.service'
import { DataModel } from 'src/app/services/patch-db/data-model'
export interface WiFiForm { export interface WiFiForm {
ssid: string ssid: string
@@ -31,6 +34,7 @@ export class WifiPage {
countries = require('../../../util/countries.json') as { countries = require('../../../util/countries.json') as {
[key: string]: string [key: string]: string
} }
readonly hasWifi$ = this.patch.watch$('serverInfo', 'wifi', 'interface')
constructor( constructor(
private readonly api: ApiService, private readonly api: ApiService,
@@ -41,6 +45,8 @@ export class WifiPage {
private readonly errorService: ErrorService, private readonly errorService: ErrorService,
private readonly actionCtrl: ActionSheetController, private readonly actionCtrl: ActionSheetController,
private readonly config: ConfigService, private readonly config: ConfigService,
private readonly patch: PatchDB<DataModel>,
readonly connection$: ConnectionService,
@Inject(WINDOW) private readonly windowRef: Window, @Inject(WINDOW) private readonly windowRef: Window,
) {} ) {}