mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
38 lines
1023 B
TypeScript
38 lines
1023 B
TypeScript
import { Component } from '@angular/core'
|
|
import { ServerConfigService } from 'src/app/services/server-config.service'
|
|
import { PatchDbModel } from 'src/app/services/patch-db/patch-db.service'
|
|
import { ServerInfo } from 'src/app/services/patch-db/data-model'
|
|
import { Subscription } from 'rxjs'
|
|
|
|
@Component({
|
|
selector: 'dev-options',
|
|
templateUrl: './dev-options.page.html',
|
|
styleUrls: ['./dev-options.page.scss'],
|
|
})
|
|
export class DevOptionsPage {
|
|
server: ServerInfo = { } as any
|
|
subs: Subscription[] = []
|
|
|
|
constructor (
|
|
private readonly serverConfigService: ServerConfigService,
|
|
private readonly patch: PatchDbModel,
|
|
) { }
|
|
|
|
ngOnInit () {
|
|
this.subs = [
|
|
this.patch.watch$('server-info')
|
|
.subscribe(server => {
|
|
this.server = server
|
|
}),
|
|
]
|
|
}
|
|
|
|
ngOnDestroy () {
|
|
this.subs.forEach(sub => sub.unsubscribe())
|
|
}
|
|
|
|
async presentModalValueEdit (key: string, current?: any): Promise<void> {
|
|
await this.serverConfigService.presentModalValueEdit(key, current)
|
|
}
|
|
}
|