Skip to content

Commit 02489a7

Browse files
committed
修正没有正确地加载工作区日志的问题
1 parent a2a643e commit 02489a7

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

dashboard/dev-dist/sw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ define(['./workbox-38bb0eb2'], (function (workbox) { 'use strict';
8282
"revision": "3ca0b8505b4bec776b69afdba2768812"
8383
}, {
8484
"url": "index.html",
85-
"revision": "0.811n397n2no"
85+
"revision": "0.d97d8lbs2qo"
8686
}], {});
8787
workbox.cleanupOutdatedCaches();
8888
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

dashboard/src/components/mcp/CatalogGrid.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default function CatalogGrid({ catalog, installed, onInstalled }: Props)
5757
alert("Install failed");
5858
} finally {
5959
setInstallingId(null);
60+
setInstalling(null); // Close the dialog when installation is complete
6061
}
6162
};
6263

@@ -127,7 +128,11 @@ export default function CatalogGrid({ catalog, installed, onInstalled }: Props)
127128
<CatalogInstallDialog
128129
entry={installing}
129130
onClose={() => setInstalling(null)}
130-
onInstall={(vars) => { doInstall(installing, vars); setInstalling(null); }}
131+
onInstall={(vars) => {
132+
doInstall(installing, vars);
133+
// Don't close the dialog immediately - let it show the loading state
134+
// The dialog will be closed when the installation is complete
135+
}}
131136
/>
132137
)}
133138
</div>

dashboard/src/components/mcp/CatalogInstallDialog.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ export default function CatalogInstallDialog({ entry, onClose, onInstall }: Prop
1818
return init;
1919
});
2020

21+
const [isInstalling, setIsInstalling] = useState(false);
22+
2123
const handleSubmit = () => {
2224
for (const v of entry.variables) {
2325
if (v.required && !values[v.key]) return;
2426
}
27+
setIsInstalling(true);
2528
onInstall(values);
2629
};
2730

@@ -49,7 +52,9 @@ export default function CatalogInstallDialog({ entry, onClose, onInstall }: Prop
4952

5053
<div className="dialog-actions">
5154
<button className="action-btn secondary" onClick={onClose}>{t("common.cancel")}</button>
52-
<button className="action-btn primary" onClick={handleSubmit}>{t("mcp.catalog.install")}</button>
55+
<button className="action-btn primary" onClick={handleSubmit} disabled={isInstalling}>
56+
{isInstalling ? t("mcp.catalog.installing") : t("mcp.catalog.install")}
57+
</button>
5358
</div>
5459
</div>
5560
</div>

internal/adapters/http/handlers/monitor.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package handlers
33
import (
44
"bufio"
55
"encoding/json"
6+
"mindx/internal/config"
67
"net/http"
78
"os"
89
"path/filepath"
@@ -35,8 +36,12 @@ type ZapLogEntry struct {
3536
}
3637

3738
func NewMonitorHandler() *MonitorHandler {
39+
logsDir, err := config.GetWorkspaceLogsPath()
40+
if err != nil {
41+
logsDir = "logs"
42+
}
3843
return &MonitorHandler{
39-
logsDir: "logs",
44+
logsDir: logsDir,
4045
}
4146
}
4247

main

50.4 MB
Binary file not shown.

0 commit comments

Comments
 (0)