Merge pull request #2937 from ethereum/remixdB

remixD failure
pull/14/head
yann300 5 years ago committed by GitHub
commit 3c5d57fe21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1080
      package-lock.json
  2. 2
      package.json
  3. 22
      src/app/files/remixd-handle.js
  4. 2
      src/app/panels/file-panel.js
  5. 8
      src/app/ui/TreeView.js

1080
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -62,7 +62,7 @@
"remix-solidity": "0.3.31",
"remix-tabs": "1.0.48",
"remix-tests": "0.1.34",
"remixd": "0.2.1-alpha.1",
"remixd": "0.2.3-alpha.1",
"request": "^2.83.0",
"rimraf": "^2.6.1",
"selenium-standalone": "^6.17.0",

@ -20,6 +20,7 @@ var css = csjs`
const profile = {
name: 'remixd',
displayName: 'RemixD',
url: 'ws://127.0.0.1:65520',
methods: ['folderIsReadOnly', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list'],
events: [],
@ -57,7 +58,7 @@ export class RemixdHandle extends WebsocketPlugin {
* connect to localhost if no connection and render the explorer
* disconnect from localhost if connected and remove the explorer
*
* @param {String} txHash - hash of the transaction
* @param {String} txHash - hash of the transaction
*/
async connectToLocalhost () {
let connection = (error) => {
@ -69,6 +70,17 @@ export class RemixdHandle extends WebsocketPlugin {
)
this.canceled()
} else {
const intervalId = setInterval(() => {
if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed
clearInterval(intervalId)
console.log(error)
modalDialogCustom.alert(
'Connection to remixd terminated' +
'Please make sure remixd is still running in the background.'
)
this.canceled()
}
}, 3000)
this.locahostProvider.init(_ => this.fileSystemExplorer.ensureRoot())
}
}
@ -83,7 +95,13 @@ export class RemixdHandle extends WebsocketPlugin {
fn: () => {
try {
super.activate()
setTimeout(() => { connection() }, 2000)
setTimeout(() => {
if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed
connection(new Error('Connection with daemon failed.'))
} else {
connection()
}
}, 3000)
} catch (error) {
connection(error)
}

@ -65,7 +65,7 @@ module.exports = class Filepanel extends ViewPlugin {
const explorers = yo`
<div>
<div class="pl-2 ${css.treeview}" data-id="filePanelFileExplorerTree">${fileExplorer.init()}</div>
<div class="filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
<div class="pl-2 filesystemexplorer ${css.treeview}">${fileSystemExplorer.init()}</div>
</div>
`

@ -80,13 +80,13 @@ class TreeView {
var children = Object.keys(json).map((innerkey) => {
return this.renderObject(json[innerkey], json, innerkey, expand, innerkey)
})
return yo`<ul key=${key} data-id="treeViewUl${key}" class="${css.ul_tv} ml-0 pr-2">${children}</ul>`
return yo`<ul key=${key} data-id="treeViewUl${key}" class="${css.ul_tv} ml-0 px-2">${children}</ul>`
}
formatData (key, data, children, expand, keyPath) {
var self = this
var li = yo`<li key=${keyPath} data-id="treeViewLi${keyPath}" class=${css.li_tv}></li>`
var caret = yo`<div class="fas fa-caret-right caret ${css.caret_tv}"></div>`
var caret = yo`<div class="px-1 fas fa-caret-right caret ${css.caret_tv}"></div>`
var label = yo`
<div key=${keyPath} data-id="treeViewDiv${keyPath}" class="d-flex flex-row align-items-center">
${caret}
@ -95,7 +95,7 @@ class TreeView {
const expanded = self.expandPath.includes(keyPath)
li.appendChild(label)
if (data.children) {
var list = yo`<ul key=${keyPath} data-id="treeViewUlList${keyPath}" class=${css.ul_tv}>${children}</ul>`
var list = yo`<ul key=${keyPath} data-id="treeViewUlList${keyPath}" class="pl-2 ${css.ul_tv}">${children}</ul>`
list.style.display = expanded ? 'block' : 'none'
caret.className = list.style.display === 'none' ? `fas fa-caret-right caret ${css.caret_tv}` : `fas fa-caret-down caret ${css.caret_tv}`
caret.setAttribute('data-id', `treeViewToggle${keyPath}`)
@ -104,7 +104,7 @@ class TreeView {
if (self.isExpanded(keyPath)) {
if (!self.expandPath.includes(keyPath)) self.expandPath.push(keyPath)
} else {
self.expandPath = self.expandPath.filter(path => path !== keyPath)
self.expandPath = self.expandPath.filter(path => !path.startsWith(keyPath))
}
}
label.oncontextmenu = function (event) {

Loading…
Cancel
Save