mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
fix bugs with config and clean up dev options (#1558)
* fix bugs with config and clean up dev options * dont down down arrow in logs prematurely * change config error border to match error text red color * change restart button color * fix error when sideloading and update copy * adds back in param cloning as this bug creeped up again * make restarting text match button color * fix version comparision for updates category Co-authored-by: Matt Hill <matthill@Matt-M1.local> Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com>
This commit is contained in:
@@ -33,13 +33,6 @@ export class AppShowPage {
|
||||
private readonly pkgId = getPkgId(this.route)
|
||||
|
||||
readonly pkg$ = this.patch.watch$('package-data', this.pkgId).pipe(
|
||||
filter(
|
||||
(p: PackageDataEntry) =>
|
||||
!(
|
||||
p.installed?.status.main.status === PackageMainStatus.Starting &&
|
||||
p.installed?.status.main.restarting
|
||||
),
|
||||
),
|
||||
map(pkg => {
|
||||
// if package disappears, navigate to list page
|
||||
if (!pkg) {
|
||||
@@ -49,6 +42,15 @@ export class AppShowPage {
|
||||
return { ...pkg }
|
||||
}),
|
||||
startWith(this.patch.getData()['package-data'][this.pkgId]),
|
||||
filter(
|
||||
(p: PackageDataEntry | undefined) =>
|
||||
// will be undefined when sideloading
|
||||
p !== undefined &&
|
||||
!(
|
||||
p.installed?.status.main.status === PackageMainStatus.Starting &&
|
||||
p.installed?.status.main.restarting
|
||||
),
|
||||
),
|
||||
)
|
||||
|
||||
readonly connectionFailure$ = this.connectionService
|
||||
@@ -60,7 +62,7 @@ export class AppShowPage {
|
||||
private readonly navCtrl: NavController,
|
||||
private readonly patch: PatchDbService,
|
||||
private readonly connectionService: ConnectionService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
isInstalled(
|
||||
{ state }: PackageDataEntry,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</ion-button>
|
||||
<ion-button
|
||||
class="action-button"
|
||||
color="warning"
|
||||
color="tertiary"
|
||||
(click)="tryRestart()"
|
||||
>
|
||||
<ion-icon slot="start" name="refresh"></ion-icon>
|
||||
|
||||
@@ -11,7 +11,11 @@
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-item button (click)="openBasicInfoModal()">
|
||||
<ion-item
|
||||
*ngIf="projectData$ | async as projectData"
|
||||
button
|
||||
(click)="openBasicInfoModal(projectData)"
|
||||
>
|
||||
<ion-icon slot="start" name="information-circle-outline"></ion-icon>
|
||||
<ion-label>
|
||||
<h2>Basic Info</h2>
|
||||
|
||||
@@ -6,10 +6,8 @@ import { BasicInfo, getBasicInfoSpec } from './form-info'
|
||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||
import { ErrorToastService, DestroyService } from '@start9labs/shared'
|
||||
import { takeUntil } from 'rxjs/operators'
|
||||
import { DevProjectData } from 'src/app/services/patch-db/data-model'
|
||||
import { getProjectId } from 'src/app/util/get-project-id'
|
||||
import * as yaml from 'js-yaml'
|
||||
import { DevProjectData } from 'src/app/services/patch-db/data-model'
|
||||
|
||||
@Component({
|
||||
selector: 'developer-menu',
|
||||
@@ -19,7 +17,7 @@ import * as yaml from 'js-yaml'
|
||||
})
|
||||
export class DeveloperMenuPage {
|
||||
readonly projectId = getProjectId(this.route)
|
||||
projectData: DevProjectData
|
||||
projectData$ = this.patch.watch$('ui', 'dev', this.projectId)
|
||||
|
||||
constructor(
|
||||
private readonly route: ActivatedRoute,
|
||||
@@ -27,29 +25,19 @@ export class DeveloperMenuPage {
|
||||
private readonly loadingCtrl: LoadingController,
|
||||
private readonly api: ApiService,
|
||||
private readonly errToast: ErrorToastService,
|
||||
private readonly destroy$: DestroyService,
|
||||
private readonly patchDb: PatchDbService,
|
||||
) {}
|
||||
private readonly patch: PatchDbService,
|
||||
) { }
|
||||
|
||||
get name(): string {
|
||||
return this.patchDb.getData().ui?.dev?.[this.projectId]?.name || ''
|
||||
return this.patch.getData().ui?.dev?.[this.projectId]?.name || ''
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.patchDb
|
||||
.watch$('ui', 'dev', this.projectId)
|
||||
.pipe(takeUntil(this.destroy$))
|
||||
.subscribe(pd => {
|
||||
this.projectData = pd
|
||||
})
|
||||
}
|
||||
|
||||
async openBasicInfoModal() {
|
||||
async openBasicInfoModal(data: DevProjectData) {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: GenericFormPage,
|
||||
componentProps: {
|
||||
title: 'Basic Info',
|
||||
spec: getBasicInfoSpec(this.projectData),
|
||||
spec: getBasicInfoSpec(data),
|
||||
buttons: [
|
||||
{
|
||||
text: 'Save',
|
||||
|
||||
@@ -44,7 +44,7 @@ export function getBasicInfoSpec(devData: DevProjectData): ConfigSpec {
|
||||
},
|
||||
'service-version-number': {
|
||||
type: 'string',
|
||||
name: 'Service Version Number',
|
||||
name: 'Service Version',
|
||||
description:
|
||||
'Service version - accepts up to four digits, where the last confirms to revisions necessary for EmbassyOS - see documentation: https://github.com/Start9Labs/emver-rs. This value will change with each release of the service',
|
||||
placeholder: 'e.g. 0.1.2.3',
|
||||
|
||||
@@ -327,8 +327,8 @@ export class ServerShowPage {
|
||||
disabled: of(false),
|
||||
},
|
||||
{
|
||||
title: 'Manually Install A Service',
|
||||
description: `Install a service by drag and drop`,
|
||||
title: 'Sideload Service',
|
||||
description: `Manually install any service package`,
|
||||
icon: 'push-outline',
|
||||
action: () =>
|
||||
this.navCtrl.navigateForward(['sideload'], {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="embassy"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Manually Install A Service</ion-title>
|
||||
<ion-title>Sideload Service</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
color="dark"
|
||||
style="font-size: 42px"
|
||||
></ion-icon>
|
||||
<h4>To install a service manually, upload the s9pk here</h4>
|
||||
<h4>Manually upload a service package</h4>
|
||||
<p *ngIf="onTor">
|
||||
<ion-text color="success"
|
||||
>Tip: switch to LAN for faster uploads.</ion-text
|
||||
|
||||
Reference in New Issue
Block a user