mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
add resetTor to rpc client
This commit is contained in:
@@ -62,6 +62,12 @@ export module RR {
|
|||||||
export type SystemRebuildReq = {} // server.rebuild
|
export type SystemRebuildReq = {} // server.rebuild
|
||||||
export type SystemRebuildRes = null
|
export type SystemRebuildRes = null
|
||||||
|
|
||||||
|
export type ResetTorReq = {
|
||||||
|
'wipe-state': boolean
|
||||||
|
reason: string
|
||||||
|
} // net.tor.reset
|
||||||
|
export type ResetTorRes = null
|
||||||
|
|
||||||
// sessions
|
// sessions
|
||||||
|
|
||||||
export type GetSessionsReq = {} // sessions.list
|
export type GetSessionsReq = {} // sessions.list
|
||||||
|
|||||||
@@ -111,6 +111,8 @@ export abstract class ApiService {
|
|||||||
|
|
||||||
abstract repairDisk(params: RR.SystemRebuildReq): Promise<RR.SystemRebuildRes>
|
abstract repairDisk(params: RR.SystemRebuildReq): Promise<RR.SystemRebuildRes>
|
||||||
|
|
||||||
|
abstract resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes>
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
abstract marketplaceProxy<T>(
|
abstract marketplaceProxy<T>(
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export class LiveApiService extends ApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getTorLogs(params: RR.GetServerLogsReq): Promise<RR.GetServerLogsRes> {
|
async getTorLogs(params: RR.GetServerLogsReq): Promise<RR.GetServerLogsRes> {
|
||||||
return this.rpcRequest({ method: 'server.tor-logs', params })
|
return this.rpcRequest({ method: 'net.tor.logs', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
async followServerLogs(
|
async followServerLogs(
|
||||||
@@ -154,7 +154,7 @@ export class LiveApiService extends ApiService {
|
|||||||
async followTorLogs(
|
async followTorLogs(
|
||||||
params: RR.FollowServerLogsReq,
|
params: RR.FollowServerLogsReq,
|
||||||
): Promise<RR.FollowServerLogsRes> {
|
): Promise<RR.FollowServerLogsRes> {
|
||||||
return this.rpcRequest({ method: 'server.tor-logs.follow', params })
|
return this.rpcRequest({ method: 'net.tor.logs.follow', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
async getServerMetrics(
|
async getServerMetrics(
|
||||||
@@ -192,6 +192,10 @@ export class LiveApiService extends ApiService {
|
|||||||
return this.rpcRequest({ method: 'disk.repair', params })
|
return this.rpcRequest({ method: 'disk.repair', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes> {
|
||||||
|
return this.rpcRequest({ method: 'net.tor.reset', params })
|
||||||
|
}
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
async marketplaceProxy<T>(
|
async marketplaceProxy<T>(
|
||||||
|
|||||||
@@ -322,6 +322,11 @@ export class MockApiService extends ApiService {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async resetTor(params: RR.ResetTorReq): Promise<RR.ResetTorRes> {
|
||||||
|
await pauseFor(2000)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
// marketplace URLs
|
// marketplace URLs
|
||||||
|
|
||||||
async marketplaceProxy(
|
async marketplaceProxy(
|
||||||
|
|||||||
Reference in New Issue
Block a user