14 files changed
+88
-23
No files matched your search
@@ -7,6 +7,7 @@ import type { UpdateDownloadSource as SettingsUpdateDownloadSource } from "@/sto
|
||||
import type { UpdateDownloadProgress } from "@/lib/backend/tauri";
|
||||
import { currentLocale } from "@/i18n";
|
||||
import { shouldBlockAppUpdate } from "@/lib/app/appUpdateTaskGuard";
|
||||
import { uuid } from "@/lib/common/utils";
|
||||
|
||||
interface UseAppUpdaterOptions {
|
||||
getActiveTaskCount?: () => number;
|
||||
@@ -266,7 +267,7 @@ export function useAppUpdater(options: UseAppUpdaterOptions = {}) {
|
||||
automaticDownload = automatic;
|
||||
const version = updateInfo.value!.latest_version;
|
||||
const token = ++generation;
|
||||
const attemptId = crypto.randomUUID();
|
||||
const attemptId = uuid();
|
||||
phase.value = "downloading";
|
||||
downloadProgress.value = null;
|
||||
clearError();
|
||||
|
||||
@@ -2,6 +2,7 @@ import { computed, ref, toValue, watch, type MaybeRefOrGetter } from "vue";
|
||||
import { filterModeNeedsValue, filterModeUsesRange } from "@/lib/dataGrid/dataGridColumnFilter";
|
||||
import type { DataGridContextFilterMode } from "@/lib/dataGrid/dataGridSql";
|
||||
import { matchesIdentifierSearch } from "@/lib/sql/identifierSearch";
|
||||
import { uuid } from "@/lib/common/utils";
|
||||
|
||||
export type DataGridStructuredFilterRule = {
|
||||
id: string;
|
||||
@@ -80,7 +81,7 @@ export function useDataGridFilterBuilder(options: UseDataGridFilterBuilderOption
|
||||
const activeCount = computed(() => rules.value.filter((rule) => !rule.disabled && rule.columnName && options.isComplete(rule)).length);
|
||||
|
||||
function defaultRule(): DataGridStructuredFilterRule {
|
||||
return { id: options.createId?.() ?? crypto.randomUUID(), columnName: "", mode: "equals", rawValue: "", rawEndValue: "", conjunction: "AND" };
|
||||
return { id: options.createId?.() ?? uuid(), columnName: "", mode: "equals", rawValue: "", rawEndValue: "", conjunction: "AND" };
|
||||
}
|
||||
function ensureRule() {
|
||||
if (!rules.value.length && toValue(options.columns).length) rules.value = [defaultRule()];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { reactive, computed } from "vue";
|
||||
import * as api from "@/lib/backend/api";
|
||||
import { isTerminalTransferProgress } from "@/lib/backend/transferProgress";
|
||||
import { uuid } from "@/lib/common/utils";
|
||||
|
||||
export type BackgroundTaskKind = "table-export" | "database-export" | "sql-file" | "data-transfer" | "multi-db-execution" | "schema-diff" | "data-compare";
|
||||
export type BackgroundTaskStatus = "Running" | "Writing" | "Cancelling" | "Done" | "Error" | "Cancelled";
|
||||
@@ -387,20 +388,8 @@ export function useExportTracker() {
|
||||
|
||||
const hasActive = computed(() => activeCount.value > 0);
|
||||
|
||||
function generateUUID() {
|
||||
if (typeof crypto !== "undefined" && crypto.randomUUID) {
|
||||
return crypto.randomUUID();
|
||||
}
|
||||
let buffer = new Uint8Array(16);
|
||||
crypto.getRandomValues(buffer);
|
||||
buffer[6] = (buffer[6] & 0x0f) | 0x40;
|
||||
return Array.from(buffer, (b) => b.toString(16).padStart(2, "0"))
|
||||
.join("")
|
||||
.replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, "$1-$2-$3-$4-$5");
|
||||
}
|
||||
|
||||
function addTask(tableName: string, format: string, filePath: string, exportId?: string): ExportTask {
|
||||
const id = exportId ?? generateUUID();
|
||||
const id = exportId ?? uuid();
|
||||
const task = reactive<ExportTask>({
|
||||
exportId: id,
|
||||
kind: "table-export",
|
||||
|
||||
Reference in new issue
Block a user