refac
This commit is contained in:
1 parent
4d99baa292
commit
251b80ebec
6 files changed
+13
-69
No files matched your search
@@ -6,7 +6,6 @@
|
|||||||
import Switch from '$lib/components/common/Switch.svelte';
|
import Switch from '$lib/components/common/Switch.svelte';
|
||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
|
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import Wrench from '$lib/components/icons/Wrench.svelte';
|
import Wrench from '$lib/components/icons/Wrench.svelte';
|
||||||
@@ -22,7 +21,6 @@
|
|||||||
|
|
||||||
let showManageModal = false;
|
let showManageModal = false;
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
let showDeleteConfirmDialog = false;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
@@ -35,7 +33,8 @@
|
|||||||
config: config
|
config: config
|
||||||
}}
|
}}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
showDeleteConfirmDialog = true;
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
}}
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
@@ -44,14 +43,6 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteConfirmDialog}
|
|
||||||
on:confirm={() => {
|
|
||||||
onDelete();
|
|
||||||
showConfigModal = false;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ManageOllamaModal bind:show={showManageModal} urlIdx={idx} />
|
<ManageOllamaModal bind:show={showManageModal} urlIdx={idx} />
|
||||||
|
|
||||||
<div class="flex gap-1.5">
|
<div class="flex gap-1.5">
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
|
|
||||||
import { connect } from 'socket.io-client';
|
import { connect } from 'socket.io-client';
|
||||||
|
|
||||||
@@ -21,16 +20,8 @@
|
|||||||
export let config = {};
|
export let config = {};
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
let showDeleteConfirmDialog = false;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteConfirmDialog}
|
|
||||||
on:confirm={() => {
|
|
||||||
onDelete();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
edit
|
edit
|
||||||
bind:show={showConfigModal}
|
bind:show={showConfigModal}
|
||||||
@@ -40,7 +31,8 @@
|
|||||||
config
|
config
|
||||||
}}
|
}}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
showDeleteConfirmDialog = true;
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
}}
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
|
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
|
||||||
import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte';
|
import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getToolServerConnections,
|
getToolServerConnections,
|
||||||
@@ -40,8 +40,7 @@
|
|||||||
let terminalConnections = [];
|
let terminalConnections = [];
|
||||||
let showAddTerminalModal = false;
|
let showAddTerminalModal = false;
|
||||||
let editTerminalIdx: number | null = null;
|
let editTerminalIdx: number | null = null;
|
||||||
let showDeleteTerminalConfirm = false;
|
|
||||||
let deleteTerminalIdx: number | null = null;
|
|
||||||
|
|
||||||
const addConnectionHandler = async (server) => {
|
const addConnectionHandler = async (server) => {
|
||||||
servers = [...servers, server];
|
servers = [...servers, server];
|
||||||
@@ -135,23 +134,12 @@
|
|||||||
}}
|
}}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
if (editTerminalIdx !== null) {
|
if (editTerminalIdx !== null) {
|
||||||
deleteTerminalIdx = editTerminalIdx;
|
removeTerminalConnection(editTerminalIdx);
|
||||||
showDeleteTerminalConfirm = true;
|
|
||||||
editTerminalIdx = null;
|
editTerminalIdx = null;
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteTerminalConfirm}
|
|
||||||
on:confirm={() => {
|
|
||||||
if (deleteTerminalIdx !== null) {
|
|
||||||
removeTerminalConnection(deleteTerminalIdx);
|
|
||||||
deleteTerminalIdx = null;
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<form
|
<form
|
||||||
class="flex flex-col h-full justify-between text-sm"
|
class="flex flex-col h-full justify-between text-sm"
|
||||||
on:submit|preventDefault={() => {
|
on:submit|preventDefault={() => {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
import AddConnectionModal from '$lib/components/AddConnectionModal.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
|
|
||||||
export let onDelete = () => {};
|
export let onDelete = () => {};
|
||||||
export let onSubmit = () => {};
|
export let onSubmit = () => {};
|
||||||
@@ -20,7 +19,6 @@
|
|||||||
export let config = {};
|
export let config = {};
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
let showDeleteConfirmDialog = false;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddConnectionModal
|
<AddConnectionModal
|
||||||
@@ -33,7 +31,8 @@
|
|||||||
config
|
config
|
||||||
}}
|
}}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
showDeleteConfirmDialog = true;
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
}}
|
}}
|
||||||
onSubmit={(connection) => {
|
onSubmit={(connection) => {
|
||||||
url = connection.url;
|
url = connection.url;
|
||||||
@@ -43,14 +42,6 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteConfirmDialog}
|
|
||||||
on:confirm={() => {
|
|
||||||
onDelete();
|
|
||||||
showConfigModal = false;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="flex w-full gap-2 items-center">
|
<div class="flex w-full gap-2 items-center">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
className="w-full relative"
|
className="w-full relative"
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
import Switch from '$lib/components/common/Switch.svelte';
|
import Switch from '$lib/components/common/Switch.svelte';
|
||||||
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
import Tooltip from '$lib/components/common/Tooltip.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte';
|
import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte';
|
||||||
import Cloud from '$lib/components/icons/Cloud.svelte';
|
import Cloud from '$lib/components/icons/Cloud.svelte';
|
||||||
|
|
||||||
@@ -16,7 +15,6 @@
|
|||||||
export let onDisable: () => void = () => {};
|
export let onDisable: () => void = () => {};
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
let showDeleteConfirmDialog = false;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddTerminalServerModal
|
<AddTerminalServerModal
|
||||||
@@ -25,7 +23,8 @@
|
|||||||
bind:show={showConfigModal}
|
bind:show={showConfigModal}
|
||||||
{connection}
|
{connection}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
showDeleteConfirmDialog = true;
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
}}
|
}}
|
||||||
onSubmit={(c) => {
|
onSubmit={(c) => {
|
||||||
connection = c;
|
connection = c;
|
||||||
@@ -33,14 +32,6 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteConfirmDialog}
|
|
||||||
on:confirm={() => {
|
|
||||||
onDelete();
|
|
||||||
showConfigModal = false;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="flex w-full gap-2 items-center">
|
<div class="flex w-full gap-2 items-center">
|
||||||
<Tooltip className="w-full relative" content={''} placement="top-start">
|
<Tooltip className="w-full relative" content={''} placement="top-start">
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
import Switch from '$lib/components/common/Switch.svelte';
|
import Switch from '$lib/components/common/Switch.svelte';
|
||||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||||
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
import Cog6 from '$lib/components/icons/Cog6.svelte';
|
||||||
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
|
|
||||||
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
|
import AddToolServerModal from '$lib/components/AddToolServerModal.svelte';
|
||||||
import WrenchAlt from '$lib/components/icons/WrenchAlt.svelte';
|
import WrenchAlt from '$lib/components/icons/WrenchAlt.svelte';
|
||||||
|
|
||||||
@@ -17,7 +16,6 @@
|
|||||||
export let direct = false;
|
export let direct = false;
|
||||||
|
|
||||||
let showConfigModal = false;
|
let showConfigModal = false;
|
||||||
let showDeleteConfirmDialog = false;
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<AddToolServerModal
|
<AddToolServerModal
|
||||||
@@ -26,7 +24,8 @@
|
|||||||
bind:show={showConfigModal}
|
bind:show={showConfigModal}
|
||||||
{connection}
|
{connection}
|
||||||
onDelete={() => {
|
onDelete={() => {
|
||||||
showDeleteConfirmDialog = true;
|
onDelete();
|
||||||
|
showConfigModal = false;
|
||||||
}}
|
}}
|
||||||
onSubmit={(c) => {
|
onSubmit={(c) => {
|
||||||
connection = c;
|
connection = c;
|
||||||
@@ -34,14 +33,6 @@
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
bind:show={showDeleteConfirmDialog}
|
|
||||||
on:confirm={() => {
|
|
||||||
onDelete();
|
|
||||||
showConfigModal = false;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="flex w-full gap-2 items-center">
|
<div class="flex w-full gap-2 items-center">
|
||||||
<Tooltip className="w-full relative" content={''} placement="top-start">
|
<Tooltip className="w-full relative" content={''} placement="top-start">
|
||||||
<div class="flex w-full">
|
<div class="flex w-full">
|
||||||
|
|||||||
Reference in new issue
Block a user