Update FileManager

pull/3094/head
Grandschtroumpf 6 years ago
parent 813ed433d1
commit 98be306275
  1. 8
      src/app/files/fileManager.js
  2. 2
      src/app/tabs/testTab/testTab.js
  3. 2
      test-browser/plugin/index.html
  4. 4
      test-browser/plugin/plugin.js

@ -15,12 +15,14 @@ import { FileSystemApi } from 'remix-plugin'
const profile = {
displayName: 'file manager',
name: 'fileManager',
methods: ['getFilesFromPath', 'getCurrentFile', 'getFile', 'setFile'],
events: ['currentFileChanged'],
description: 'service - read/write to any files or folders, require giving permissions',
permission: true
}
// File System profile
// - events: ['currentFileChanged']
// - methods: ['getFolder', 'getCurrentFile', 'getFile', 'setFile']
class FileManager extends FileSystemApi {
constructor (localRegistry) {
super(profile)
@ -220,7 +222,7 @@ class FileManager extends FileSystemApi {
}
}
getFilesFromPath (path) {
getFolder (path) {
// TODO : Change provider with promise
return new Promise((resolve, reject) => {
const provider = this.fileProviderOf(path)

@ -26,7 +26,7 @@ class TestTabLogic {
var tests = []
let files
try {
files = await this.fileManager.getFilesFromPath(path)
files = await this.fileManager.getFolder(path)
} catch (e) {
cb(e.message)
}

@ -48,7 +48,7 @@
<input type="button" id="getcontentof">get content of</input> <br>
<input type="button" id="getcurrent">get current</input> <br>
<input type="button" id="sethighlight">set highlight</input> <br>
<input type="button" id="getfilesfrompath">get files from path</input> <br>
<input type="button" id="getFolder">get files from path</input> <br>
<input type="button" id="addnetwork">add network</input> <br>
<input type="button" id="removenetwork">remove network</input> <br>
<br>

@ -74,8 +74,8 @@ window.onload = function () {
function (error, result) { console.log(error, result) })
})
document.querySelector('input#getfilesfrompath').addEventListener('click', function () {
extension.call('editor', 'getFilesFromPath', [document.getElementById('filename').value],
document.querySelector('input#getFolder').addEventListener('click', function () {
extension.call('fileManager', 'getFolder', [document.getElementById('filename').value],
function (error, result) { console.log(error, result) })
})

Loading…
Cancel
Save