Skip to content

Commit

Permalink
fix codespaces (#414)
Browse files Browse the repository at this point in the history
* need to investigate dotnet runtime selection issues that seem to be still existing / prepend dotnet to path
  • Loading branch information
ChristopherHX authored Oct 25, 2024
1 parent ec80c37 commit 8f7408e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/runner-server-vscode/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,36 @@ function activate(context) {
}
);

const fullWebServerUri = await vscode.env.asExternalUri(
vscode.Uri.parse(address)
);

var args = [ path.join(context.extensionPath, 'native', 'Runner.Client.dll'), 'startrunner', '--parallel', '4' ];
if(address) {
args.push('--server', address)
}
vscode.window.createTerminal("runner.client", dotnetPath, args)
panel.webview.html = `<html><body style="height: 100%;width: 100%;border: 0;padding: 0; margin: 0;overflow: hidden;" ><iframe style="height: 100vh;width: 100%;border: 0;padding: 0; margin: 0;overflow: hidden;" src="${address}"></iframe></body></html>`;
setTimeout(() => {
vscode.window.createTerminal("runner.client", dotnetPath, args)
}, 2000);
const cspSource = panel.webview.cspSource;
// Get the content Uri
const style = panel.webview.asWebviewUri(
vscode.Uri.joinPath(context.extensionUri, 'style.css')
);
panel.webview.html = `<!DOCTYPE html>
<html>
<head>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; frame-src ${fullWebServerUri} ${cspSource} https:; img-src ${cspSource} https:; script-src ${cspSource}; style-src ${cspSource};"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="${style}">
</head>
<body>
<iframe src="${fullWebServerUri}"></iframe>
</body>
</html>`;
context.subscriptions.push(panel);
}
});
Expand Down
6 changes: 6 additions & 0 deletions src/runner-server-vscode/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
body {
height: 100%;width: 100%;border: 0;padding: 0; margin: 0;overflow: hidden;
}
iframe {
height: 100vh;width: 100%;border: 0;padding: 0; margin: 0;overflow: hidden;
}

0 comments on commit 8f7408e

Please sign in to comment.