Skip to content

Commit

Permalink
feat(process-explorer/frontend): Add mock subsystems
Browse files Browse the repository at this point in the history
  • Loading branch information
kruplm committed Oct 12, 2023
1 parent 2ee9b28 commit 299904e
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
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[]
}
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


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();
});
});
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]);
}
}

0 comments on commit 299904e

Please sign in to comment.