mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
remove refreshLAN feature
This commit is contained in:
committed by
Aiden McClelland
parent
2475c08648
commit
038a7263f3
@@ -31,15 +31,6 @@
|
|||||||
<p>Download and trust your Embassy's Root Certificate Authority to establish a secure connection on the LAN.</p>
|
<p>Download and trust your Embassy's Root Certificate Authority to establish a secure connection on the LAN.</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
||||||
<!-- Refresh Network -->
|
|
||||||
<ion-item button (click)="refreshLAN()" detail="false">
|
|
||||||
<ion-icon slot="start" name="refresh-outline" size="large"></ion-icon>
|
|
||||||
<ion-label>
|
|
||||||
<h1>Refresh LAN</h1>
|
|
||||||
<p>If you are having issues connecting to your Embassy over LAN, try refreshing your LAN services by clicking the button below.</p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ion-item-group>
|
</ion-item-group>
|
||||||
|
|
||||||
<!-- hidden element for downloading cert -->
|
<!-- hidden element for downloading cert -->
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { LoadingController, ToastController } from '@ionic/angular'
|
|
||||||
import { ConfigService } from 'src/app/services/config.service'
|
import { ConfigService } from 'src/app/services/config.service'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'lan',
|
selector: 'lan',
|
||||||
@@ -14,11 +11,7 @@ export class LANPage {
|
|||||||
lanDisabled: string
|
lanDisabled: string
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private readonly toastCtrl: ToastController,
|
|
||||||
private readonly config: ConfigService,
|
private readonly config: ConfigService,
|
||||||
private readonly loadingCtrl: LoadingController,
|
|
||||||
private readonly errToast: ErrorToastService,
|
|
||||||
private readonly embassyApi: ApiService,
|
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
@@ -30,43 +23,4 @@ export class LANPage {
|
|||||||
installCert (): void {
|
installCert (): void {
|
||||||
document.getElementById('install-cert').click()
|
document.getElementById('install-cert').click()
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshLAN (): Promise<void> {
|
|
||||||
const loader = await this.loadingCtrl.create({
|
|
||||||
spinner: 'lines',
|
|
||||||
message: 'Refreshing LAN...',
|
|
||||||
cssClass: 'loader',
|
|
||||||
})
|
|
||||||
await loader.present()
|
|
||||||
|
|
||||||
try {
|
|
||||||
await this.embassyApi.refreshLan({ })
|
|
||||||
this.presentToastSuccess()
|
|
||||||
} catch (e) {
|
|
||||||
this.errToast.present(e)
|
|
||||||
} finally {
|
|
||||||
loader.dismiss()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async presentToastSuccess (): Promise<void> {
|
|
||||||
const toast = await this.toastCtrl.create({
|
|
||||||
header: 'Success',
|
|
||||||
message: `LAN refreshed.`,
|
|
||||||
position: 'bottom',
|
|
||||||
duration: 3000,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
side: 'start',
|
|
||||||
icon: 'close',
|
|
||||||
handler: () => {
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
cssClass: 'success-toast',
|
|
||||||
})
|
|
||||||
|
|
||||||
await toast.present()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,6 @@ export module RR {
|
|||||||
export type ShutdownServerReq = { } // server.shutdown
|
export type ShutdownServerReq = { } // server.shutdown
|
||||||
export type ShutdownServerRes = null
|
export type ShutdownServerRes = null
|
||||||
|
|
||||||
// network
|
|
||||||
|
|
||||||
export type RefreshLanReq = { } // network.lan.refresh
|
|
||||||
export type RefreshLanRes = null
|
|
||||||
|
|
||||||
// sessions
|
// sessions
|
||||||
|
|
||||||
export type GetSessionsReq = { } // sessions.list
|
export type GetSessionsReq = { } // sessions.list
|
||||||
|
|||||||
@@ -59,10 +59,6 @@ export abstract class ApiService implements Source<DataModel>, Http<DataModel> {
|
|||||||
|
|
||||||
abstract shutdownServer (params: RR.ShutdownServerReq): Promise<RR.ShutdownServerRes>
|
abstract shutdownServer (params: RR.ShutdownServerReq): Promise<RR.ShutdownServerRes>
|
||||||
|
|
||||||
// network
|
|
||||||
|
|
||||||
abstract refreshLan (params: RR.RefreshLanReq): Promise<RR.RefreshLanRes>
|
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
abstract getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes>
|
abstract getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes>
|
||||||
|
|||||||
@@ -77,12 +77,6 @@ export class LiveApiService extends ApiService {
|
|||||||
return this.http.rpcRequest({ method: 'server.shutdown', params })
|
return this.http.rpcRequest({ method: 'server.shutdown', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// network
|
|
||||||
|
|
||||||
async refreshLan (params: RR.RefreshLanReq): Promise<RR.RefreshLanRes> {
|
|
||||||
return this.http.rpcRequest({ method: 'network.lan.refresh', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
||||||
|
|||||||
@@ -136,13 +136,6 @@ export class MockApiService extends ApiService {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
// network
|
|
||||||
|
|
||||||
async refreshLan (params: RR.RefreshLanReq): Promise<RR.RefreshLanRes> {
|
|
||||||
await pauseFor(2000)
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
async getEos (params: RR.GetMarketplaceEOSReq): Promise<RR.GetMarketplaceEOSRes> {
|
||||||
|
|||||||
Reference in New Issue
Block a user