feat: add service uptime and start style changes (#2831)

This commit is contained in:
Alex Inkin
2025-02-14 22:32:30 +04:00
committed by GitHub
parent ce2842d365
commit 1b006599cf
167 changed files with 448 additions and 629 deletions

View File

@@ -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'

View File

@@ -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

View File

@@ -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[] = [
{

View File

@@ -56,7 +56,7 @@ export class ProxyService {
buttons: [
{
text: 'Manage proxies',
link: '/portal/system/settings/proxies',
link: '/portal/settings/proxies',
},
{
text: 'Save',

View File

@@ -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)
}
}