mirror of
https://github.com/danbulant/console-hub
synced 2026-06-12 03:00:29 +00:00
Testing show files in current folder
This commit is contained in:
parent
c7bd8dc50a
commit
c230804e97
3 changed files with 22 additions and 4 deletions
|
|
@ -1 +1,13 @@
|
|||
//Frontend renderer process javascript file for filesystem
|
||||
function refreshFiles(){
|
||||
if(files == null){
|
||||
return;
|
||||
}
|
||||
var shown = [];
|
||||
files.foreach((item, index) => {
|
||||
shown[index] = document.createElement('li');
|
||||
$("#files-list").append(shown[index]);
|
||||
shown[index].id = "file-" + index;
|
||||
$("#file-" + index).html(item);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@
|
|||
<div id="files-view" class="menu-item hidden">
|
||||
<h1 class="title-font">Files</h1>
|
||||
<p>Testing file system</p>
|
||||
<ul>
|
||||
<ul id="files-list">
|
||||
<li>Test1</li>
|
||||
<li>Test2</li>
|
||||
</ul>
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
<script src="script.js"></script>
|
||||
<script src="onlineChecker.js"></script>
|
||||
<script src="filesystem.js"></script>
|
||||
|
||||
|
||||
<script src="node.js"></script>
|
||||
|
||||
<script src="keyboard.js"></script>
|
||||
|
|
|
|||
10
html/node.js
10
html/node.js
|
|
@ -21,11 +21,17 @@ if(typeof module !== undefined){
|
|||
}
|
||||
ipcRenderer.send('get-data', 'wifi');
|
||||
ipcRenderer.send('get-data', 'wifiQuality');
|
||||
var files = null;
|
||||
ipcRenderer.on('listFiles', (event, arg) => {
|
||||
console.log(arg);
|
||||
files = arg;
|
||||
refreshFiles();
|
||||
})
|
||||
ipcRenderer.send('listFiles', 'C:\\Users\\Dan\\Documents\\GitHub\\console-hub');
|
||||
var loc = window.location.pathname;
|
||||
var dir = loc.substring(0, loc.lastIndexOf('/'));
|
||||
ipcRenderer.send('listFiles', dir);
|
||||
} else {
|
||||
//no NODE integration, propably browser access
|
||||
$("div:has(#files)").hide();//Disable file system view
|
||||
$("div:has(#files)").hide();//Disable file system preview
|
||||
mainMenuItems.slice("files");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue