mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-09-09 11:28:14 +08:00
Merge pull request #815 from c-bata/fix-code-server-extension
Fix the bug of code-server extension fails to load studies on the first attempt.
This commit is contained in:
@@ -112,9 +112,6 @@ or install the code-server extension via [Open VSX](https://open-vsx.org/extensi
|
||||
Please right-click the SQLite3 files (`*.db` or `*.sqlite3`) in the VS Code file explorer and select the "Open in Optuna Dashboard" command from the dropdown menu.
|
||||
This extension leverages the browser-only version of Optuna Dashboard, so the same limitations apply.
|
||||
|
||||
Please note that we have confirmed the behavior of the code-server extension can be unstable.
|
||||
When opening SQLite files, the dashboard may not appear on the first attempt, but it should be displayed upon a second try.
|
||||
|
||||
## Submitting patches
|
||||
|
||||
If you want to contribute, please check [Developers Guide](./CONTRIBUTING.md).
|
||||
|
||||
@@ -228,9 +228,6 @@ or install the code-server extension via `Open VSX <https://open-vsx.org/extensi
|
||||
To use, right-click the SQLite3 files (``*.db`` or ``*.sqlite3``) in the file explorer and select the "Open in Optuna Dashboard" from the dropdown menu.
|
||||
This extension leverages the browser-only version of Optuna Dashboard, so the same limitations apply.
|
||||
|
||||
Please note that we have confirmed the behavior of the code-server extension can be unstable.
|
||||
When opening SQLite files, the dashboard may not appear on the first attempt, but it should be displayed upon a second try.
|
||||
|
||||
Google Colaboratory
|
||||
-------------------
|
||||
|
||||
|
||||
+15
-1
@@ -6,4 +6,18 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Initial release
|
||||
* [bug] Fix a bug that the extension cannot show studies on the first attempt.
|
||||
* [feature] Enable a "Open in Optuna Dashboard" menu for `.log` files.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
* [feature] Added support for `JournalFileStorage`.
|
||||
* [feature] Added support for code-server.
|
||||
|
||||
## 0.1.0
|
||||
|
||||
* [feature] Added older database schemas support (Optuna 2.6.0 or later)
|
||||
|
||||
## 0.0.1
|
||||
|
||||
* Initial Release
|
||||
|
||||
@@ -12,21 +12,6 @@ Please right-click on the SQLite3 file (`*.db` or `*.sqlite3`) in the file explo
|
||||
|
||||
Nothing to configure.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### 0.2.0
|
||||
|
||||
* Added support for `JournalFileStorage`.
|
||||
* Added support for code-server.
|
||||
|
||||
### 0.1.0
|
||||
|
||||
Added older database schemas support (Optuna 2.6.0 or later)
|
||||
|
||||
### 0.0.1
|
||||
|
||||
Initial Release
|
||||
|
||||
---
|
||||
|
||||
**Enjoy!**
|
||||
|
||||
@@ -30,11 +30,16 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
const appPath = panel.webview.asWebviewUri(indexJsUri)
|
||||
|
||||
panel.webview.html = getWebviewContent(appPath)
|
||||
|
||||
const storageContentBase64 = await readFileAsBase64(fileUri)
|
||||
panel.webview.postMessage({
|
||||
type: "optunaStorage",
|
||||
content: storageContentBase64,
|
||||
panel.webview.onDidReceiveMessage(async (message: any) => {
|
||||
switch (message.type) {
|
||||
case "webviewDidLoad":
|
||||
const storageContentBase64 = await readFileAsBase64(fileUri)
|
||||
panel.webview.postMessage({
|
||||
type: "optunaStorage",
|
||||
content: storageContentBase64,
|
||||
})
|
||||
break
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -64,6 +69,14 @@ function getWebviewContent(indexJsUri: vscode.Uri): string {
|
||||
<meta charset="utf-8" />
|
||||
<title>Optuna Dashboard (Wasm ver.)</title>
|
||||
<script type="module" crossorigin src="${indexJsUri}"></script>
|
||||
<script>
|
||||
(function() {
|
||||
const vscodeApi = acquireVsCodeApi();
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
vscodeApi.postMessage({ type: 'webviewDidLoad' })
|
||||
})
|
||||
}())
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Reference in New Issue
Block a user