本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用共用的 Amazon Quick Sight 檢視
建立新的共用檢視後,請使用嵌入式 SDK 讓其他使用者也可使用共用檢視。以下範例為 Amazon Quick Sight 中的內嵌儀表板設定消耗性共用檢視。
- With an appended URL
-
在
/views/{viewId}下,將sharedViewId附加至嵌入式 URL,並將此 URL 公開給您的使用者。使用者可以使用此 URL 來導覽至該共用檢視。const response = await dashboardFrame.createSharedView(); const newEmbedUrl = await generateNewEmbedUrl(); const formattedUrl = new URL(newEmbedUrl); formattedUrl.pathname = formattedUrl.pathname.concat('/views/' + response.message.sharedViewId); const baseUrl = formattedUrl.href; alert("Click to view this QuickSight shared view", baseUrl); - With the contentOptions SDK
-
將
viewId傳遞至contentOptions,以開啟具有指定viewId的檢視。const contentOptions = { toolbarOptions: { ... }, viewId: sharedViewId, }; const embeddedDashboard = await embeddingContext.embedDashboard( {container: containerRef.current}, contentOptions ); - With the InitialPath property
-
const shareView = async() => { const returnValue = await consoleFrame.createSharedView(); const {dashboardId, sharedViewId} = returnValue.message; const newEmbedUrl = await generateNewEmbedUrl(`/dashboards/${dashboardId}/views/${sharedViewId}`); setShareUrl(newEmbedUrl); }; const generateNewEmbedUrl = async (initialPath) => { const generateUrlPayload = { experienceConfiguration: { QuickSightConsole: { InitialPath: initialPath, FeatureConfigurations: { "SharedView": { "Enabled": true }, }, }, } const result: GenerateEmbedUrlResult = await generateEmbedUrlForRegisteredUser(generateUrlPayload); return result.url; };
建立共用檢視
一鍵式嵌入