mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
feat: add service uptime and start style changes (#2831)
This commit is contained in:
@@ -7,8 +7,8 @@ import { filter } from 'rxjs'
|
||||
import {
|
||||
ActionInputModal,
|
||||
PackageActionData,
|
||||
} from 'src/app/routes/portal/routes/service/modals/action-input.component'
|
||||
import { ActionSuccessPage } from 'src/app/routes/portal/routes/service/modals/action-success/action-success.page'
|
||||
} from 'src/app/routes/portal/routes/services/modals/action-input.component'
|
||||
import { ActionSuccessPage } from 'src/app/routes/portal/routes/services/modals/action-success/action-success.page'
|
||||
import { ApiService } from 'src/app/services/api/embassy-api.service'
|
||||
import { FormDialogService } from 'src/app/services/form-dialog.service'
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@ export class BadgeService {
|
||||
|
||||
getCount(id: string): Observable<number> {
|
||||
switch (id) {
|
||||
// case '/portal/system/updates':
|
||||
// case '/portal/updates':
|
||||
// return this.updates$
|
||||
case '/portal/system/settings':
|
||||
case '/portal/settings':
|
||||
return this.settings$
|
||||
case '/portal/system/notifications':
|
||||
case '/portal/notifications':
|
||||
return this.notifications.unreadCount$
|
||||
default:
|
||||
return EMPTY
|
||||
|
||||
@@ -41,9 +41,9 @@ function toBreadcrumbs(
|
||||
id: string,
|
||||
packages: Record<string, PackageDataEntry> = {},
|
||||
): Breadcrumb[] {
|
||||
if (id.startsWith('/portal/system/')) {
|
||||
const [page, ...path] = id.replace('/portal/system/', '').split('/')
|
||||
const service = `/portal/system/${page}`
|
||||
if (id.startsWith('/portal/') && !id.startsWith('/portal/services/')) {
|
||||
const [page, ...path] = id.replace('/portal/', '').split('/')
|
||||
const service = `/portal/${page}`
|
||||
const { icon, title } = SYSTEM_UTILITIES[service]
|
||||
const breadcrumbs: Breadcrumb[] = [
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ export class ProxyService {
|
||||
buttons: [
|
||||
{
|
||||
text: 'Manage proxies',
|
||||
link: '/portal/system/settings/proxies',
|
||||
link: '/portal/settings/proxies',
|
||||
},
|
||||
{
|
||||
text: 'Save',
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
import { WA_WINDOW } from '@ng-web-apis/common'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import { filter, take, BehaviorSubject } from 'rxjs'
|
||||
import { ApiService } from './api/embassy-api.service'
|
||||
import { DataModel } from './patch-db/data-model'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ThemeSwitcherService extends BehaviorSubject<string> {
|
||||
constructor(
|
||||
private readonly patch: PatchDB<DataModel>,
|
||||
private readonly embassyApi: ApiService,
|
||||
@Inject(WA_WINDOW) private readonly windowRef: Window,
|
||||
) {
|
||||
super('Dark')
|
||||
|
||||
this.patch
|
||||
.watch$('ui', 'theme')
|
||||
.pipe(take(1), filter(Boolean))
|
||||
.subscribe(theme => {
|
||||
this.updateTheme(theme)
|
||||
})
|
||||
}
|
||||
|
||||
override next(theme: string): void {
|
||||
this.embassyApi.setDbValue(['theme'], theme)
|
||||
this.updateTheme(theme)
|
||||
}
|
||||
|
||||
private updateTheme(theme: string): void {
|
||||
this.windowRef.document.body.setAttribute('data-theme', theme)
|
||||
super.next(theme)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user