本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
使用共用 QuickSight 檢視
建立新的共用檢視後,請使用內嵌SDK讓其他使用者的共用檢視消耗。下列範例為 Amazon 中的內嵌儀表板設定消耗性共用檢視 QuickSight。
- With an appended URL
-
在 URL下將 附加
sharedViewId
至內嵌/views/{viewId}
,並將其公開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; };
建立共用檢視
單鍵內嵌