mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
chore: comments (#2863)
This commit is contained in:
@@ -27,10 +27,12 @@ export class BadgeService {
|
||||
private readonly notifications = inject(NotificationService)
|
||||
private readonly exver = inject(Exver)
|
||||
private readonly patch = inject<PatchDB<DataModel>>(PatchDB)
|
||||
private readonly system$ = combineLatest([
|
||||
this.patch.watch$('serverInfo', 'ntpSynced'),
|
||||
inject(EOSService).updateAvailable$,
|
||||
]).pipe(map(([synced, update]) => Number(!synced) + Number(update)))
|
||||
private readonly system$ = inject(EOSService).updateAvailable$.pipe(
|
||||
map(Number),
|
||||
)
|
||||
private readonly metrics$ = this.patch
|
||||
.watch$('serverInfo', 'ntpSynced')
|
||||
.pipe(map(synced => Number(!synced)))
|
||||
private readonly marketplaceService = inject(MarketplaceService)
|
||||
|
||||
private readonly local$ = inject(ConnectionService).pipe(
|
||||
@@ -86,6 +88,8 @@ export class BadgeService {
|
||||
return this.updates$
|
||||
case '/portal/system':
|
||||
return this.system$
|
||||
case '/portal/metrics':
|
||||
return this.metrics$
|
||||
case '/portal/notifications':
|
||||
return this.notifications.unreadCount$
|
||||
default:
|
||||
|
||||
@@ -2,7 +2,7 @@ import { inject, Injectable } from '@angular/core'
|
||||
import { ErrorService, MARKDOWN } from '@start9labs/shared'
|
||||
import { TuiDialogService } from '@taiga-ui/core'
|
||||
import { PatchDB } from 'patch-db-client'
|
||||
import { firstValueFrom, merge, shareReplay, Subject } from 'rxjs'
|
||||
import { firstValueFrom, merge, of, shareReplay, Subject } from 'rxjs'
|
||||
import { REPORT } from 'src/app/components/report.component'
|
||||
import {
|
||||
ServerNotification,
|
||||
@@ -94,13 +94,14 @@ export class NotificationService {
|
||||
full = false,
|
||||
) {
|
||||
const label = full || code === 2 ? title : 'Backup Report'
|
||||
const content = code === 1 ? REPORT : MARKDOWN
|
||||
const component = code === 1 ? REPORT : MARKDOWN
|
||||
const content = code === 1 ? data : of(data)
|
||||
|
||||
this.dialogs
|
||||
.open(full ? message : content, {
|
||||
.open(full ? message : component, {
|
||||
label,
|
||||
data: {
|
||||
content: data,
|
||||
content,
|
||||
timestamp: createdAt,
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user