Skip to content

Commit

Permalink
taskmanager v0.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Oct 30, 2023
1 parent bc8cbec commit 3800f01
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class AppComponent implements OnDestroy, AfterViewInit {
//appname
private apps: {type: Type<BaseComponent>}[] =[
{type: FileexplorerComponent},
{type: TaskmanagerComponent},
{type: TaskmanagerMiniComponent},
{type: TitleComponent},
{type: GreetingComponent},
Expand Down
2 changes: 1 addition & 1 deletion src/app/system-apps/taskmanager/taskmanager.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<span class="basediv">
<span style="display: inline-block; width: 50%;
padding-top:15px; height:50px; margin-left: 0;">
<figure style="padding-right: 65%;">
<figure (click)="onFewerDetailsBtnClick()" style="padding-right: 65%;">
<img [src]="'osdrive/icons/arrow_up.png'">
<figcaption>Fewer details</figcaption>
</figure>
Expand Down
26 changes: 25 additions & 1 deletion src/app/system-apps/taskmanager/taskmanager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { BaseComponent } from 'src/app/system-base/base/base.component';
import { ComponentType } from 'src/app/system-files/component.types';
import { Process } from 'src/app/system-files/process';
import { SortingInterface } from './sorting.interface';
import { StateManagmentService } from 'src/app/shared/system-service/state.management.service';
import { FileInfo } from 'src/app/system-files/fileinfo';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';

@Component({
selector: 'cos-taskmanager',
Expand All @@ -22,6 +25,9 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte

private _processIdService:ProcessIDService;
private _runningProcessService:RunningProcessService;
private _stateManagmentService: StateManagmentService;
private _triggerProcessService:TriggerProcessService;

private _processListChangeSub!: Subscription;
private _taskmgrTimerSubscription!: Subscription;
private _currentSortingOrder!:any;
Expand Down Expand Up @@ -51,9 +57,12 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte
diskUtil = 0;
networkUtil = 0;

constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService) {
constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService,stateManagmentService: StateManagmentService,triggerProcessService:TriggerProcessService) {
this._processIdService = processIdService;
this._runningProcessService = runningProcessService;
this._stateManagmentService = stateManagmentService;
this._triggerProcessService = triggerProcessService;

this.processId = this._processIdService.getNewProcessId()
this._runningProcessService.addProcess(this.getComponentDetail());
this._processListChangeSub = this._runningProcessService.processListChangeNotify.subscribe(() =>{this.updateRunningProcess();})
Expand Down Expand Up @@ -258,6 +267,21 @@ export class TaskmanagerComponent implements BaseComponent,OnInit,OnDestroy,Afte
return groupedData;
}


onFewerDetailsBtnClick():void{
const file:FileInfo = new FileInfo();
file.setIcon = '/osdrive/icons/taskmanger.png';
file.setOpensWith = 'taskmanagermini';
file.setFileType ='.png';

const processToClose = this._runningProcessService.getProcess(this.processId);
this._stateManagmentService.removeState(this.processId);
this._triggerProcessService.startApplication(file);

this._runningProcessService.closeProcessNotify.next(processToClose);
}


setUtilColoumnColors(cellValue:number){
let baseStyle: Record<string, unknown> = {};
if(cellValue <= 2.5){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<span class="basediv">
<span style="display: inline-block; width: 50%;
padding-top:15px; height:50px; margin-left: 0;">
<figure style="padding-right: 45%;">
<figure (click)="onMoreDetailsBtnClick()" style="padding-right: 45%;">
<img [src]="'osdrive/icons/arrow_down.png'">
<figcaption>More details</figcaption>
</figure>
Expand Down
24 changes: 23 additions & 1 deletion src/app/system-apps/taskmanager/taskmanager.mini.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { Component, OnInit,OnDestroy} from '@angular/core';
import { Subscription } from 'rxjs';
import { ProcessIDService } from 'src/app/shared/system-service/process.id.service';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { StateManagmentService } from 'src/app/shared/system-service/state.management.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
import { BaseComponent } from 'src/app/system-base/base/base.component';
import { ComponentType } from 'src/app/system-files/component.types';
import { FileInfo } from 'src/app/system-files/fileinfo';
import { Process } from 'src/app/system-files/process';

@Component({
Expand All @@ -15,6 +18,9 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy

private _processIdService:ProcessIDService;
private _runningProcessService:RunningProcessService;
private _stateManagmentService: StateManagmentService;
private _triggerProcessService:TriggerProcessService;

private _processListChangeSub!: Subscription;

processes:Process[] =[];
Expand All @@ -27,9 +33,12 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy
displayName = 'Task Manager';


constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService) {
constructor( processIdService:ProcessIDService,runningProcessService:RunningProcessService,stateManagmentService: StateManagmentService,triggerProcessService:TriggerProcessService) {
this._processIdService = processIdService;
this._runningProcessService = runningProcessService;
this._stateManagmentService = stateManagmentService;
this._triggerProcessService = triggerProcessService;

this.processId = this._processIdService.getNewProcessId()
this._runningProcessService.addProcess(this.getComponentDetail());
this._processListChangeSub = this._runningProcessService.processListChangeNotify.subscribe(() =>{this.updateRunningProcess();})
Expand All @@ -44,6 +53,19 @@ export class TaskmanagerMiniComponent implements BaseComponent,OnInit,OnDestroy
this._processListChangeSub?.unsubscribe();
}

onMoreDetailsBtnClick():void{
const file:FileInfo = new FileInfo();
file.setIcon = '/osdrive/icons/taskmanger.png';
file.setOpensWith = 'taskmanager';
file.setFileType ='.png';

const processToClose = this._runningProcessService.getProcess(this.processId);
this._stateManagmentService.removeState(this.processId);
this._triggerProcessService.startApplication(file);

this._runningProcessService.closeProcessNotify.next(processToClose);
}

setTaskMangrMiniWindowToFocus(pid: number):void {
this._runningProcessService.focusOnCurrentProcessNotify.next(pid);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/system-files/app.directory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AppDirectory {
}

private fetchSystemApp(): string[]{
this._systemProcessList = ['fileexplorer','taskmanager'];
this._systemProcessList = ['fileexplorer','taskmanager','taskmanagermini'];
return this._systemProcessList;
}

Expand Down
10 changes: 5 additions & 5 deletions src/osdrive/desktop/fileexplorer.url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[InternetShortcut]
FileName=Task Manager
IconFile=/osdrive/icons/taskmanger.png
FileType=.png
ShortUrl=Task Manager
OpensWith=taskmanager
FileName=File Explorer
IconFile=/osdrive/icons/file_explorer.ico
FileType=folder
ShortUrl=File Explorer
OpensWith=fileexplorer
10 changes: 5 additions & 5 deletions src/osdrive/desktop/taskmanager.url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconFile=/osdrive/icons/file_explorer.ico
FileType=folder
ShortUrl=File Explorer
OpensWith=fileexplorer
FileName=Task Manager
IconFile=/osdrive/icons/taskmanger.png
FileType=.png
ShortUrl=Task Manager
OpensWith=taskmanager

0 comments on commit 3800f01

Please sign in to comment.