mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
show newlines in action res and longer timeout
This commit is contained in:
committed by
Aiden McClelland
parent
d9894d4082
commit
e69a936fb8
@@ -68,27 +68,36 @@ export class AppActionsPage extends Cleanup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async executeAction(action: ServiceAction) {
|
private async executeAction(action: ServiceAction) {
|
||||||
const res = await this.loaderService.displayDuringP(
|
try {
|
||||||
this.apiService.serviceAction(this.appId, action),
|
const res = await this.loaderService.displayDuringP(
|
||||||
)
|
this.apiService.serviceAction(this.appId, action),
|
||||||
if (isRpcFailure(res)) {
|
)
|
||||||
const successAlert = await this.alertCtrl.create({
|
|
||||||
header: 'Execution Failed',
|
if (isRpcFailure(res)) {
|
||||||
message: `Error code ${res.error.code}. ${res.error.message}`,
|
this.presentAlertActionFail(res.error.code, res.error.message)
|
||||||
buttons: ['OK'],
|
}
|
||||||
cssClass: 'alert-error-message',
|
|
||||||
})
|
if (isRpcSuccess(res)) {
|
||||||
return await successAlert.present()
|
const successAlert = await this.alertCtrl.create({
|
||||||
}
|
header: 'Execution Complete',
|
||||||
|
message: res.result.split('\n').join('</br ></br />'),
|
||||||
if (isRpcSuccess(res)) {
|
buttons: ['OK'],
|
||||||
const successAlert = await this.alertCtrl.create({
|
cssClass: 'alert-success-message',
|
||||||
header: 'Execution Complete',
|
})
|
||||||
message: res.result,
|
return await successAlert.present()
|
||||||
buttons: ['OK'],
|
}
|
||||||
cssClass: 'alert-success-message',
|
} catch (e) {
|
||||||
})
|
this.presentAlertActionFail(500, e.message)
|
||||||
return await successAlert.present()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async presentAlertActionFail (code: number, message: string): Promise<void> {
|
||||||
|
const failureAlert = await this.alertCtrl.create({
|
||||||
|
header: 'Execution Failed',
|
||||||
|
message: `Error code ${code}. ${message}`,
|
||||||
|
buttons: ['OK'],
|
||||||
|
cssClass: 'alert-error-message',
|
||||||
|
})
|
||||||
|
return await failureAlert.present()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ export class LiveApiService extends ApiService {
|
|||||||
id: uuid.v4(),
|
id: uuid.v4(),
|
||||||
method: s.id,
|
method: s.id,
|
||||||
}
|
}
|
||||||
return this.authRequest({ method: Method.POST, url: `/apps/${appId}/actions`, data })
|
return this.authRequest({ method: Method.POST, url: `/apps/${appId}/actions`, data, readTimeout: 300000 })
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshLAN(): Promise<Unit> {
|
async refreshLAN(): Promise<Unit> {
|
||||||
|
|||||||
@@ -235,11 +235,11 @@ export class MockApiService extends ApiService {
|
|||||||
return {
|
return {
|
||||||
jsonrpc: '2.0',
|
jsonrpc: '2.0',
|
||||||
id: '0',
|
id: '0',
|
||||||
// result: 'Congrats! you did ' + action.name,
|
result: 'Congrats! you did\na new line: ' + action.name,
|
||||||
error: {
|
// error: {
|
||||||
code: 1,
|
// code: 1,
|
||||||
message: 'woooo that was bad bad bad',
|
// message: 'woooo that was bad bad bad',
|
||||||
},
|
// },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user