mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
drives page
This commit is contained in:
committed by
Aiden McClelland
parent
31318687bf
commit
0cd2a32b24
@@ -57,6 +57,7 @@ export abstract class ApiService {
|
||||
abstract deleteWifi (ssid: string): Promise<Unit>
|
||||
abstract restartServer (): Promise<Unit>
|
||||
abstract shutdownServer (): Promise<Unit>
|
||||
abstract ejectExternalDisk (logicalName: string): Promise<Unit>
|
||||
}
|
||||
|
||||
export module ReqRes {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { HttpErrorResponse } from '@angular/common/http'
|
||||
import { isUnauthorized } from 'src/app/util/web.util'
|
||||
import { Replace } from 'src/app/util/types.util'
|
||||
import { AppMetrics, parseMetricsPermissive } from 'src/app/util/metrics.util'
|
||||
import { modulateTime } from 'src/app/util/misc.util'
|
||||
// import { modulateTime } from 'src/app/util/misc.util'
|
||||
|
||||
@Injectable()
|
||||
export class LiveApiService extends ApiService {
|
||||
@@ -61,6 +61,10 @@ export class LiveApiService extends ApiService {
|
||||
return this.authRequest<ReqRes.GetExternalDisksRes>({ method: Method.GET, url: `/disks` })
|
||||
}
|
||||
|
||||
async ejectExternalDisk (logicalName: string): Promise<Unit> {
|
||||
return this.authRequest({ method: Method.DELETE, url: `/disks/${logicalName}` })
|
||||
}
|
||||
|
||||
async updateAgent (version: string): Promise<Unit> {
|
||||
const data: ReqRes.PostUpdateAgentReq = {
|
||||
version: `=${version}`,
|
||||
|
||||
@@ -29,13 +29,17 @@ export class MockApiService extends ApiService {
|
||||
async postConfigureDependency (dependencyId: string, dependentId: string, dryRun?: boolean): Promise<{ config: object, breakages: DependentBreakage[] }> {
|
||||
await pauseFor(2000)
|
||||
throw new Error ('some misc backend error ohh we forgot to make this endpoint or something')
|
||||
// return { config: mockCupsDependentConfig, breakages: [ ] }
|
||||
}
|
||||
|
||||
async getServer (): Promise<ApiServer> {
|
||||
return mockGetServer()
|
||||
}
|
||||
|
||||
async ejectExternalDisk (): Promise<Unit> {
|
||||
await pauseFor(2000)
|
||||
return { }
|
||||
}
|
||||
|
||||
async getCheckAuth (): Promise<ReqRes.GetCheckAuthRes> {
|
||||
return { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user