database & connection color overrides

This commit is contained in:
Jan Prochazka
2021-12-05 11:08:17 +01:00
parent 5ca54220b5
commit 50dbb9d1bd
9 changed files with 127 additions and 30 deletions

View File

@@ -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>