mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 14:29:45 +00:00
rebase
This commit is contained in:
committed by
Aiden McClelland
parent
199ce9a56f
commit
5d9f7e412c
@@ -1,5 +1,5 @@
|
|||||||
import { Component } from '@angular/core'
|
import { Component } from '@angular/core'
|
||||||
import { AlertController, LoadingController, NavController } from '@ionic/angular'
|
import { AlertController, LoadingController, NavController, IonicSafeString } from '@ionic/angular'
|
||||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||||
import { ActivatedRoute } from '@angular/router'
|
import { ActivatedRoute } from '@angular/router'
|
||||||
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
import { ErrorToastService } from 'src/app/services/error-toast.service'
|
||||||
@@ -69,25 +69,24 @@ export class ServerShowPage {
|
|||||||
await alert.present()
|
await alert.present()
|
||||||
}
|
}
|
||||||
|
|
||||||
async presentAlertHardRestart () {
|
async presentAlertSystemRebuild () {
|
||||||
const minutes = Object.keys(this.patch.data['package-data']).length * 2
|
const minutes = Object.keys(this.patch.data['package-data']).length * 2
|
||||||
const alert = await this.alertCtrl.create({
|
const alert = await this.alertCtrl.create({
|
||||||
header: 'Warning',
|
header: 'System Rebuild',
|
||||||
message: `Do not hard restart unless your Embassy is in a corrupt state or you have been instructed by a Start9 support representitive. This process may take up to ${minutes} minutes.`,
|
message: new IonicSafeString(`<ion-text color="warning">Important:</ion-text> This will tear down all service containers and rebuild them from scratch. This may take up to ${minutes} minutes to complete. During this time, you will lose all connectivity to your Embassy.`),
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Cancel',
|
text: 'Cancel',
|
||||||
role: 'cancel',
|
role: 'cancel',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Hard Restart',
|
text: 'Rebuild',
|
||||||
handler: () => {
|
handler: () => {
|
||||||
this.hardRestart()
|
this.systemRebuild()
|
||||||
},
|
},
|
||||||
cssClass: 'enter-click',
|
cssClass: 'enter-click',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
cssClass: 'alert-error-message',
|
|
||||||
})
|
})
|
||||||
await alert.present()
|
await alert.present()
|
||||||
}
|
}
|
||||||
@@ -126,7 +125,7 @@ export class ServerShowPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async hardRestart () {
|
private async systemRebuild () {
|
||||||
const loader = await this.loadingCtrl.create({
|
const loader = await this.loadingCtrl.create({
|
||||||
spinner: 'lines',
|
spinner: 'lines',
|
||||||
message: 'Hard Restarting...',
|
message: 'Hard Restarting...',
|
||||||
@@ -135,7 +134,7 @@ export class ServerShowPage {
|
|||||||
await loader.present()
|
await loader.present()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.embassyApi.hardRestartServer({ })
|
await this.embassyApi.systemRebuild({ })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.errToast.present(e)
|
this.errToast.present(e)
|
||||||
} finally {
|
} finally {
|
||||||
@@ -249,10 +248,10 @@ export class ServerShowPage {
|
|||||||
disabled: of(false),
|
disabled: of(false),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Hard Restart',
|
title: 'System Rebuild',
|
||||||
description: '',
|
description: '',
|
||||||
icon: 'alert-circle-outline',
|
icon: 'construct-outline',
|
||||||
action: () => this.presentAlertHardRestart(),
|
action: () => this.presentAlertSystemRebuild(),
|
||||||
detail: false,
|
detail: false,
|
||||||
disabled: of(false),
|
disabled: of(false),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ export module RR {
|
|||||||
export type ShutdownServerReq = { } // server.shutdown
|
export type ShutdownServerReq = { } // server.shutdown
|
||||||
export type ShutdownServerRes = null
|
export type ShutdownServerRes = null
|
||||||
|
|
||||||
export type HardRestartServerReq = { } // server.hard-restart
|
export type SystemRebuildReq = { } // server.rebuild
|
||||||
export type HardRestartServerRes = null
|
export type SystemRebuildRes = null
|
||||||
|
|
||||||
// sessions
|
// sessions
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ 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>
|
||||||
|
|
||||||
abstract hardRestartServer (params: RR.HardRestartServerReq): Promise<RR.HardRestartServerRes>
|
abstract systemRebuild (params: RR.SystemRebuildReq): Promise<RR.SystemRebuildRes>
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ export class LiveApiService extends ApiService {
|
|||||||
return this.http.rpcRequest({ method: 'server.shutdown', params })
|
return this.http.rpcRequest({ method: 'server.shutdown', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
async hardRestartServer (params: RR.RestartServerReq): Promise<RR.RestartServerRes> {
|
async systemRebuild (params: RR.RestartServerReq): Promise<RR.RestartServerRes> {
|
||||||
return this.http.rpcRequest({ method: 'server.hard-restart', params })
|
return this.http.rpcRequest({ method: 'server.rebuild', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export class MockApiService extends ApiService {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
async hardRestartServer (params: RR.RestartServerReq): Promise<RR.RestartServerRes> {
|
async systemRebuild (params: RR.RestartServerReq): Promise<RR.RestartServerRes> {
|
||||||
await pauseFor(2000)
|
await pauseFor(2000)
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user