mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
address comments and more
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
StateInfo,
|
||||
UpdatingState,
|
||||
} from 'src/app/services/patch-db/data-model'
|
||||
import { BackupTargetType, Metrics, RR } from './api.types'
|
||||
import { BackupTargetType, RR } from './api.types'
|
||||
import { Mock } from './api.fixures'
|
||||
import {
|
||||
from,
|
||||
@@ -35,7 +35,6 @@ import {
|
||||
GetPackagesRes,
|
||||
MarketplacePkg,
|
||||
} from '@start9labs/marketplace'
|
||||
import { WebSocketSubjectConfig } from 'rxjs/webSocket'
|
||||
import markdown from 'raw-loader!../../../../../shared/assets/markdown/md-sample.md'
|
||||
|
||||
const PROGRESS: T.FullProgress = {
|
||||
@@ -84,8 +83,8 @@ export class MockApiService extends ApiService {
|
||||
|
||||
async uploadPackage(guid: string, body: Blob): Promise<string> {
|
||||
await pauseFor(2000)
|
||||
// @TODO Matt what should this return?
|
||||
return ''
|
||||
// @TODO Aiden confirm this is correct
|
||||
return 'success'
|
||||
}
|
||||
|
||||
async uploadFile(body: Blob): Promise<string> {
|
||||
@@ -258,7 +257,7 @@ export class MockApiService extends ApiService {
|
||||
|
||||
// init
|
||||
|
||||
async initGetProgress(): Promise<RR.InitGetProgressRes> {
|
||||
async initFollowProgress(): Promise<RR.InitFollowProgressRes> {
|
||||
await pauseFor(250)
|
||||
return {
|
||||
progress: PROGRESS,
|
||||
@@ -276,30 +275,6 @@ export class MockApiService extends ApiService {
|
||||
|
||||
// server
|
||||
|
||||
openLogsWebsocket$(config: WebSocketSubjectConfig<Log>): Observable<Log> {
|
||||
return interval(50).pipe(
|
||||
map((_, index) => {
|
||||
// mock fire open observer
|
||||
if (index === 0) config.openObserver?.next(new Event(''))
|
||||
if (index === 100) throw new Error('HAAHHA')
|
||||
return Mock.ServerLogs[0]
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
openMetricsWebsocket$(
|
||||
config: WebSocketSubjectConfig<Metrics>,
|
||||
): Observable<Metrics> {
|
||||
return interval(2000).pipe(
|
||||
map((_, index) => {
|
||||
// mock fire open observer
|
||||
if (index === 0) config.openObserver?.next(new Event(''))
|
||||
if (index === 4) throw new Error('HAHAHA')
|
||||
return Mock.getMetrics()
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
async getSystemTime(
|
||||
params: RR.GetSystemTimeReq,
|
||||
): Promise<RR.GetSystemTimeRes> {
|
||||
@@ -386,9 +361,9 @@ export class MockApiService extends ApiService {
|
||||
return logs
|
||||
}
|
||||
|
||||
async getServerMetrics(
|
||||
params: RR.GetServerMetricsReq,
|
||||
): Promise<RR.GetServerMetricsRes> {
|
||||
async followServerMetrics(
|
||||
params: RR.FollowServerMetricsReq,
|
||||
): Promise<RR.FollowServerMetricsRes> {
|
||||
await pauseFor(2000)
|
||||
return {
|
||||
guid: 'iqudh37um-i38u3-34-a51b-jkhd783ein',
|
||||
|
||||
Reference in New Issue
Block a user