mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
don't deprecate wifi
This commit is contained in:
@@ -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),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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()"
|
||||||
|
|||||||
@@ -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),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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,163 +13,149 @@
|
|||||||
</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-item-divider>Country</ion-item-divider>
|
||||||
<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>
|
<!-- not loading -->
|
||||||
|
|
||||||
<!-- not loading -->
|
|
||||||
<ion-item
|
|
||||||
button
|
|
||||||
detail="false"
|
|
||||||
(click)="presentAlertCountry()"
|
|
||||||
[disabled]="loading"
|
|
||||||
>
|
|
||||||
<ion-icon slot="start" name="earth-outline" size="large"></ion-icon>
|
|
||||||
<ion-label *ngIf="wifi.country">
|
|
||||||
{{ wifi.country }} - {{ this.countries[wifi.country] }}
|
|
||||||
</ion-label>
|
|
||||||
<ion-label *ngIf="!wifi.country">Select Country</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<!-- loading -->
|
|
||||||
<ng-container *ngIf="loading">
|
|
||||||
<ion-item-divider>Saved Networks</ion-item-divider>
|
|
||||||
<ion-item *ngFor="let entry of ['', '']" class="skeleton-parts">
|
|
||||||
<ion-button slot="start" fill="clear">
|
|
||||||
<ion-skeleton-text
|
|
||||||
animated
|
|
||||||
style="width: 30px; height: 30px; border-radius: 0"
|
|
||||||
></ion-skeleton-text>
|
|
||||||
</ion-button>
|
|
||||||
<ion-label>
|
|
||||||
<ion-skeleton-text animated style="width: 18%"></ion-skeleton-text>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
|
|
||||||
<ion-item-divider>Available Networks</ion-item-divider>
|
|
||||||
<ion-item *ngFor="let entry of ['', '']" class="skeleton-parts">
|
|
||||||
<ion-button slot="start" fill="clear">
|
|
||||||
<ion-skeleton-text
|
|
||||||
animated
|
|
||||||
style="width: 30px; height: 30px; border-radius: 0"
|
|
||||||
></ion-skeleton-text>
|
|
||||||
</ion-button>
|
|
||||||
<ion-label>
|
|
||||||
<ion-skeleton-text animated style="width: 18%"></ion-skeleton-text>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<!-- not loading -->
|
|
||||||
<ng-container *ngIf="!loading && wifi.country">
|
|
||||||
<ion-item-divider *ngIf="!(wifi.ssids | empty)">
|
|
||||||
Saved Networks
|
|
||||||
</ion-item-divider>
|
|
||||||
<ion-item
|
<ion-item
|
||||||
button
|
button
|
||||||
detail="false"
|
detail="false"
|
||||||
*ngFor="let ssid of wifi.ssids | keyvalue"
|
(click)="presentAlertCountry()"
|
||||||
(click)="presentAction(ssid.key)"
|
[disabled]="loading"
|
||||||
>
|
>
|
||||||
<div
|
<ion-icon slot="start" name="earth-outline" size="large"></ion-icon>
|
||||||
*ngIf="ssid.key !== wifi.connected"
|
<ion-label *ngIf="wifi.country">
|
||||||
slot="start"
|
{{ wifi.country }} - {{ this.countries[wifi.country] }}
|
||||||
style="padding-right: 32px"
|
</ion-label>
|
||||||
></div>
|
<ion-label *ngIf="!wifi.country">Select Country</ion-label>
|
||||||
<ion-icon
|
|
||||||
*ngIf="ssid.key === wifi.connected"
|
|
||||||
slot="start"
|
|
||||||
size="large"
|
|
||||||
name="checkmark"
|
|
||||||
color="success"
|
|
||||||
></ion-icon>
|
|
||||||
<ion-label>{{ ssid.key }}</ion-label>
|
|
||||||
<img
|
|
||||||
*ngIf="ssid.value > 0 && ssid.value < 5"
|
|
||||||
slot="end"
|
|
||||||
src="assets/img/icons/wifi-1.png"
|
|
||||||
style="max-width: 32px"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
*ngIf="ssid.value >= 5 && ssid.value < 50"
|
|
||||||
slot="end"
|
|
||||||
src="assets/img/icons/wifi-1.png"
|
|
||||||
style="max-width: 32px"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
*ngIf="ssid.value >= 50 && ssid.value < 90"
|
|
||||||
slot="end"
|
|
||||||
src="assets/img/icons/wifi-2.png"
|
|
||||||
style="max-width: 32px"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
*ngIf="ssid.value >= 90"
|
|
||||||
slot="end"
|
|
||||||
src="assets/img/icons/wifi-3.png"
|
|
||||||
style="max-width: 32px"
|
|
||||||
/>
|
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<ion-item-divider>Available Networks</ion-item-divider>
|
<!-- loading -->
|
||||||
<ng-container *ngFor="let avWifi of wifi.availableWifi">
|
<ng-container *ngIf="loading">
|
||||||
|
<ion-item-divider>Saved Networks</ion-item-divider>
|
||||||
|
<ion-item *ngFor="let entry of ['', '']" class="skeleton-parts">
|
||||||
|
<ion-button slot="start" fill="clear">
|
||||||
|
<ion-skeleton-text
|
||||||
|
animated
|
||||||
|
style="width: 30px; height: 30px; border-radius: 0"
|
||||||
|
></ion-skeleton-text>
|
||||||
|
</ion-button>
|
||||||
|
<ion-label>
|
||||||
|
<ion-skeleton-text animated style="width: 18%"></ion-skeleton-text>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item-divider>Available Networks</ion-item-divider>
|
||||||
|
<ion-item *ngFor="let entry of ['', '']" class="skeleton-parts">
|
||||||
|
<ion-button slot="start" fill="clear">
|
||||||
|
<ion-skeleton-text
|
||||||
|
animated
|
||||||
|
style="width: 30px; height: 30px; border-radius: 0"
|
||||||
|
></ion-skeleton-text>
|
||||||
|
</ion-button>
|
||||||
|
<ion-label>
|
||||||
|
<ion-skeleton-text animated style="width: 18%"></ion-skeleton-text>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<!-- not loading -->
|
||||||
|
<ng-container *ngIf="!loading && wifi.country">
|
||||||
|
<ion-item-divider *ngIf="!(wifi.ssids | empty)">
|
||||||
|
Saved Networks
|
||||||
|
</ion-item-divider>
|
||||||
<ion-item
|
<ion-item
|
||||||
button
|
button
|
||||||
detail="false"
|
detail="false"
|
||||||
(click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)"
|
*ngFor="let ssid of wifi.ssids | keyvalue"
|
||||||
*ngIf="avWifi.ssid"
|
(click)="presentAction(ssid.key)"
|
||||||
>
|
>
|
||||||
<ion-label>{{ avWifi.ssid }}</ion-label>
|
<div
|
||||||
|
*ngIf="ssid.key !== wifi.connected"
|
||||||
|
slot="start"
|
||||||
|
style="padding-right: 32px"
|
||||||
|
></div>
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ssid.key === wifi.connected"
|
||||||
|
slot="start"
|
||||||
|
size="large"
|
||||||
|
name="checkmark"
|
||||||
|
color="success"
|
||||||
|
></ion-icon>
|
||||||
|
<ion-label>{{ ssid.key }}</ion-label>
|
||||||
<img
|
<img
|
||||||
*ngIf="avWifi.strength < 5"
|
*ngIf="ssid.value > 0 && ssid.value < 5"
|
||||||
slot="end"
|
slot="end"
|
||||||
src="assets/img/icons/wifi-1.png"
|
src="assets/img/icons/wifi-1.png"
|
||||||
style="max-width: 32px"
|
style="max-width: 32px"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
*ngIf="avWifi.strength >= 5 && avWifi.strength < 50"
|
*ngIf="ssid.value >= 5 && ssid.value < 50"
|
||||||
slot="end"
|
slot="end"
|
||||||
src="assets/img/icons/wifi-1.png"
|
src="assets/img/icons/wifi-1.png"
|
||||||
style="max-width: 32px"
|
style="max-width: 32px"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
*ngIf="avWifi.strength >= 50 && avWifi.strength < 90"
|
*ngIf="ssid.value >= 50 && ssid.value < 90"
|
||||||
slot="end"
|
slot="end"
|
||||||
src="assets/img/icons/wifi-2.png"
|
src="assets/img/icons/wifi-2.png"
|
||||||
style="max-width: 32px"
|
style="max-width: 32px"
|
||||||
/>
|
/>
|
||||||
<img
|
<img
|
||||||
*ngIf="avWifi.strength >= 90"
|
*ngIf="ssid.value >= 90"
|
||||||
slot="end"
|
slot="end"
|
||||||
src="assets/img/icons/wifi-3.png"
|
src="assets/img/icons/wifi-3.png"
|
||||||
style="max-width: 32px"
|
style="max-width: 32px"
|
||||||
/>
|
/>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
|
<ion-item-divider>Available Networks</ion-item-divider>
|
||||||
|
<ng-container *ngFor="let avWifi of wifi.availableWifi">
|
||||||
|
<ion-item
|
||||||
|
button
|
||||||
|
detail="false"
|
||||||
|
(click)="presentModalAdd(avWifi.ssid, !!avWifi.security.length)"
|
||||||
|
*ngIf="avWifi.ssid"
|
||||||
|
>
|
||||||
|
<ion-label>{{ avWifi.ssid }}</ion-label>
|
||||||
|
<img
|
||||||
|
*ngIf="avWifi.strength < 5"
|
||||||
|
slot="end"
|
||||||
|
src="assets/img/icons/wifi-1.png"
|
||||||
|
style="max-width: 32px"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
*ngIf="avWifi.strength >= 5 && avWifi.strength < 50"
|
||||||
|
slot="end"
|
||||||
|
src="assets/img/icons/wifi-1.png"
|
||||||
|
style="max-width: 32px"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
*ngIf="avWifi.strength >= 50 && avWifi.strength < 90"
|
||||||
|
slot="end"
|
||||||
|
src="assets/img/icons/wifi-2.png"
|
||||||
|
style="max-width: 32px"
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
*ngIf="avWifi.strength >= 90"
|
||||||
|
slot="end"
|
||||||
|
src="assets/img/icons/wifi-3.png"
|
||||||
|
style="max-width: 32px"
|
||||||
|
/>
|
||||||
|
</ion-item>
|
||||||
|
</ng-container>
|
||||||
|
<ion-item button detail="false" (click)="presentModalAdd()">
|
||||||
|
<ion-icon slot="start" name="add" color="dark"></ion-icon>
|
||||||
|
<ion-label>
|
||||||
|
<b>Join Another Network</b>
|
||||||
|
</ion-label>
|
||||||
|
</ion-item>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<ion-item button detail="false" (click)="presentModalAdd()">
|
</ion-item-group>
|
||||||
<ion-icon slot="start" name="add" color="dark"></ion-icon>
|
<ng-template #noWifi>
|
||||||
<ion-label>
|
<p>No wireless interface detected.</p>
|
||||||
<b>Join Another Network</b>
|
</ng-template>
|
||||||
</ion-label>
|
</ng-container>
|
||||||
</ion-item>
|
|
||||||
</ng-container>
|
|
||||||
</ion-item-group>
|
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -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,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user