mirror of
https://github.com/open-webui/open-webui.git
synced 2025-03-17 21:32:42 +01:00
refac
This commit is contained in:
parent
cd3904046d
commit
e06111a362
@ -1,8 +1,7 @@
|
||||
<script>
|
||||
import { getContext, createEventDispatcher, onMount, tick } from 'svelte';
|
||||
import { getContext, onMount, tick } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
import CodeEditor from '$lib/components/common/CodeEditor.svelte';
|
||||
@ -15,6 +14,8 @@
|
||||
let loading = false;
|
||||
let showConfirm = false;
|
||||
|
||||
export let onSave = () => {};
|
||||
|
||||
export let edit = false;
|
||||
export let clone = false;
|
||||
|
||||
@ -256,7 +257,7 @@ class Pipe:
|
||||
|
||||
const saveHandler = async () => {
|
||||
loading = true;
|
||||
dispatch('save', {
|
||||
onSave({
|
||||
id,
|
||||
name,
|
||||
meta,
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { getContext, createEventDispatcher, onMount, tick } from 'svelte';
|
||||
import { getContext, onMount, tick } from 'svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
|
||||
@ -12,8 +12,6 @@
|
||||
import LockClosed from '$lib/components/icons/LockClosed.svelte';
|
||||
import AccessControlModal from '../common/AccessControlModal.svelte';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
let formElement = null;
|
||||
let loading = false;
|
||||
|
||||
@ -23,6 +21,8 @@
|
||||
export let edit = false;
|
||||
export let clone = false;
|
||||
|
||||
export let onSave = () => {};
|
||||
|
||||
export let id = '';
|
||||
export let name = '';
|
||||
export let meta = {
|
||||
@ -150,7 +150,7 @@ class Tools:
|
||||
|
||||
const saveHandler = async () => {
|
||||
loading = true;
|
||||
dispatch('save', {
|
||||
onSave({
|
||||
id,
|
||||
name,
|
||||
meta,
|
||||
|
@ -95,8 +95,8 @@
|
||||
meta={func?.meta ?? { description: '' }}
|
||||
content={func?.content ?? ''}
|
||||
{clone}
|
||||
on:save={(e) => {
|
||||
saveHandler(e.detail);
|
||||
onSave={(value) => {
|
||||
saveHandler(value);
|
||||
}}
|
||||
/>
|
||||
{/key}
|
||||
|
@ -80,8 +80,8 @@
|
||||
name={func.name}
|
||||
meta={func.meta}
|
||||
content={func.content}
|
||||
on:save={(e) => {
|
||||
saveHandler(e.detail);
|
||||
onSave={(value) => {
|
||||
saveHandler(value);
|
||||
}}
|
||||
/>
|
||||
{:else}
|
||||
|
@ -89,8 +89,8 @@
|
||||
content={tool?.content ?? ''}
|
||||
access_control={null}
|
||||
{clone}
|
||||
on:save={(e) => {
|
||||
saveHandler(e.detail);
|
||||
onSave={(value) => {
|
||||
saveHandler(value);
|
||||
}}
|
||||
/>
|
||||
{/key}
|
||||
|
@ -75,8 +75,8 @@
|
||||
meta={tool.meta}
|
||||
content={tool.content}
|
||||
accessControl={tool.access_control}
|
||||
on:save={(e) => {
|
||||
saveHandler(e.detail);
|
||||
onSave={(value) => {
|
||||
saveHandler(value);
|
||||
}}
|
||||
/>
|
||||
{:else}
|
||||
|
Loading…
x
Reference in New Issue
Block a user