mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-14 04:08:46 +00:00
refac
This commit is contained in:
parent
2eb77fc27f
commit
d786ed56c9
7 changed files with 14 additions and 8 deletions
|
|
@ -119,7 +119,7 @@
|
|||
const addTerminalConnection = (server: TerminalConnection) => {
|
||||
terminalConnections = [
|
||||
...terminalConnections,
|
||||
{ ...server, id: server.id ?? crypto.randomUUID?.() ?? uuidv4() }
|
||||
{ ...server, id: server.id ?? uuidv4() }
|
||||
];
|
||||
saveTerminalServers();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import fileSaver from 'file-saver';
|
||||
const { saveAs } = fileSaver;
|
||||
|
||||
|
|
@ -224,7 +225,7 @@
|
|||
|
||||
// Add system message if present
|
||||
if (system) {
|
||||
const systemId = crypto.randomUUID();
|
||||
const systemId = uuidv4();
|
||||
messagesMap[systemId] = {
|
||||
id: systemId,
|
||||
parentId: null,
|
||||
|
|
@ -238,7 +239,7 @@
|
|||
|
||||
// Add conversation messages
|
||||
for (const msg of messages) {
|
||||
const msgId = crypto.randomUUID();
|
||||
const msgId = uuidv4();
|
||||
|
||||
// Link parent to child
|
||||
if (parentId && messagesMap[parentId]) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { getContext, onDestroy } from 'svelte';
|
||||
import {
|
||||
AVATAR_MAX_BYTES,
|
||||
|
|
@ -39,7 +40,7 @@
|
|||
error = $i18n.t('Choose a VRMA file, up to 10 MiB.');
|
||||
return;
|
||||
}
|
||||
const id = crypto.randomUUID();
|
||||
const id = uuidv4();
|
||||
animationFiles = { ...animationFiles, [id]: selected };
|
||||
if (typeof animationTarget === 'number') {
|
||||
value = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import WorkspaceAccessModal from './common/WorkspaceAccessModal.svelte';
|
||||
let accessModal: WorkspaceAccessModal;
|
||||
import { resolveLocalizedResource } from '$lib/utils/localizedContent';
|
||||
|
|
@ -251,7 +252,7 @@
|
|||
|
||||
const cloneHandler = async (skill) => {
|
||||
try {
|
||||
const suffix = crypto.randomUUID().slice(0, 7);
|
||||
const suffix = uuidv4().slice(0, 7);
|
||||
const result = await cloneSkill(
|
||||
localStorage.token,
|
||||
skill.id,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
|
||||
import { toast } from 'svelte-sonner';
|
||||
|
|
@ -204,7 +205,7 @@
|
|||
};
|
||||
const saveCopy = async () => {
|
||||
try {
|
||||
const suffix = crypto.randomUUID().slice(0, 7);
|
||||
const suffix = uuidv4().slice(0, 7);
|
||||
const result = await createNewSkill(localStorage.token, {
|
||||
id: `${id}-${suffix}`,
|
||||
name: `${name} (${suffix})`,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { onDestroy, getContext, tick, type Snippet } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { createFocusTrap } from 'focus-trap';
|
||||
|
|
@ -78,7 +79,7 @@
|
|||
let newName = '';
|
||||
let newNameInput: HTMLInputElement;
|
||||
let dialog = { show: false, title: '', input: false, value: '', action: (_: string) => {} };
|
||||
const dragType = `application/x-skill-file-${crypto.randomUUID()}`;
|
||||
const dragType = `application/x-skill-file-${uuidv4()}`;
|
||||
|
||||
const ask = (title: string, input: boolean, action: (value: string) => void, value = '') => {
|
||||
dialog = { show: true, title, input, value, action };
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { AUDIO_API_BASE_URL } from '$lib/constants';
|
||||
|
||||
export type BridgeSubmission = {
|
||||
|
|
@ -122,7 +123,7 @@ export class RealtimeCall {
|
|||
this.connecting = true;
|
||||
this.options.change();
|
||||
const session = ++this.session;
|
||||
this.callId = crypto.randomUUID();
|
||||
this.callId = uuidv4();
|
||||
try {
|
||||
const context = this.options.context();
|
||||
this.token = token;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue