Commit 5335e9ab authored by yann300's avatar yann300

warn user if storage is not complete

parent 0d3a26a5
...@@ -32,7 +32,7 @@ class StorageViewer { ...@@ -32,7 +32,7 @@ class StorageViewer {
* @return {Bool} - return True if the storage at @arg address is complete * @return {Bool} - return True if the storage at @arg address is complete
*/ */
isComplete (address) { isComplete (address) {
return this.storageResolver.storageRange(address) return this.storageResolver.isComplete(address)
} }
} }
......
...@@ -12,6 +12,7 @@ function DropdownPanel (_name, _opts) { ...@@ -12,6 +12,7 @@ function DropdownPanel (_name, _opts) {
_opts = {} _opts = {}
} }
this.name = _name this.name = _name
this.header = ''
this.json = _opts.json this.json = _opts.json
if (this.json) { if (this.json) {
this.treeView = new TreeView(_opts) this.treeView = new TreeView(_opts)
...@@ -19,10 +20,11 @@ function DropdownPanel (_name, _opts) { ...@@ -19,10 +20,11 @@ function DropdownPanel (_name, _opts) {
this.view this.view
} }
DropdownPanel.prototype.update = function (_data) { DropdownPanel.prototype.update = function (_data, _header) {
if (this.view) { if (this.view) {
this.view.querySelector('.dropdownpanel .dropdownrawcontent').innerText = JSON.stringify(_data, null, '\t') this.view.querySelector('.dropdownpanel .dropdownrawcontent').innerText = JSON.stringify(_data, null, '\t')
this.view.querySelector('.dropdownpanel button.btn').style.display = 'block' this.view.querySelector('.dropdownpanel button.btn').style.display = 'block'
this.view.querySelector('.title span').innerText = _header || ' '
if (this.json) { if (this.json) {
this.treeView.update(_data) this.treeView.update(_data)
} }
...@@ -44,7 +46,7 @@ DropdownPanel.prototype.render = function (overridestyle) { ...@@ -44,7 +46,7 @@ DropdownPanel.prototype.render = function (overridestyle) {
var view = yo`<div> var view = yo`<div>
<div class='title' style=${ui.formatCss(styleDropdown.title)} onclick=${function () { self.toggle() }}> <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.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>
<div class='dropdownpanel' style=${ui.formatCss(styleDropdown.content)} style='display:none'> <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"> <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 () { ...@@ -34,7 +34,12 @@ StoragePanel.prototype.init = function () {
console.log(error) console.log(error)
self.basicPanel.update({}) self.basicPanel.update({})
} else if (self.parent.currentStepIndex === index) { } 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)
}
})
} }
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment