abstract relmixd from filemanager

pull/3094/head
yann300 6 years ago
parent de5f1f33a5
commit 21327b0cb3
  1. 3
      src/app/files/fileManager.js
  2. 7
      src/app/files/shared-folder.js
  3. 8
      src/app/panels/file-panel.js

@ -40,6 +40,9 @@ class FileManager {
self._deps.localhostExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
self._deps.configExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
self._deps.gistExplorer.event.register('fileRemoved', (path) => { this.fileRemovedEvent(path) })
self._deps.localhostExplorer.event.register('errored', (event) => { this.removeTabsOf(self._deps.localhostExplorer) })
self._deps.localhostExplorer.event.register('closed', (event) => { this.removeTabsOf(self._deps.localhostExplorer) })
}
fileRenamedEvent (oldName, newName, isFolder) {

@ -14,6 +14,13 @@ module.exports = class SharedFolder {
this.filesContent = {}
this.files = {}
var remixdEvents = ['connecting', 'connected', 'errored', 'closed']
remixdEvents.forEach((value) => {
remixd.event.register(value, (event) => {
this.event.trigger(value, [event])
})
})
remixd.event.register('notified', (data) => {
if (data.scope === 'sharedfolder') {
if (data.name === 'created') {

@ -143,24 +143,24 @@ function filepanel (localRegistry) {
fileExplorer.ensureRoot()
configExplorer.ensureRoot()
var websocketconn = element.querySelector('.websocketconn')
self._deps.fileProviders['localhost'].remixd.event.register('connecting', (event) => {
self._deps.fileProviders['localhost'].event.register('connecting', (event) => {
websocketconn.style.color = styles.colors.yellow
websocketconn.setAttribute('title', 'Connecting to localhost. ' + JSON.stringify(event))
})
self._deps.fileProviders['localhost'].remixd.event.register('connected', (event) => {
self._deps.fileProviders['localhost'].event.register('connected', (event) => {
websocketconn.style.color = styles.colors.green
websocketconn.setAttribute('title', 'Connected to localhost. ' + JSON.stringify(event))
fileSystemExplorer.show()
})
self._deps.fileProviders['localhost'].remixd.event.register('errored', (event) => {
self._deps.fileProviders['localhost'].event.register('errored', (event) => {
websocketconn.style.color = styles.colors.red
websocketconn.setAttribute('title', 'localhost connection errored. ' + JSON.stringify(event))
fileSystemExplorer.hide()
})
self._deps.fileProviders['localhost'].remixd.event.register('closed', (event) => {
self._deps.fileProviders['localhost'].event.register('closed', (event) => {
websocketconn.style.color = styles.colors.black
websocketconn.setAttribute('title', 'localhost connection closed. ' + JSON.stringify(event))
fileSystemExplorer.hide()

Loading…
Cancel
Save