Skip to content

Commit f15f19c

Browse files
author
maksat.allakyev
committed
update images and create assistant for document viewer
1 parent 68b3257 commit f15f19c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CS/ReportingApp/Views/Home/DocumentViewer.cshtml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
@await Html.PartialAsync("_AILayout")
33
<script>
44
let aiTab;
5-
function BeforeRender(sender, args) {
5+
async function BeforeRender(sender, args) {
66
const previewModel = args;
77
const reportPreview = previewModel.reportPreview;
8-
9-
aiTab = createAssistantTab();
8+
const result = await fetch(`/AI/CreateUserAssistant`);
9+
const chatId = await result.text();
10+
aiTab = createAssistantTab(chatId);
1011
const model = aiTab.model;
1112
previewModel.tabPanel.tabs.push(aiTab);
1213
reportPreview.events.on('documentBuildingChanged', (args) => {
@@ -27,7 +28,7 @@
2728
2829
async function DocumentReady(sender, args) {
2930
const response = await sender.PerformCustomDocumentOperation(null, true);
30-
if (response.customData) {
31+
if (response.customData && aiTab?.model) {
3132
aiTab.model.chatId = response.customData;
3233
aiTab.visible = true;
3334
}

web-document-viewer.png

-50.6 KB
Loading

web-report-designer.png

-173 KB
Loading

0 commit comments

Comments
 (0)