Skip to content

Commit 9975c07

Browse files
author
Jicheng Lu
committed
Merge branch 'main' of https://github.com/SciSharp/BotSharp-UI into features/refine-chat-window
2 parents e918357 + e948d37 commit 9975c07

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

src/lib/helpers/types/pluginTypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* @property {string} link
1919
* @property {EmbeddingInfoModel?} [embeddingInfo]
2020
* @property {boolean} isHeader
21+
* @property {PluginMenuDefModel[]} subMenu
2122
*/
2223

2324
/**

src/routes/page/agent/metrics/+page.svelte renamed to src/routes/page/agent/reporting/+page.svelte

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
1313
onMount(async () => {
1414
unsubscriber = globalMenuStore.subscribe((/** @type {import('$pluginTypes').PluginMenuDefModel[]} */ menu) => {
15-
const url = $page.url.pathname;
16-
const data = menu.find(x => x.link === url)?.embeddingInfo || null;
15+
const url = getPathUrl();
16+
let data = menu.find(x => x.link === url)?.embeddingInfo || null;
17+
if (!data) {
18+
const found = menu.find(x => !!x.subMenu?.find(y => y.link === url));
19+
data = found?.subMenu?.find(x => x.link === url)?.embeddingInfo || null;
20+
}
1721
embed(data);
1822
});
1923
});
@@ -39,7 +43,7 @@
3943
document.head.appendChild(script);
4044
}
4145
42-
const div = document.querySelector('#agent-metrics-content');
46+
const div = document.querySelector('#agent-reporting-content');
4347
if (!data.url || !div) return;
4448
4549
if (data.htmlTag) {
@@ -53,15 +57,20 @@
5357
div.appendChild(elem);
5458
}
5559
}
60+
61+
const getPathUrl = () => {
62+
const path = $page.url.pathname;
63+
return path?.startsWith('/') ? path.substring(1) : path;
64+
};
5665
</script>
5766
58-
<HeadTitle title="{$_('Metrics')}" />
59-
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_('Metrics')}" />
67+
<HeadTitle title="{$_('Reporting')}" />
68+
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_('Reporting')}" />
6069
6170
<Row>
6271
<Col lg="12">
6372
<Card>
64-
<CardBody id="agent-metrics-content"></CardBody>
73+
<CardBody id="agent-reporting-content"></CardBody>
6574
</Card>
6675
</Col>
6776
</Row>

svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const config = {
4949
"/page/agent",
5050
"/page/agent/router",
5151
"/page/agent/evaluator",
52-
"/page/agent/metrics",
52+
"/page/agent/reporting",
5353
"/page/agent/[agentId]",
5454
"/page/agent/[agentId]/build",
5555
"/page/agent/[agentId]/train",

0 commit comments

Comments
 (0)