mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 13:06:01 +00:00
database & connection color overrides
This commit is contained in:
@@ -6,22 +6,33 @@
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
export let header;
|
||||
|
||||
const initialColor = useConnectionColor({ conid, database }, null);
|
||||
const initialColor = useConnectionColor({ conid, database }, null, null, false, false);
|
||||
|
||||
$: value = $initialColor;
|
||||
</script>
|
||||
|
||||
<ModalBase {...$$restProps}>
|
||||
<svelte:fragment slot="header">{header}</svelte:fragment>
|
||||
|
||||
<ColorSelector
|
||||
{value}
|
||||
on:change={e => {
|
||||
value = e.detail;
|
||||
|
||||
axiosInstance.post('connections/update', {
|
||||
_id: conid,
|
||||
values: { connectionColor: e.detail },
|
||||
});
|
||||
if (database) {
|
||||
axiosInstance.post('connections/update-database', {
|
||||
conid,
|
||||
database,
|
||||
values: { databaseColor: e.detail },
|
||||
});
|
||||
} else {
|
||||
axiosInstance.post('connections/update', {
|
||||
_id: conid,
|
||||
values: { connectionColor: e.detail },
|
||||
});
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</ModalBase>
|
||||
|
||||
Reference in New Issue
Block a user