mirror of
https://github.com/danbulant/console-hub
synced 2026-06-24 17:12:05 +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
|
//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">
|
<div id="files-view" class="menu-item hidden">
|
||||||
<h1 class="title-font">Files</h1>
|
<h1 class="title-font">Files</h1>
|
||||||
<p>Testing file system</p>
|
<p>Testing file system</p>
|
||||||
<ul>
|
<ul id="files-list">
|
||||||
<li>Test1</li>
|
<li>Test1</li>
|
||||||
<li>Test2</li>
|
<li>Test2</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
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', 'wifi');
|
||||||
ipcRenderer.send('get-data', 'wifiQuality');
|
ipcRenderer.send('get-data', 'wifiQuality');
|
||||||
|
var files = null;
|
||||||
ipcRenderer.on('listFiles', (event, arg) => {
|
ipcRenderer.on('listFiles', (event, arg) => {
|
||||||
console.log(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 {
|
} else {
|
||||||
//no NODE integration, propably browser access
|
//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