Skip to content

Commit e1cc117

Browse files
authored
Merge pull request #412 from iceljc/features/refine-embedding-page
refine embeded page
2 parents c3ddbdd + 9b4efd5 commit e1cc117

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/lib/common/LiveChatEntry.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
showBubbleMsg = false;
3838
receivedMsg = '';
3939
}, receivedMsg?.length > 200 ? 8000 : 3000);
40+
} else if (e.data.action == ChatAction.NewWindow && e.data.url) {
41+
window.open(e.data.url, '_blank');
4042
}
4143
};
4244

src/lib/helpers/enums.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ const chatAction = {
167167
Logout: 'logout',
168168
Chat: 'chat',
169169
NewChat: 'new-chat',
170-
ReceiveNotification: 'receive-notification'
170+
ReceiveNotification: 'receive-notification',
171+
NewWindow: 'new-window'
171172
};
172173
export const ChatAction = Object.freeze(chatAction);
173174

src/routes/page/agent/reporting/[reportType]/+page.svelte renamed to src/routes/page/agent/[embed]/[embedType]/+page.svelte

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<script>
22
import { _ } from 'svelte-i18n';
3+
import { page } from '$app/stores';
4+
import lodash from 'lodash';
35
import HeadTitle from "$lib/common/HeadTitle.svelte";
46
import Breadcrumb from '$lib/common/Breadcrumb.svelte';
57
import EmbeddingPage from '$lib/common/embedding/EmbeddingPage.svelte';
@@ -8,11 +10,11 @@
810
let label = '';
911
</script>
1012

11-
<HeadTitle title="{$_(label || 'Reporting')}" addOn="Reporting" />
12-
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_(label || 'Reporting')}" />
13+
<HeadTitle title="{$_(label || 'Agent')}" addOn={`${lodash.capitalize($page.params.embed || '')}`} />
14+
<Breadcrumb title="{$_('Agent')}" pagetitle="{$_(label || 'Agent')}" />
1315

1416
<EmbeddingPage
15-
htmlTagId="agent-reporting-content"
16-
slugName="reportType"
17+
htmlTagId="agent-embed-content"
18+
slugName="embedType"
1719
bind:label={label}
1820
/>

svelte.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ const config = {
5151
"/page/agent/router",
5252
"/page/agent/evaluator",
5353
"/page/agent/code-scripts",
54-
"/page/agent/reporting/[reportType]",
5554
"/page/agent/[agentId]",
5655
"/page/agent/[agentId]/build",
5756
"/page/agent/[agentId]/train",
57+
"/page/agent/[embed]/[embedType]",
5858
"/page/instruction/testing",
5959
"/page/instruction/log",
6060
"/page/conversation",

0 commit comments

Comments
 (0)