warn user if storage is not complete

pull/7/head
yann300 8 years ago
parent 0d3a26a54b
commit 5335e9ab5a
  1. 2
      src/storage/storageViewer.js
  2. 6
      src/ui/DropdownPanel.js
  3. 7
      src/ui/StoragePanel.js

@ -32,7 +32,7 @@ class StorageViewer {
* @return {Bool} - return True if the storage at @arg address is complete
*/
isComplete (address) {
return this.storageResolver.storageRange(address)
return this.storageResolver.isComplete(address)
}
}

@ -12,6 +12,7 @@ function DropdownPanel (_name, _opts) {
_opts = {}
}
this.name = _name
this.header = ''
this.json = _opts.json
if (this.json) {
this.treeView = new TreeView(_opts)
@ -19,10 +20,11 @@ function DropdownPanel (_name, _opts) {
this.view
}
DropdownPanel.prototype.update = function (_data) {
DropdownPanel.prototype.update = function (_data, _header) {
if (this.view) {
this.view.querySelector('.dropdownpanel .dropdownrawcontent').innerText = JSON.stringify(_data, null, '\t')
this.view.querySelector('.dropdownpanel button.btn').style.display = 'block'
this.view.querySelector('.title span').innerText = _header || ' '
if (this.json) {
this.treeView.update(_data)
}
@ -44,7 +46,7 @@ DropdownPanel.prototype.render = function (overridestyle) {
var view = yo`<div>
<div class='title' style=${ui.formatCss(styleDropdown.title)} onclick=${function () { self.toggle() }}>
<div style=${ui.formatCss(styleDropdown.caret)} class='fa fa-caret-right'></div>
<div style=${ui.formatCss(styleDropdown.inner, styleDropdown.titleInner)}>${this.name}</div>
<div style=${ui.formatCss(styleDropdown.inner, styleDropdown.titleInner)}>${this.name}</div><span></span>
</div>
<div class='dropdownpanel' style=${ui.formatCss(styleDropdown.content)} style='display:none'>
<button onclick=${function () { self.toggleRaw() }} style=${ui.formatCss(basicStyles.button, styleDropdown.copyBtn)} title='raw' class="btn fa fa-eye" type="button">

@ -34,7 +34,12 @@ StoragePanel.prototype.init = function () {
console.log(error)
self.basicPanel.update({})
} else if (self.parent.currentStepIndex === index) {
self.basicPanel.update(storage)
this.traceManager.getCurrentCalledAddressAt(index, (error, address) => {
if (!error) {
var header = storageViewer.isComplete(address) ? 'completely loaded' : 'partially loaded...'
self.basicPanel.update(storage, header)
}
})
}
})
})

Loading…
Cancel
Save