mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
logs for server as well
This commit is contained in:
committed by
Aiden McClelland
parent
0adead0298
commit
3d5ac47a82
@@ -793,6 +793,114 @@ export module Mock {
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:20:30.872Z',
|
||||
log: '****** START *****',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:21:30.872Z',
|
||||
log: 'ServerLogs ServerLogs ServerLogs ServerLogs ServerLogs',
|
||||
},
|
||||
{
|
||||
timestamp: '2019-12-26T14:22:30.872Z',
|
||||
log: '****** FINISH *****',
|
||||
},
|
||||
]
|
||||
|
||||
export const PackageLogs: RR.GetPackageLogsRes = [
|
||||
|
||||
@@ -27,7 +27,7 @@ export module RR {
|
||||
export type SetShareStatsReq = WithExpire<{ value: any }> // server.config.share-stats
|
||||
export type SetShareStatsRes = WithRevision<null>
|
||||
|
||||
export type GetServerLogsReq = { before?: string } // server.logs
|
||||
export type GetServerLogsReq = { before?: string, limit: number, page: number } // server.logs
|
||||
export type GetServerLogsRes = Log[]
|
||||
|
||||
export type GetServerMetricsReq = { } // server.metrics
|
||||
@@ -137,7 +137,7 @@ export module RR {
|
||||
export type GetPackagePropertiesReq = { id: string } // package.properties
|
||||
export type GetPackagePropertiesRes<T extends number> = PackagePropertiesVersioned<T>
|
||||
|
||||
export type GetPackageLogsReq = { page: number, pageLength: number, id: string, before?: string } // package.logs
|
||||
export type GetPackageLogsReq = { page: number, limit: number, id: string, before?: string } // package.logs
|
||||
export type GetPackageLogsRes = Log[]
|
||||
|
||||
export type GetPackageMetricsReq = { id: string } // package.metrics
|
||||
|
||||
@@ -75,7 +75,10 @@ export class MockApiService extends ApiService {
|
||||
|
||||
async getServerLogs (params: RR.GetServerLogsReq): Promise<RR.GetServerLogsRes> {
|
||||
await pauseFor(2000)
|
||||
return Mock.ServerLogs
|
||||
if (params.page === 4) {
|
||||
return (Mock.ServerLogs as []).slice(0, params.limit - 3)
|
||||
}
|
||||
return Mock.ServerLogs.slice(0, params.limit)
|
||||
}
|
||||
|
||||
async getServerMetrics (params: RR.GetServerMetricsReq): Promise<RR.GetServerMetricsRes> {
|
||||
@@ -311,9 +314,9 @@ export class MockApiService extends ApiService {
|
||||
async getPackageLogs (params: RR.GetPackageLogsReq): Promise<RR.GetPackageLogsRes> {
|
||||
await pauseFor(2000)
|
||||
if (params.page === 4) {
|
||||
return (Mock.PackageLogs as []).slice(0, 2)
|
||||
return (Mock.PackageLogs as []).slice(0, params.limit - 5)
|
||||
}
|
||||
return Mock.PackageLogs.slice(0, params.pageLength)
|
||||
return Mock.PackageLogs.slice(0, params.limit)
|
||||
}
|
||||
|
||||
async installPackageRaw (params: RR.InstallPackageReq): Promise<RR.InstallPackageRes> {
|
||||
|
||||
Reference in New Issue
Block a user