Skip to content

Commit

Permalink
I think it's dying on popup.
Browse files Browse the repository at this point in the history
  • Loading branch information
julialawrence committed Oct 23, 2023
1 parent b321e68 commit ee68287
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def start_vscode(id):
# Redirect to a waiting page or directly embed the VS Code interface if it's ready
# The implementation of this part can vary based on how you handle the VS Code UI embedding
# return render_template("vscode.html")
vscode_url = url_for('vscode_proxy', _external=True)
vscode_url = url_for('vscode_proxy')
return redirect(vscode_url)


Expand Down
16 changes: 13 additions & 3 deletions app/templates/data_source_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8">
<title>Data Source Details</title>
<!-- You can add CSS or additional meta tags here -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <!-- Include jQuery -->
</head>
<body>

Expand Down Expand Up @@ -41,11 +42,20 @@ <h3>Assigned Users:</h3>
<!-- Check if the user has the necessary permissions to launch VS Code -->
{% if is_admin or user_has_access %}
<!-- Button to launch VS Code -->
<form action="{{ url_for('start_vscode', id=data_source.id) }}" method="post">
<input type="submit" value="Launch VS Code">
</form>
<button onclick="launchVSCode()">Launch VS Code</button>
{% endif %}

<script type="text/javascript">
function launchVSCode() {
// Send an AJAX POST request to start_vscode
$.post("{{ url_for('start_vscode', id=data_source.id) }}", function() {
// On success, open the vscode_proxy URL in a new tab
var url = "{{ url_for('vscode_proxy') }}";
window.open(url, '_blank');
});
}
</script>

<!-- Link to go back to the list of data sources -->
<a href="{{ url_for('list_data_sources') }}">Back to Data Sources List</a>

Expand Down

0 comments on commit ee68287

Please sign in to comment.