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
27766677
Commit
27766677
authored
Oct 02, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addProvider / removeProvider
parent
e8c17819
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
plugin.md
src/app/plugin/plugin.md
+2
-0
pluginAPI.js
src/app/plugin/pluginAPI.js
+8
-0
run-tab.js
src/app/tabs/run-tab.js
+17
-0
No files found.
src/app/plugin/plugin.md
View file @
27766677
...
...
@@ -26,6 +26,8 @@ plugin api
-
getProviderEndpoint
`@return {String} url`
-
updateTitle
`@param {String} title`
-
detectNetWork
`@return {Object} {name, id}`
-
addProvider
`@param {String} name, @param {String} url`
-
removeProvider
`@return {String} name`
### config
...
...
src/app/plugin/pluginAPI.js
View file @
27766677
...
...
@@ -26,6 +26,14 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
executionContext
.
detectNetwork
((
error
,
network
)
=>
{
cb
(
error
,
network
)
})
},
addProvider
:
(
mod
,
name
,
url
,
cb
)
=>
{
executionContext
.
addProvider
({
name
,
url
})
cb
()
},
removeProvider
:
(
mod
,
name
,
cb
)
=>
{
executionContext
.
removeProvider
(
name
)
cb
()
}
},
config
:
{
...
...
src/app/tabs/run-tab.js
View file @
27766677
...
...
@@ -22,6 +22,7 @@ var css = require('./styles/run-tab-styles')
var
MultiParamManager
=
require
(
'../../multiParamManager'
)
var
modalDialog
=
require
(
'../ui/modaldialog'
)
var
CompilerAbstract
=
require
(
'../compiler/compiler-abstract'
)
var
tootip
=
require
(
'../ui/tooltip'
)
function
runTab
(
opts
,
localRegistry
)
{
/* -------------------------
...
...
@@ -639,6 +640,22 @@ function settings (container, self) {
instanceContainer
.
appendChild
(
self
.
_view
.
noInstancesText
)
})
executionContext
.
event
.
register
(
'addProvider'
,
(
network
)
=>
{
selectExEnv
.
appendChild
(
yo
`<option
title="Manually added environment:
${
network
.
url
}
"
value="
${
network
.
name
}
" name="executionContext">
${
network
.
name
}
</option>`
)
tootip
(
`
${
network
.
name
}
[
${
network
.
url
}
] added`
)
})
executionContext
.
event
.
register
(
'removeProvider'
,
(
name
)
=>
{
var
env
=
selectExEnv
.
querySelector
(
`option[value="
${
name
}
"]`
)
if
(
env
)
{
selectExEnv
.
removeChild
(
env
)
tootip
(
`
${
name
}
removed`
)
}
})
selectExEnv
.
addEventListener
(
'change'
,
function
(
event
)
{
let
context
=
selectExEnv
.
options
[
selectExEnv
.
selectedIndex
].
value
executionContext
.
executionContextChange
(
context
,
null
,
()
=>
{
...
...
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