File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
routes/page/agent/reporting Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 1818 * @property {string } link
1919 * @property {EmbeddingInfoModel? } [embeddingInfo]
2020 * @property {boolean } isHeader
21+ * @property {PluginMenuDefModel[] } subMenu
2122 */
2223
2324/**
Original file line number Diff line number Diff line change 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 });
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 ) {
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>
Original file line number Diff line number Diff 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" ,
You can’t perform that action at this time.
0 commit comments