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
7474ddf2
Commit
7474ddf2
authored
May 19, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warn if compilation too slow
parent
10cdc1dc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
app.js
src/app.js
+10
-0
compiler.js
src/app/compiler.js
+13
-1
settings-tab.js
src/app/settings-tab.js
+4
-1
No files found.
src/app.js
View file @
7474ddf2
...
...
@@ -816,6 +816,16 @@ var run = function () {
config
.
set
(
'autoCompile'
,
autoCompile
)
})
var
warnMsg
=
' Last compilation took {X}ms. We suggest to turn off autocompilation.'
compiler
.
event
.
register
(
'compilationSpeed'
,
(
speed
)
=>
{
$
(
'#warnCompilationSlow'
).
html
(
''
)
$
(
'#header #menu .settingsView'
).
css
(
'color'
,
''
)
if
(
speed
>
1000
)
{
$
(
'#warnCompilationSlow'
).
html
(
warnMsg
.
replace
(
'{X}'
,
speed
))
$
(
'#header #menu .settingsView'
).
css
(
'color'
,
'#FF8B8B'
)
}
})
function
runCompiler
()
{
if
(
transactionDebugger
.
isActive
)
return
...
...
src/app/compiler.js
View file @
7474ddf2
...
...
@@ -9,7 +9,7 @@ var utils = require('./utils')
var
EventManager
=
require
(
'ethereum-remix'
).
lib
.
EventManager
/*
trigger compilationFinished, compilerLoaded, compilationStarted
trigger compilationFinished, compilerLoaded, compilationStarted
, compilationSpeed
*/
function
Compiler
(
handleImportCall
)
{
var
self
=
this
...
...
@@ -28,6 +28,18 @@ function Compiler (handleImportCall) {
optimize
=
_optimize
}
var
compilationStartTime
=
null
this
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
success
&&
compilationStartTime
)
{
this
.
event
.
trigger
(
'compilationSpeed'
,
[(
new
Date
().
getTime
())
-
compilationStartTime
])
}
compilationStartTime
=
null
})
this
.
event
.
register
(
'compilationStarted'
,
()
=>
{
compilationStartTime
=
new
Date
().
getTime
()
})
var
internalCompile
=
function
(
files
,
target
,
missingInputs
)
{
gatherImports
(
files
,
target
,
missingInputs
,
function
(
error
,
input
)
{
if
(
error
)
{
...
...
src/app/settings-tab.js
View file @
7474ddf2
...
...
@@ -34,6 +34,9 @@ var css = csjs`
.checkboxText {
margin-left: 3px;
}
#warnCompilationSlow {
color: #FF8B8B;
}
}
`
module
.
exports
=
settingsTab
...
...
@@ -58,7 +61,7 @@ function settingsTab () {
</div>
<div class="
${
css
.
crow
}
">
<div><input class="
${
css
.
col1
}
" id="autoCompile" type="checkbox" checked></div>
<span class="
${
css
.
checkboxText
}
">Auto Compile</span>
<span class="
${
css
.
checkboxText
}
">Auto Compile</span>
<span id="warnCompilationSlow"></span>
</div>
</div>
<div class="
${
css
.
crow
}
">
...
...
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