Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Sep 18, 2024
1 parent 408712c commit 1ced8f3
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
margin:0;
padding:0 0 0 0px; /* Each nested li will be padded incrementally */
}

.li-file-tree-view{
margin:0;
padding:0 0 0 10px; /* Each nested li will be padded incrementally */
Expand Down Expand Up @@ -53,7 +53,7 @@
.tree-view-cntnr{
display: inline-flex;
width: 100%;
padding-top: 2px;
padding: 2px 0px;
}

.fxtreeview-nested-p{
Expand All @@ -66,15 +66,16 @@
}

.fxtreeview-mid{
padding: 0 2px;
padding-left: 2px;
padding-right: 3px;
}

.fxtreeview-tail{
padding: 0 5px;
color: white;
text-align: left;
font-size: 12px;
font-weight: normal;
font-weight:200;
}

.fxtreeview-img{
Expand All @@ -94,8 +95,8 @@
}

.fxtreeview-img1{
height: 19px;
width: 19px;
height: 17px;
width: 17px;
image-rendering:optimizeQuality;
position: relative;
}
Expand All @@ -104,7 +105,7 @@
position: relative;
align-items: center;
display: inline-flex;
min-width: 19px;
min-width: 17px;
top: 0;
left: 15%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
node.name === 'Downloads' && node.path === '/Users/Downloads' ? 'osdrive/Cheetah/System/Imageres/downloads_folder_small.png' :
node.name === 'Games' && node.path === '/Users/Games' ? 'osdrive/Cheetah/System/Imageres/games_folder_small.png' :
node.name === 'Music' && node.path === '/Users/Music' ? 'osdrive/Cheetah/System/Imageres/music_folder_small.png' :
node.name === 'Pictures' && node.path === '/Users/Pictures '? 'osdrive/Cheetah/System/Imageres/picture_folder_small.png':
node.name === 'Videos' && node.path === '/Users/Videos' ? 'osdrive/Cheetah/System/Imageres/videos_folder_small.png': 'osdrive/Cheetah/System/Imageres/folder_folder_small.png'"/></figure></div>
node.name === 'Pictures' && node.path === '/Users/Pictures'? 'osdrive/Cheetah/System/Imageres/pictures_folder_small.png':
node.name === 'Videos' && node.path === '/Users/Videos' ? 'osdrive/Cheetah/System/Imageres/videos_folder_small.png':
node.name === 'OSDisk (C:)' && node.path === '/' ? 'osdrive/Cheetah/System/Imageres/os_disk.png': 'osdrive/Cheetah/System/Imageres/folder_folder_small.png'"/></figure></div>
<div class="span fxtreeview-tail"><p class="fxtreeview-nested-p">{{node.name}}</p></div>
</div>

Expand Down
24 changes: 22 additions & 2 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,25 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
}
}

private async loadFilesInfoAsync():Promise<void>{
private async loadFilesInfoAsync(path?:string, showUrl=true):Promise<void>{
this.files = [];
this._fileService.resetDirectoryFiles();
const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(this.directory);
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(directoryEntries,this.directory);

console.log('directoryEntries:',directoryEntries);

if(this.directory === '/'){
if(!showUrl){
const filteredDirectoryEntries = directoryEntries.filter(x => !x.includes('.url'));
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(filteredDirectoryEntries,this.directory);
}
else{
const filteredDirectoryEntries = directoryEntries.filter(x => x.includes('.url'));
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(filteredDirectoryEntries,this.directory);
}
}else{
this._directoryFilesEntires = this._fileService.getFileEntriesFromDirectory(directoryEntries,this.directory);
}

for(let i = 0; i < directoryEntries.length; i++){
const fileEntry = this._directoryFilesEntires[i];
Expand All @@ -697,6 +711,10 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
this._fileService.resetDirectoryFiles();
const directoryEntries = await this._fileService.getEntriesFromDirectoryAsync(directory);

const osDrive:FileTreeNode = {
name : 'OSDisk (C:)', path : '/', isFolder: true, children: []
}

// this.directory, will not be correct for all cases. Make sure to check
for(const dirEntry of directoryEntries){
const isFile = await this._fileService.checkIfDirectory(directory + dirEntry);
Expand All @@ -710,6 +728,8 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
console.log('ftn:', ftn);
this.fileTreeNode.push(ftn);
}

this.fileTreeNode.push(osDrive);
}

async updateFileTreeAsync(path:string):Promise<void>{
Expand Down
2 changes: 1 addition & 1 deletion src/osdrive.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Cheetah":{"System":{"Imageres":{"3d-objects_folder.png":null,"3d_objects_folder_small.png":null,"arrow_down.png":null,"arrow_next.png":null,"arrow_next_1.png":null,"arrow_up.png":null,"audioplayer.png":null,"camera_48.png":null,"chkmark26.png":null,"chkmark32.png":null,"chkmark32_blk.png":null,"circle.png":null,"circle_blk.png":null,"cmd.png":null,"code-editor-2_48.png":null,"config.png":null,"content_view.ico":null,"content_view.png":null,"cross_mark_32.png":null,"desktop.png":null,"desktop_256.png":null,"desktop_folder.png":null,"desktop_folder_small.png":null,"details_pane.png":null,"details_view.ico":null,"details_view.png":null,"documents.png":null,"documents_24.png":null,"documents_folder.png":null,"documents_folder_small.png":null,"downloads_folder.png":null,"downloads_folder_small.png":null,"econo.png":null,"empty_folder.png":null,"empty_recycle.ico":null,"emulator_1.png":null,"emulator_2.png":null,"extra_large_image.png":null,"file.png":null,"file_explorer.png":null,"folder.png":null,"folder_folder_small.png":null,"games.png":null,"games_folder.png":null,"games_folder_small.png":null,"generic_program.png":null,"grey_history_32.png":null,"grey_nav_expand_32.png":null,"grey_nav_forward_32.png":null,"grey_nav_refresh_32.png":null,"images.png":null,"info.png":null,"js-dos-logo.png":null,"large_image.png":null,"lightning_flash.png":null,"list_of_thumbnails_view.png":null,"markdown-2_50.png":null,"markdown-50.png":null,"markdown-file_50.png":null,"medium_icons_view.png":null,"music_file.png":null,"music_folder.png":null,"music_folder_small.png":null,"my_computer.png":null,"nav_expand_32.png":null,"nav_left_32.png":null,"nav_right_32.png":null,"nav_up-32.png":null,"navigation_pane.png":null,"pdf-48.png":null,"photos_48.png":null,"picture_16.png":null,"pictures.png":null,"pictures_folder.png":null,"pictures_folder_small.png":null,"pin_24.png":null,"preview_pane.png":null,"red_x.png":null,"search_32.png":null,"small_icons_view.ico":null,"small_icons_view.png":null,"taskmanger.png":null,"taskmanger_2.png":null,"terminal-2_48.png":null,"terminal_48.png":null,"text-editor_48.png":null,"this_pc.png":null,"tiles_view.png":null,"unknown.png":null,"unpin_24.png":null,"unpin_32.png":null,"video_file.ico":null,"video_file.png":null,"videoplayer-2_48.png":null,"videoplayer.png":null,"videos.png":null,"videos_24.png":null,"videos_folder.png":null,"videos_folder_small.png":null,"vs-code_48.png":null,"white_history_32.png":null,"x_32.png":null}}},"Program-Files":{"simple.txt":null},"Users":{"3D-Objects":{},"Desktop":{"fileexplorer.url":null,"heat.url":null,"hello.url":null,"surfs.url":null,"taskmanager.url":null,"terminal.url":null,"titanium.url":null},"Documents":{"Credits.md":null,"Dynamic Programming.txt":null,"PDFs":{"CyberPower_UM_EC650LCD 2.pdf":null,"MotherBoard":{"PRO-B650-P-WIFI.pdf":null}},"Screen-Shots":{"Sample ScreenShot.png":null},"simple.txt":null,"starting a new proj in VSCode.txt":null},"Downloads":{"anothertest.txt":null},"Games":{"D3D.url":null,"Data":{"D3D.jsdos":null,"Digger.jsdos":null,"Doom.jsdos":null,"Jill of the Jungle.jsdos":null,"Machine Nation.jsdos":null,"Shadow Knight.jsdos":null},"Diggers.url":null,"Doom.url":null,"Flash-Games ":{"logo-anim.swf":null},"icons":{"d3d.png":null,"diggers.png":null,"doom.png":null,"doom1.png":null}},"Music":{"jazz-club-in-new-orleans.mp3":null,"titanium.mp3":null,"watr-fluid.mp3":null},"Pictures":{"Samples":{"Chill on the Moon.jpg":null,"Sparkling Water.jpg":null,"Sunset Car.jpg":null,"Sunset.jpg":null,"mystical.jpg":null,"no_img.jpeg":null},"favicon.ico":null,"favicon1.ico":null,"favicon_nice.png":null,"heat.png":null},"Videos":{"nuts.mp4":null,"surfs.mp4":null}}}
{"3d-objects.url":null,"Cheetah":{"System":{"Imageres":{"3d-objects_folder.png":null,"3d_objects_folder_small.png":null,"arrow_down.png":null,"arrow_next.png":null,"arrow_next_1.png":null,"arrow_up.png":null,"audioplayer.png":null,"camera_48.png":null,"chkmark26.png":null,"chkmark32.png":null,"chkmark32_blk.png":null,"circle.png":null,"circle_blk.png":null,"cmd.png":null,"code-editor-2_48.png":null,"config.png":null,"content_view.ico":null,"content_view.png":null,"cross_mark_32.png":null,"desktop_folder.png":null,"desktop_folder_small.png":null,"details_pane.png":null,"details_view.ico":null,"details_view.png":null,"documents.png":null,"documents_24.png":null,"documents_folder.png":null,"documents_folder_small.png":null,"downloads_folder.png":null,"downloads_folder_small.png":null,"econo.png":null,"empty_folder.png":null,"empty_recycle.ico":null,"emulator_1.png":null,"emulator_2.png":null,"extra_large_image.png":null,"file.png":null,"file_explorer.png":null,"folder.png":null,"folder_folder_small.png":null,"games.png":null,"games_folder.png":null,"games_folder_small.png":null,"generic_program.png":null,"grey_history_32.png":null,"grey_nav_expand_32.png":null,"grey_nav_forward_32.png":null,"grey_nav_refresh_32.png":null,"images.png":null,"info.png":null,"js-dos-logo.png":null,"large_image.png":null,"lightning_flash.png":null,"list_of_thumbnails_view.png":null,"markdown-2_50.png":null,"markdown-50.png":null,"markdown-file_50.png":null,"medium_icons_view.png":null,"music_file.png":null,"music_folder.png":null,"music_folder_small.png":null,"my_computer.png":null,"nav_expand_32.png":null,"nav_left_32.png":null,"nav_right_32.png":null,"nav_up-32.png":null,"navigation_pane.png":null,"os_disk.png":null,"pdf-48.png":null,"photos_48.png":null,"picture_16.png":null,"pictures.png":null,"pictures_folder.png":null,"pictures_folder_small.png":null,"pin_24.png":null,"preview_pane.png":null,"red_x.png":null,"search_32.png":null,"small_icons_view.ico":null,"small_icons_view.png":null,"taskmanger.png":null,"taskmanger_2.png":null,"terminal-2_48.png":null,"terminal_48.png":null,"text-editor_48.png":null,"this_pc.png":null,"tiles_view.png":null,"unknown.png":null,"unpin_24.png":null,"unpin_32.png":null,"video_file.ico":null,"video_file.png":null,"videoplayer-2_48.png":null,"videoplayer.png":null,"videos.png":null,"videos_folder.png":null,"videos_folder_small.png":null,"vs-code_48.png":null,"white_history_32.png":null,"x_32.png":null}}},"Program-Files":{"simple.txt":null},"Users":{"3D-Objects":{},"Desktop":{"fileexplorer.url":null,"heat.url":null,"hello.url":null,"surfs.url":null,"taskmanager.url":null,"terminal.url":null,"titanium.url":null},"Documents":{"Credits.md":null,"Dynamic Programming.txt":null,"PDFs":{"CyberPower_UM_EC650LCD 2.pdf":null,"MotherBoard":{"PRO-B650-P-WIFI.pdf":null}},"Screen-Shots":{"Sample ScreenShot.png":null},"simple.txt":null,"starting a new proj in VSCode.txt":null},"Downloads":{"anothertest.txt":null},"Games":{"D3D.url":null,"Data":{"D3D.jsdos":null,"Digger.jsdos":null,"Doom.jsdos":null,"Jill of the Jungle.jsdos":null,"Machine Nation.jsdos":null,"Shadow Knight.jsdos":null},"Diggers.url":null,"Doom.url":null,"Flash-Games ":{"logo-anim.swf":null},"icons":{"d3d.png":null,"diggers.png":null,"doom.png":null,"doom1.png":null}},"Music":{"jazz-club-in-new-orleans.mp3":null,"titanium.mp3":null,"watr-fluid.mp3":null},"Pictures":{"Samples":{"Chill on the Moon.jpg":null,"Sparkling Water.jpg":null,"Sunset Car.jpg":null,"Sunset.jpg":null,"mystical.jpg":null,"no_img.jpeg":null},"favicon.ico":null,"favicon1.ico":null,"favicon_nice.png":null,"heat.png":null},"Videos":{"nuts.mp4":null,"surfs.mp4":null}},"desktop.url":null,"documents.url":null,"downloads.url":null,"games.url":null,"music.url":null,"pictures.url":null,"videos.url":null}
6 changes: 6 additions & 0 deletions src/osdrive/3d-objects.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/3d-objects_folder.png
FileType=folder
ContentPath=Users/3D-Objects
OpensWith=fileexplorer
Binary file removed src/osdrive/Cheetah/System/Imageres/desktop.png
Binary file not shown.
Binary file removed src/osdrive/Cheetah/System/Imageres/desktop_256.png
Binary file not shown.
Binary file added src/osdrive/Cheetah/System/Imageres/os_disk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/osdrive/Cheetah/System/Imageres/videos_24.png
Binary file not shown.
4 changes: 2 additions & 2 deletions src/osdrive/Users/Games/D3D.url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[InternetShortcut]
FileName=D3D
IconPath=/osdrive/Games/icons/d3d.png
IconPath=/osdrive/Users/Games/icons/d3d.png
FileType=.jsdos
ContentPath=/osdrive/Games/Data/D3D.jsdos
ContentPath=/osdrive/Users/Games/Data/D3D.jsdos
OpensWith=jsdos
4 changes: 2 additions & 2 deletions src/osdrive/Users/Games/Diggers.url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[InternetShortcut]
FileName=Diggers
IconPath=/osdrive/Games/icons/diggers.png
IconPath=/osdrive/Users/Games/icons/diggers.png
FileType=.jsdos
ContentPath=/osdrive/Games/Data/Digger.jsdos
ContentPath=/osdrive/Users/Games/Data/Digger.jsdos
OpensWith=jsdos
4 changes: 2 additions & 2 deletions src/osdrive/Users/Games/Doom.url
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[InternetShortcut]
FileName=Doom
IconPath=/osdrive/Games/icons/doom.png
IconPath=/osdrive/Users/Games/icons/doom.png
FileType=.jsdos
ContentPath=/osdrive/Games/Data/Doom.jsdos
ContentPath=/osdrive/Users/Games/Data/Doom.jsdos
OpensWith=jsdos
6 changes: 6 additions & 0 deletions src/osdrive/desktop.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/desktop_folder.png
FileType=folder
ContentPath=Users/Desktop
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/documents.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/documents_folder.png
FileType=folder
ContentPath=Users/Documents
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/downloads.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/downloads_folder.png
FileType=folder
ContentPath=Users/Downloads
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/games.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/games_folder.png
FileType=folder
ContentPath=Users/Games
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/music.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/music_folder.png
FileType=folder
ContentPath=Users/Music
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/pictures.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/pictures_folder.png
FileType=folder
ContentPath=Users/Pictures
OpensWith=fileexplorer
6 changes: 6 additions & 0 deletions src/osdrive/videos.url
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[InternetShortcut]
FileName=File Explorer
IconPath=/osdrive/Cheetah/System/Imageres/videos_folder.png
FileType=folder
ContentPath=Users/Videos
OpensWith=fileexplorer

0 comments on commit 1ced8f3

Please sign in to comment.