-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(process-explorer/frontend): Add mock subsystems
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
prototypes/process-explorer/oss-frontend/src/app/DTOs/SubsystemInfo.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ | ||
export interface SubsystemInfo{ | ||
ProcessName: string; | ||
PID: number; | ||
ProcessStatus: string; | ||
StartTime: string; | ||
ProcessorUsage: string; | ||
PriorityLevel: number; | ||
VirtualMemorySize: number | ||
} | ||
|
||
export interface SubsystemTable extends SubsystemInfo { | ||
Children : SubsystemInfo[] | ||
} |
40 changes: 40 additions & 0 deletions
40
...ypes/process-explorer/oss-frontend/src/app/services/subsystems-service/mock-subsystems.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ | ||
// tslint:disable | ||
export const MockSubSystems:{ [key: string]: any[] } = { | ||
'Subsystems': [ | ||
{ | ||
"Name": "ChartWeb", | ||
"Id": "chart-web", | ||
"State": "Started", | ||
"ModuleType": "web" | ||
}, { | ||
"Name": "ChartWpf", | ||
"Id": "chart-wpf", | ||
"State": "Starting", | ||
"ModuleType": "native" | ||
}, { | ||
"Name": "Google Chrome", | ||
"Id": "chrome.exe", | ||
"State": "Started", | ||
"ModuleType": "native" | ||
},{ | ||
"Name": "GridWeb", | ||
"Id": "grid-web", | ||
"State": "Stopping", | ||
"ModuleType": "web", | ||
},{ | ||
"Name": "GridWpf", | ||
"Id": "grid-wpf", | ||
"State": "Stopped", | ||
"ModuleType": "native", | ||
},{ | ||
"Name": "Symphony", | ||
"Id": "symphony.exe", | ||
"State": "Started", | ||
"ModuleType": "native" | ||
} | ||
] | ||
}; | ||
// tslint:disable | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
...cess-explorer/oss-frontend/src/app/services/subsystems-service/subsystems.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { SubsystemsService } from './subsystems.service'; | ||
|
||
describe('ProcessesService', () => { | ||
let service: SubsystemsService; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({}); | ||
service = TestBed.inject(SubsystemsService); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
...s/process-explorer/oss-frontend/src/app/services/subsystems-service/subsystems.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ | ||
import { Injectable } from '@angular/core'; | ||
import { Observable, of } from 'rxjs'; | ||
import { MockSubSystems } from './mock-subsystems'; | ||
import { SubsystemTable } from '../../DTOs/SubsystemInfo'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class SubsystemsService { | ||
public getSubsystems(tableName: string): Observable<SubsystemTable[]> { | ||
return of(MockSubSystems[tableName]); | ||
} | ||
} |