Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
16e389da
Commit
16e389da
authored
Mar 25, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
status API
parent
f451c80c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
8 deletions
+68
-8
vertical-icons-component.js
src/app/components/vertical-icons-component.js
+52
-7
contextualListener.js
src/app/editor/contextualListener.js
+2
-1
staticAnalysisView.js
src/app/staticanalysis/staticAnalysisView.js
+1
-0
analysis-tab.js
src/app/tabs/analysis-tab.js
+9
-0
compile-tab.js
src/app/tabs/compile-tab.js
+4
-0
No files found.
src/app/components/vertical-icons-component.js
View file @
16e389da
...
...
@@ -11,34 +11,73 @@ class VerticalIconComponent {
this
.
events
=
new
EventEmitter
()
this
.
icons
=
{}
this
.
iconKind
=
{}
this
.
iconStatus
=
{}
this
.
name
=
name
this
.
store
.
event
.
on
(
'activate'
,
(
name
)
=>
{
const
{
profile
}
=
this
.
store
.
getOne
(
name
)
if
(
!
profile
.
icon
)
return
if
(
profile
.
location
===
this
.
name
||
!
profile
.
location
)
{
this
.
addIcon
(
profile
)
const
api
=
this
.
store
.
getOne
(
name
)
if
(
!
api
.
profile
.
icon
)
return
if
(
api
.
profile
.
location
===
this
.
name
||
!
api
.
profile
.
location
)
{
this
.
addIcon
(
api
.
profile
)
this
.
listenOnStatus
(
api
)
}
})
this
.
store
.
event
.
on
(
'deactivate'
,
(
name
)
=>
{
const
api
=
this
.
store
.
getOne
(
name
)
if
(
api
&&
this
.
icons
[
name
])
this
.
removeIcon
(
api
.
profile
)
if
(
api
&&
this
.
icons
[
name
])
{
this
.
removeIcon
(
api
.
profile
)
this
.
stopListenOnStatus
(
api
)
}
})
this
.
store
.
event
.
on
(
'add'
,
(
api
)
=>
{
})
this
.
store
.
event
.
on
(
'remove'
,
(
api
)
=>
{
})
}
stopListenOnStatus
(
api
)
{
if
(
!
api
.
events
)
return
let
fn
=
this
.
iconStatus
[
api
.
profile
.
name
]
if
(
fn
)
{
api
.
events
.
unregister
(
'setStatus'
,
fn
)
delete
this
.
iconStatus
[
api
.
profile
.
name
]
}
}
listenOnStatus
(
api
)
{
if
(
!
api
.
events
)
return
const
fn
=
(
status
)
=>
{
this
.
setIconStatus
(
api
.
profile
.
name
,
status
)
}
this
.
iconStatus
[
api
.
profile
.
name
]
=
fn
api
.
events
.
on
(
'setStatus'
,
this
.
iconStatus
[
api
.
profile
.
name
])
}
/**
* Add an icon to the map
* @param {ModuleProfile} profile The profile of the module
*/
addIcon
({
kind
,
name
,
icon
})
{
this
.
icons
[
name
]
=
yo
`<div class="
${
css
.
icon
}
" onclick="
${(
e
)
=>
{
this
.
_iconClick
(
name
)
}}
" title="
$
{
name
}
" ><img src="
${
icon
}
" alt="
${
name
}
" /></div>`
this
.
iconKind
[
kind
||
'other'
].
appendChild
(
this
.
icons
[
name
])
}
/**
* Set a new status for the @arg name
* @param {name}
* @param {status}
*/
setIconStatus
(
name
,
status
)
{
const
el
=
this
.
icons
[
name
]
if
(
!
el
)
return
let
statusEl
=
el
.
querySelector
(
'i'
)
if
(
statusEl
)
{
el
.
removeChild
(
statusEl
)
}
if
(
status
.
key
)
{
el
.
appendChild
(
yo
`<i title="
${
status
.
title
}
" class="fa fa-
${
status
.
key
}
${
css
.
status
}
font-weight-bold text-
${
status
.
type
}
" aria-hidden="true"></i>`
)
}
}
/**
* Remove an icon from the map
* @param {ModuleProfile} profile The profile of the module
*/
...
...
@@ -136,6 +175,7 @@ const css = csjs`
width: 36px;
height: 36px;
padding: 3px;
position: relative;
}
.icon img {
width: 28px;
...
...
@@ -152,9 +192,14 @@ const css = csjs`
border-radius: 8px;
padding-top: 1px;
padding-left: 1px;
}
}
.icon[title='settings'] {
position: absolute;
bottom: 0;
}
.status {
position: absolute;
bottom: 0;
right: 0;
}
`
src/app/editor/contextualListener.js
View file @
16e389da
...
...
@@ -69,6 +69,7 @@ class ContextualListener {
this
.
currentPosition
=
cursorPosition
return
}
this
.
_stopHighlighting
()
this
.
currentPosition
=
cursorPosition
this
.
currentFile
=
file
if
(
compilationResult
&&
compilationResult
.
data
&&
compilationResult
.
data
.
sources
[
file
])
{
...
...
@@ -78,7 +79,7 @@ class ContextualListener {
this
.
_highlightExpressions
(
nodes
[
nodes
.
length
-
1
],
compilationResult
)
}
this
.
event
.
trigger
(
'contextChanged'
,
[
nodes
])
}
else
this
.
_stopHighlighting
()
}
}
_buildIndex
(
compilationResult
,
source
)
{
...
...
src/app/staticanalysis/staticAnalysisView.js
View file @
16e389da
...
...
@@ -125,6 +125,7 @@ staticAnalysisView.prototype.run = function () {
})
}
else
{
warningContainer
.
html
(
'No compiled AST available'
)
self
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
0
])
}
}
...
...
src/app/tabs/analysis-tab.js
View file @
16e389da
...
...
@@ -4,12 +4,14 @@ var EventManager = require('../../lib/events')
var
css
=
require
(
'./styles/analysis-tab-styles'
)
import
{
ApiFactory
}
from
'remix-plugin'
import
{
EventEmitter
}
from
'events'
class
AnalysisTab
extends
ApiFactory
{
constructor
(
registry
)
{
super
()
this
.
event
=
new
EventManager
()
this
.
events
=
new
EventEmitter
()
this
.
registry
=
registry
}
...
...
@@ -27,6 +29,13 @@ class AnalysisTab extends ApiFactory {
render
()
{
var
staticanalysis
=
new
StaticAnalysis
()
staticanalysis
.
event
.
register
(
'staticAnaysisWarning'
,
(
count
)
=>
{
if
(
count
)
{
this
.
events
.
emit
(
'setStatus'
,
{
key
:
'exclamation-triangle'
,
title
:
count
+
' warnings'
,
type
:
'warning'
})
}
else
{
this
.
events
.
emit
(
'setStatus'
,
{
key
:
'check'
,
title
:
'no warning'
,
type
:
'success'
})
}
})
this
.
registry
.
put
({
api
:
staticanalysis
,
name
:
'staticanalysis'
})
if
(
this
.
el
)
return
this
.
el
...
...
src/app/tabs/compile-tab.js
View file @
16e389da
...
...
@@ -79,6 +79,7 @@ class CompileTab extends ApiFactory {
if
(
this
.
_view
.
errorContainer
)
{
this
.
_view
.
errorContainer
.
innerHTML
=
''
}
this
.
events
.
emit
(
'setStatus'
,
{
key
:
'spinner'
,
title
:
'compiling...'
,
type
:
'info'
})
})
this
.
fileManager
.
events
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
...
...
@@ -88,6 +89,7 @@ class CompileTab extends ApiFactory {
if
(
success
)
{
// forwarding the event to the appManager infra
this
.
events
.
emit
(
'compilationFinished'
,
source
.
target
,
source
,
'soljson'
,
data
)
this
.
events
.
emit
(
'setStatus'
,
{
key
:
'check'
,
title
:
'compilation successful'
,
type
:
'success'
})
// Store the contracts
this
.
data
.
contractsDetails
=
{}
this
.
compiler
.
visitContracts
((
contract
)
=>
{
...
...
@@ -97,6 +99,8 @@ class CompileTab extends ApiFactory {
this
.
compiler
.
getSource
(
contract
.
file
)
)
})
}
else
{
this
.
events
.
emit
(
'setStatus'
,
{
key
:
'exclamation'
,
title
:
'compilation failed'
,
type
:
'danger'
})
}
// Update contract Selection
let
contractMap
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment