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
340d7800
Commit
340d7800
authored
Jun 28, 2021
by
filip mertens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get token when using import
parent
c6852528
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
app.js
apps/remix-ide/src/app.js
+2
-2
compiler-content-imports.ts
...piler-content-imports/src/lib/compiler-content-imports.ts
+3
-2
resolve.ts
libs/remix-url-resolver/src/resolve.ts
+4
-0
No files found.
apps/remix-ide/src/app.js
View file @
340d7800
...
@@ -460,11 +460,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -460,11 +460,11 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
console
.
log
(
'couldn
\'
t register iframe plugins'
,
e
.
message
)
console
.
log
(
'couldn
\'
t register iframe plugins'
,
e
.
message
)
}
}
await
appManager
.
activatePlugin
([
'
settings'
,
'contentImport'
,
'
theme'
,
'editor'
,
'fileManager'
,
'compilerMetadata'
,
'compilerArtefacts'
,
'network'
,
'web3Provider'
,
'offsetToLineColumnConverter'
])
await
appManager
.
activatePlugin
([
'theme'
,
'editor'
,
'fileManager'
,
'compilerMetadata'
,
'compilerArtefacts'
,
'network'
,
'web3Provider'
,
'offsetToLineColumnConverter'
])
await
appManager
.
activatePlugin
([
'mainPanel'
,
'menuicons'
,
'tabs'
])
await
appManager
.
activatePlugin
([
'mainPanel'
,
'menuicons'
,
'tabs'
])
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'sidePanel'
])
// activating host plugin separately
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'home'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'pluginManager'
,
'filePanel'
,
'
contextualListener'
,
'terminal'
,
'fetchAndCompile
'
])
await
appManager
.
activatePlugin
([
'hiddenPanel'
,
'pluginManager'
,
'filePanel'
,
'
settings'
,
'contextualListener'
,
'terminal'
,
'fetchAndCompile'
,
'contentImport
'
])
const
queryParams
=
new
QueryParams
()
const
queryParams
=
new
QueryParams
()
const
params
=
queryParams
.
get
()
const
params
=
queryParams
.
get
()
...
...
libs/remix-core-plugin/compiler-content-imports/src/lib/compiler-content-imports.ts
View file @
340d7800
...
@@ -22,10 +22,10 @@ export class CompilerImports extends Plugin {
...
@@ -22,10 +22,10 @@ export class CompilerImports extends Plugin {
this
.
previouslyHandled
=
{}
// cache import so we don't make the request at each compilation.
this
.
previouslyHandled
=
{}
// cache import so we don't make the request at each compilation.
}
}
async
onActivatio
n
()
{
async
setToke
n
()
{
const
protocol
=
typeof
window
!==
'undefined'
&&
window
.
location
.
protocol
const
protocol
=
typeof
window
!==
'undefined'
&&
window
.
location
.
protocol
const
token
=
await
this
.
call
(
'settings'
,
'getGithubAccessToken'
)
const
token
=
await
this
.
call
(
'settings'
,
'getGithubAccessToken'
)
this
.
urlResolver
=
new
RemixURLResolver
(
token
,
protocol
)
this
.
urlResolver
.
setGistToken
(
token
,
protocol
)
}
}
isRelativeImport
(
url
)
{
isRelativeImport
(
url
)
{
...
@@ -71,6 +71,7 @@ export class CompilerImports extends Plugin {
...
@@ -71,6 +71,7 @@ export class CompilerImports extends Plugin {
let
resolved
let
resolved
try
{
try
{
await
this
.
setToken
()
resolved
=
await
this
.
urlResolver
.
resolve
(
url
)
resolved
=
await
this
.
urlResolver
.
resolve
(
url
)
const
{
content
,
cleanUrl
,
type
}
=
resolved
const
{
content
,
cleanUrl
,
type
}
=
resolved
self
.
previouslyHandled
[
url
]
=
{
self
.
previouslyHandled
[
url
]
=
{
...
...
libs/remix-url-resolver/src/resolve.ts
View file @
340d7800
...
@@ -30,6 +30,10 @@ export class RemixURLResolver {
...
@@ -30,6 +30,10 @@ export class RemixURLResolver {
constructor
(
gistToken
?:
string
,
protocol
=
'http:'
)
{
constructor
(
gistToken
?:
string
,
protocol
=
'http:'
)
{
this
.
previouslyHandled
=
{}
this
.
previouslyHandled
=
{}
this
.
setGistToken
(
gistToken
,
protocol
)
}
async
setGistToken
(
gistToken
?:
string
,
protocol
=
'http:'
)
{
this
.
gistAccessToken
=
gistToken
||
''
this
.
gistAccessToken
=
gistToken
||
''
this
.
protocol
=
protocol
this
.
protocol
=
protocol
}
}
...
...
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