Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
deadlock-desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
deadlock-public
deadlock-desktop
Commits
6d677cdd
Commit
6d677cdd
authored
3 years ago
by
Christian ZHENG
Browse files
Options
Downloads
Patches
Plain Diff
feat(devcontainer): Open mission inside container on xdg-open link
parent
e0c8a6d0
Branches
feat-local-dev
Branches containing commit
Tags
Tags containing commit
3 merge requests
!14
feat: added mounted, .bashrc, .zshrc, added tests, added keycloak tests
,
!8
feat(extension): login, open in devcontainer, automaticly save code, open briefing, publish extension
,
!3
feat: devcontainer support
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
deadlock-plugins/deadlock-extension/src/core/controller.ts
+22
-13
22 additions, 13 deletions
deadlock-plugins/deadlock-extension/src/core/controller.ts
with
22 additions
and
13 deletions
deadlock-plugins/deadlock-extension/src/core/controller.ts
+
22
−
13
View file @
6d677cdd
import
*
as
vscode
from
'
vscode
'
;
import
{
KEYCLOAK_DEVICE_AUTH_URL
,
KEYCLOAK_TOKEN_CREATE_URL
,
KEYCLOAK_USER_INFO_URL
}
from
'
../config
'
;
import
{
copyProjectSources
,
log
}
from
'
../recorder/utils
'
;
import
{
KEYCLOAK_DEVICE_AUTH_URL
,
KEYCLOAK_TOKEN_CREATE_URL
,
KEYCLOAK_USER_INFO_URL
,
REGISTRY_MISSION_URL
,
}
from
'
../config
'
;
import
{
log
}
from
'
../recorder/utils
'
;
import
{
OPEN_GETTING_STARTED_COMMAND
}
from
'
../theia/command
'
;
import
BriefingView
from
'
../view/briefingView
'
;
import
GettingStartedView
from
'
../view/gettingStartedView
'
;
import
{
CHOOSE_MISSION_WORKDIR_COMMAND
,
CommandHandler
,
OPEN_URL_IN_BROWSER_COMMAND
}
from
'
./commandHandler
'
;
import
ExtensionStore
from
'
./extensionStore
'
;
import
KeycloakOAuth2DeviceFlowConnection
from
'
./keycloakOAuth2DeviceFlowConnection
'
;
import
Mission
from
'
./mission
'
;
export
default
class
Controller
{
public
connection
:
KeycloakOAuth2DeviceFlowConnection
;
...
...
@@ -37,7 +43,7 @@ export default class Controller {
switch
(
action
)
{
case
'
open-challenge
'
:
that
.
launchMission
(
queryParams
.
get
(
'
missionId
'
));
that
.
launchMission
(
queryParams
.
get
(
'
missionId
'
)
,
queryParams
.
get
(
'
missionVersion
'
)
);
break
;
default
:
...
...
@@ -87,8 +93,8 @@ export default class Controller {
vscode
.
commands
.
executeCommand
(
OPEN_URL_IN_BROWSER_COMMAND
.
cmd
,
vscode
.
Uri
.
parse
(
url
));
}
public
async
launchMission
(
missionId
:
string
|
null
)
{
if
(
missionId
)
{
public
async
launchMission
(
missionId
:
string
|
null
,
missionVersion
:
string
|
null
)
{
if
(
missionId
&&
missionVersion
)
{
vscode
.
window
.
showInformationMessage
(
`vous lancez la mission
${
missionId
}
`
);
const
hadMissionWorkdir
=
this
.
extensionStore
.
getMissionWorkdir
()
!==
undefined
;
if
(
!
hadMissionWorkdir
)
{
...
...
@@ -103,16 +109,19 @@ export default class Controller {
}
else
{
vscode
.
window
.
showInformationMessage
(
'
Déjà connecté: session récupérée
'
);
}
await
copyProjectSources
(
'
Documents/deadlock-challenges/resources/code_desktop_exemple
'
,
this
.
extensionStore
.
getMissionWorkdir
()
!
,
).
catch
((
e
)
=>
{
log
(
e
);
// TODO Should I fetch GET api/missions/{missionId} one day instead of passing necessary parameters in vscode xdg-open link ?
const
mission
=
new
Mission
({
registryBaseURL
:
REGISTRY_MISSION_URL
,
missionId
:
missionId
,
missionVersion
:
missionVersion
,
});
await
vscode
.
commands
.
executeCommand
(
'
remote-containers.openFolder
'
,
vscode
.
Uri
.
file
(
this
.
extensionStore
.
getMissionWorkdir
()
!
),
vscode
.
window
.
showInformationMessage
(
'
opening inside folder
'
+
this
.
extensionStore
.
getMissionWorkdir
()
!
+
'
/
'
+
missionId
,
);
await
mission
.
setup
({});
await
mission
.
openEditorInFolder
();
vscode
.
commands
.
executeCommand
(
OPEN_GETTING_STARTED_COMMAND
.
cmd
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment