Tableau Download [repack] Versions Site
// Optional: generate signed URL if using S3 res.json( download_url: asset.download_url, checksum: asset.checksum_sha256 ); ); // TableauVersions.jsx import useState, useEffect from 'react'; export default function TableauVersions() const [versions, setVersions] = useState([]); const [filters, setFilters] = useState( product: 'Desktop', os: [], status: 'active' ); const [selectedVersion, setSelectedVersion] = useState(null);
const handleDownload = async (version, os) => const res = await fetch( /api/tableau/versions/$version.id/download?os=$os ); const download_url, checksum = await res.json(); window.open(download_url, '_blank'); alert( Download started. SHA256: $checksum ); ; tableau download versions
useEffect(() => fetch( /api/tableau/versions?$new URLSearchParams(filters) ) .then(res => res.json()) .then(setVersions); , [filters]); // Optional: generate signed URL if using S3 res
// Log download for analytics await prisma.download_log.create( data: version_id: id, os, user_ip: req.ip, downloaded_at: new Date() ); checksum: asset.checksum_sha256 )
0 Komentar