-
-
- - This PC
-
- - Water
- - Coffee
- - Tea
-
- - Black Tea
- - White Tea
- - Green Tea
-
- - Sencha
- - Gyokuro
- - Matcha
- - Pi Lo Chun
-
-
-
-
-
-
-
+
diff --git a/src/app/system-apps/fileexplorer/fileexplorer.component.ts b/src/app/system-apps/fileexplorer/fileexplorer.component.ts
index 74eab223..eb77f385 100644
--- a/src/app/system-apps/fileexplorer/fileexplorer.component.ts
+++ b/src/app/system-apps/fileexplorer/fileexplorer.component.ts
@@ -4,8 +4,8 @@ import { ProcessIDService } from 'src/app/shared/system-service/process.id.servi
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { ComponentType } from 'src/app/system-files/component.types';
import { Process } from 'src/app/system-files/process';
-import { FileEntry } from 'src/app/system-files/fileentry';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileEntry } from 'src/app/system-files/file.entry';
+import { FileInfo } from 'src/app/system-files/file.info';
import { BaseComponent } from 'src/app/system-base/base/base.component';
import { Subscription } from 'rxjs';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
@@ -23,6 +23,7 @@ import * as htmlToImage from 'html-to-image';
import { TaskBarPreviewImage } from '../taskbarpreview/taskbar.preview';
import { MenuService } from 'src/app/shared/system-service/menu.services';
import { SortBys } from '../desktop/desktop.enums';
+import { FileTreeNode } from 'src/app/system-files/file.tree.node';
@Component({
selector: 'cos-fileexplorer',
@@ -101,7 +102,8 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
olClassName = 'ol-icon-size-view';
files:FileInfo[] = [];
- _fileInfo!:FileInfo;
+ fileTreeNode:FileTreeNode[] = [];
+ _fileInfo!:FileInfo;
prevPathEntries:string[] = [];
nextPathEntries:string[] = [];
recentPathEntries:string[] = [];
@@ -248,6 +250,7 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
pathInput: (this.directory !== '/')? this.directory : '/'
})
+ await this.loadFileTreeAsync();
await this.loadFilesInfoAsync().then(()=>{
setTimeout(()=>{
this.captureComponentImg();
@@ -681,6 +684,106 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
}
}
+ private async loadFileTreeAsync():Promise{
+ this.fileTreeNode = [];
+ this._fileService.resetDirectoryFiles();
+ const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory);
+
+ for(const dirEntry of directoryEntries){
+ const isFile = await this._fileService.checkIfDirectory(this.directory + dirEntry);
+ const ftn:FileTreeNode = {
+ name : dirEntry,
+ isFile: isFile,
+ children: []
+ }
+
+ console.log('ftn:', ftn);
+ this.fileTreeNode.push(ftn);
+ }
+ }
+
+ private async updateFileTreeAsync(path:string):Promise{
+
+ //const tmpFileTreeNode:FileTreeNode = [];
+ this._fileService.resetDirectoryFiles();
+ const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory + path);
+
+ for(const dirEntry of directoryEntries){
+
+ const isFile = await this._fileService.checkIfDirectory(this.directory + + dirEntry);
+ const ftn:FileTreeNode = {
+ name : dirEntry,
+ isFile: isFile,
+ children: []
+ }
+
+ }
+ }
+
+ public addChildrenToNode(treeData: FileTreeNode[], nodeName: string, newChildren: FileTreeNode[] ): FileTreeNode[] {
+
+ // Create a new array for the updated treeData
+ const updatedTreeData: FileTreeNode[] = [];
+
+ for (let i = 0; i < treeData.length; i++) {
+ const node = treeData[i];
+ const updatedNode: FileTreeNode = {
+ name: node.name,
+ isFile: node.isFile,
+ children: node.children || []
+ };
+
+ // If the current node matches the nodeName, add the new children
+ if (node.name === nodeName) {
+ for(const child of newChildren){
+ updatedNode.children.push(child)
+ }
+ }
+
+ // If the node has children, recursively call this function on the children
+ if (node.children) {
+ updatedNode.children = this.addChildrenToNode(node.children, nodeName, newChildren);
+ }
+
+ // Add the updated node to the new treeData array
+ updatedTreeData.push(updatedNode);
+ }
+
+ return updatedTreeData;
+ }
+
+ // public addChildrenToNode(treeData: FileTreeNode[], nodeName: string, newChildren: string[] ): FileTreeNode[] {
+
+ // // Create a new array for the updated treeData
+ // const updatedTreeData: FileTreeNode[] = [];
+
+ // for (let i = 0; i < treeData.length; i++) {
+ // const node = treeData[i];
+ // const updatedNode: FileTreeNode = {
+ // name: node.name,
+ // isFile: node.isFile,
+ // children: node.children ? [] : undefined
+ // };
+
+ // // If the current node matches the nodeName, add the new children
+ // if (node.name === nodeName) {
+ // updatedNode.children = (node.children || []).concat(
+ // newChildren.map(childName => ({ name: childName, isFile: node.isFile}))
+ // );
+ // }
+
+ // // If the node has children, recursively call this function on the children
+ // if (node.children) {
+ // updatedNode.children = this.addChildrenToNode(node.children, nodeName, newChildren);
+ // }
+
+ // // Add the updated node to the new treeData array
+ // updatedTreeData.push(updatedNode);
+ // }
+
+ // return updatedTreeData;
+ // }
+
async runProcess(file:FileInfo):Promise{
console.log('fileexplorer-runProcess:',file)
diff --git a/src/app/system-apps/filemanager/filemanager.component.ts b/src/app/system-apps/filemanager/filemanager.component.ts
index 0409c5ac..f0dc77bf 100644
--- a/src/app/system-apps/filemanager/filemanager.component.ts
+++ b/src/app/system-apps/filemanager/filemanager.component.ts
@@ -5,8 +5,8 @@ import { RunningProcessService } from 'src/app/shared/system-service/running.pro
import { ComponentType } from 'src/app/system-files/component.types';
import { BaseComponent } from 'src/app/system-base/base/base.component';
import { Process } from 'src/app/system-files/process';
-import { FileEntry } from 'src/app/system-files/fileentry';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileEntry } from 'src/app/system-files/file.entry';
+import { FileInfo } from 'src/app/system-files/file.info';
import { Subscription } from 'rxjs';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
import { FileManagerService } from 'src/app/shared/system-service/file.manager.services';
diff --git a/src/app/system-apps/photoviewer/photoviewer.component.ts b/src/app/system-apps/photoviewer/photoviewer.component.ts
index 829292ad..4e0b82a8 100644
--- a/src/app/system-apps/photoviewer/photoviewer.component.ts
+++ b/src/app/system-apps/photoviewer/photoviewer.component.ts
@@ -7,7 +7,7 @@ import { ProcessIDService } from 'src/app/shared/system-service/process.id.servi
import { Process } from 'src/app/system-files/process';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { AppState, BaseState } from 'src/app/system-files/state/state.interface';
import { StateType } from 'src/app/system-files/state/state.type';
import { StateManagmentService } from 'src/app/shared/system-service/state.management.service';
diff --git a/src/app/system-apps/taskbarentries/taskbarentries.component.ts b/src/app/system-apps/taskbarentries/taskbarentries.component.ts
index ba961413..3f5b9f99 100644
--- a/src/app/system-apps/taskbarentries/taskbarentries.component.ts
+++ b/src/app/system-apps/taskbarentries/taskbarentries.component.ts
@@ -5,7 +5,7 @@ import { ProcessIDService } from 'src/app/shared/system-service/process.id.servi
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
import { ComponentType } from 'src/app/system-files/component.types';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { Process } from 'src/app/system-files/process';
@Component({
diff --git a/src/app/system-apps/taskbarpreview/taskbarpreview.component.html b/src/app/system-apps/taskbarpreview/taskbarpreview.component.html
index 8411b93d..fd8b29ec 100644
--- a/src/app/system-apps/taskbarpreview/taskbarpreview.component.html
+++ b/src/app/system-apps/taskbarpreview/taskbarpreview.component.html
@@ -19,7 +19,7 @@
+
diff --git a/src/app/system-apps/taskbarpreview/taskbarpreview.component.ts b/src/app/system-apps/taskbarpreview/taskbarpreview.component.ts
index 33723e6e..fdd55ec9 100644
--- a/src/app/system-apps/taskbarpreview/taskbarpreview.component.ts
+++ b/src/app/system-apps/taskbarpreview/taskbarpreview.component.ts
@@ -85,4 +85,8 @@ export class TaskBarPreviewComponent implements OnChanges, AfterViewInit {
this._runningProcessService.restoreProcessWindowNotify.next(pid);
}
+ showWindow(pid:number):void{
+ this._runningProcessService.restoreProcessWindowNotify.next(pid);
+ }
+
}
diff --git a/src/app/system-apps/taskmanager/taskmanager.mini.component.ts b/src/app/system-apps/taskmanager/taskmanager.mini.component.ts
index c4f701f4..4688a76d 100644
--- a/src/app/system-apps/taskmanager/taskmanager.mini.component.ts
+++ b/src/app/system-apps/taskmanager/taskmanager.mini.component.ts
@@ -6,7 +6,7 @@ import { StateManagmentService } from 'src/app/shared/system-service/state.manag
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 { FileInfo } from 'src/app/system-files/file.info';
import { Process } from 'src/app/system-files/process';
@Component({
diff --git a/src/app/system-apps/terminal/terminal.commands.ts b/src/app/system-apps/terminal/terminal.commands.ts
index 77c10fb5..71b4d65e 100644
--- a/src/app/system-apps/terminal/terminal.commands.ts
+++ b/src/app/system-apps/terminal/terminal.commands.ts
@@ -1,12 +1,12 @@
import { TerminalCommand } from "./model/terminal.command";
import { AppDirectory } from "src/app/system-files/app.directory";
import { TriggerProcessService } from "src/app/shared/system-service/trigger.process.service";
-import { FileInfo } from "src/app/system-files/fileinfo";
+import { FileInfo } from "src/app/system-files/file.info";
import { RunningProcessService } from "src/app/shared/system-service/running.process.service";
import { StateManagmentService } from "src/app/shared/system-service/state.management.service";
import {extname, basename, resolve, dirname} from 'path';
import { FileService } from "src/app/shared/system-service/file.service";
-import { FileEntry } from 'src/app/system-files/fileentry';
+import { FileEntry } from 'src/app/system-files/file.entry';
export interface OctalRepresentation {
diff --git a/src/app/system-apps/texteditor/texteditor.component.ts b/src/app/system-apps/texteditor/texteditor.component.ts
index b77204bd..0a2c783d 100644
--- a/src/app/system-apps/texteditor/texteditor.component.ts
+++ b/src/app/system-apps/texteditor/texteditor.component.ts
@@ -10,7 +10,7 @@ import { ScriptService } from 'src/app/shared/system-service/script.services';
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 { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { AppState, BaseState } from 'src/app/system-files/state/state.interface';
import { StateType } from 'src/app/system-files/state/state.type';
import { TaskBarPreviewImage } from '../taskbarpreview/taskbar.preview';
diff --git a/src/app/system-apps/videoplayer/videoplayer.component.ts b/src/app/system-apps/videoplayer/videoplayer.component.ts
index 2f7ca902..1563c254 100644
--- a/src/app/system-apps/videoplayer/videoplayer.component.ts
+++ b/src/app/system-apps/videoplayer/videoplayer.component.ts
@@ -6,7 +6,7 @@ import { ProcessIDService } from 'src/app/shared/system-service/process.id.servi
import { Process } from 'src/app/system-files/process';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { Constants } from "src/app/system-files/constants";
import { AppState, BaseState } from 'src/app/system-files/state/state.interface';
import { StateType } from 'src/app/system-files/state/state.type';
diff --git a/src/app/system-files/fileentry.ts b/src/app/system-files/file.entry.ts
similarity index 100%
rename from src/app/system-files/fileentry.ts
rename to src/app/system-files/file.entry.ts
diff --git a/src/app/system-files/fileinfo.ts b/src/app/system-files/file.info.ts
similarity index 100%
rename from src/app/system-files/fileinfo.ts
rename to src/app/system-files/file.info.ts
diff --git a/src/app/system-files/file.tree.node.ts b/src/app/system-files/file.tree.node.ts
new file mode 100644
index 00000000..db97c91a
--- /dev/null
+++ b/src/app/system-files/file.tree.node.ts
@@ -0,0 +1,5 @@
+export interface FileTreeNode{
+ name: string;
+ isFile:boolean;
+ children: FileTreeNode[];
+}
\ No newline at end of file
diff --git a/src/app/user-apps/jsdos/jsdos.component.ts b/src/app/user-apps/jsdos/jsdos.component.ts
index 28f247c3..a9423de6 100644
--- a/src/app/user-apps/jsdos/jsdos.component.ts
+++ b/src/app/user-apps/jsdos/jsdos.component.ts
@@ -10,7 +10,7 @@ import { ProcessIDService } from 'src/app/shared/system-service/process.id.servi
import { Process } from 'src/app/system-files/process';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { AppState, BaseState } from 'src/app/system-files/state/state.interface';
import { StateType } from 'src/app/system-files/state/state.type';
import { StateManagmentService } from 'src/app/shared/system-service/state.management.service';
diff --git a/src/app/user-apps/markdownviewer/markdownviewer.component.ts b/src/app/user-apps/markdownviewer/markdownviewer.component.ts
index f3cd443d..ddceae75 100644
--- a/src/app/user-apps/markdownviewer/markdownviewer.component.ts
+++ b/src/app/user-apps/markdownviewer/markdownviewer.component.ts
@@ -15,7 +15,7 @@ import * as htmlToImage from 'html-to-image';
import { TaskBarPreviewImage } from 'src/app/system-apps/taskbarpreview/taskbar.preview';
import { ScriptService } from 'src/app/shared/system-service/script.services';
import { FileService } from 'src/app/shared/system-service/file.service';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { SessionManagmentService } from 'src/app/shared/system-service/session.management.service';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
declare const marked:any;
diff --git a/src/app/user-apps/ruffle/ruffle.component.ts b/src/app/user-apps/ruffle/ruffle.component.ts
index 9cc5ef7f..61f8a97a 100644
--- a/src/app/user-apps/ruffle/ruffle.component.ts
+++ b/src/app/user-apps/ruffle/ruffle.component.ts
@@ -6,7 +6,7 @@ import { Process } from 'src/app/system-files/process';
import {extname} from 'path';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { TriggerProcessService } from 'src/app/shared/system-service/trigger.process.service';
-import { FileInfo } from 'src/app/system-files/fileinfo';
+import { FileInfo } from 'src/app/system-files/file.info';
import { AppState, BaseState } from 'src/app/system-files/state/state.interface';
import { StateType } from 'src/app/system-files/state/state.type';
import { StateManagmentService } from 'src/app/shared/system-service/state.management.service';
diff --git a/src/osdrive/icons/this_pc_94.png b/src/osdrive/icons/this_pc_94.png
new file mode 100644
index 00000000..05d59950
Binary files /dev/null and b/src/osdrive/icons/this_pc_94.png differ