fix: replace crypto.randomUUID with polyfill for HTTP contexts

crypto.randomUUID() is only available in secure contexts (HTTPS/localhost).
Add uuid() utility with fallback for HTTP deployments.
This commit is contained in:
t8y2
2026-05-05 23:51:07 +08:00
parent 4e5a7cb40a
commit 0aa562f6ee
16 changed files with 48 additions and 23 deletions
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, ref, watch } from "vue";
import { uuid } from "@/lib/utils";
import { useI18n } from "vue-i18n";
import { isTauriRuntime } from "@/lib/tauriRuntime";
import { Dialog, DialogFooter, DialogHeader, DialogScrollContent, DialogTitle } from "@/components/ui/dialog";
@@ -234,7 +235,7 @@ async function selectFile() {
async function startExecution() {
if (!canStart.value || !preview.value) return;
const id = crypto.randomUUID();
const id = uuid();
executionId.value = id;
running.value = true;
cancelling.value = false;