mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 15:03:57 +00:00
fix
This commit is contained in:
@@ -315,7 +315,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$: isPinned = !!$pinnedDatabases.find(x => x.name == data.name && x.connection?._id == data.connection?._id);
|
$: isPinned = !!$pinnedDatabases.find(x => x?.name == data.name && x?.connection?._id == data.connection?._id);
|
||||||
$: apps = useUsedApps();
|
$: apps = useUsedApps();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,13 @@
|
|||||||
if (!compare(dragged, data)) {
|
if (!compare(dragged, data)) {
|
||||||
const i1 = _.findIndex(pinned, x => compare(x, dragged));
|
const i1 = _.findIndex(pinned, x => compare(x, dragged));
|
||||||
const i2 = _.findIndex(pinned, x => compare(x, data));
|
const i2 = _.findIndex(pinned, x => compare(x, data));
|
||||||
const newPinned = [...pinned];
|
if (i1 >= 0 && i2 >= 0 && i1 != i2) {
|
||||||
const tmp = newPinned[i1];
|
const newPinned = [...pinned];
|
||||||
newPinned[i1] = newPinned[i2];
|
const tmp = newPinned[i1];
|
||||||
newPinned[i2] = tmp;
|
newPinned[i1] = newPinned[i2];
|
||||||
setPinned(newPinned);
|
newPinned[i2] = tmp;
|
||||||
|
setPinned(newPinned);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -29,42 +31,44 @@
|
|||||||
export let data;
|
export let data;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if data.objectTypeField}
|
{#if data}
|
||||||
<DatabaseObjectAppObject
|
{#if data.objectTypeField}
|
||||||
{...$$props}
|
<DatabaseObjectAppObject
|
||||||
on:dragstart={() => {
|
{...$$props}
|
||||||
$draggedPinnedObject = data;
|
on:dragstart={() => {
|
||||||
}}
|
$draggedPinnedObject = data;
|
||||||
on:dragenter={e => {
|
}}
|
||||||
dragExchange(
|
on:dragenter={e => {
|
||||||
$draggedPinnedObject,
|
dragExchange(
|
||||||
data,
|
$draggedPinnedObject,
|
||||||
$pinnedTables,
|
data,
|
||||||
value => ($pinnedTables = value),
|
$pinnedTables,
|
||||||
(a, b) => a?.pureName == b?.pureName && a?.schemaName == b?.schemaName
|
value => ($pinnedTables = value),
|
||||||
);
|
(a, b) => a?.pureName == b?.pureName && a?.schemaName == b?.schemaName
|
||||||
}}
|
);
|
||||||
on:dragend={() => {
|
}}
|
||||||
$draggedPinnedObject = null;
|
on:dragend={() => {
|
||||||
}}
|
$draggedPinnedObject = null;
|
||||||
/>
|
}}
|
||||||
{:else}
|
/>
|
||||||
<DatabaseAppObject
|
{:else}
|
||||||
{...$$props}
|
<DatabaseAppObject
|
||||||
on:dragstart={() => {
|
{...$$props}
|
||||||
$draggedPinnedObject = data;
|
on:dragstart={() => {
|
||||||
}}
|
$draggedPinnedObject = data;
|
||||||
on:dragenter={e => {
|
}}
|
||||||
dragExchange(
|
on:dragenter={e => {
|
||||||
$draggedPinnedObject,
|
dragExchange(
|
||||||
data,
|
$draggedPinnedObject,
|
||||||
$pinnedDatabases,
|
data,
|
||||||
value => ($pinnedDatabases = value),
|
$pinnedDatabases,
|
||||||
(a, b) => a?.name == b?.name && a?.connection?._id == b?.connection?._id
|
value => ($pinnedDatabases = value),
|
||||||
);
|
(a, b) => a?.name == b?.name && a?.connection?._id == b?.connection?._id
|
||||||
}}
|
);
|
||||||
on:dragend={() => {
|
}}
|
||||||
$draggedPinnedObject = null;
|
on:dragend={() => {
|
||||||
}}
|
$draggedPinnedObject = null;
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user