mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-17 05:17:30 +01:00
Migrate config, migrate analysis plotselection
This commit is contained in:
@@ -12,17 +12,26 @@
|
||||
import PlotRenderOptions from "./user/PlotRenderOptions.svelte";
|
||||
import PlotColorScheme from "./user/PlotColorScheme.svelte";
|
||||
|
||||
export let username
|
||||
export let isApi
|
||||
/* Svelte 5 Props */
|
||||
let {
|
||||
username,
|
||||
isApi
|
||||
} = $props();
|
||||
|
||||
/* Const Init */
|
||||
const ccconfig = getContext("cc-config");
|
||||
let message = { msg: "", target: "", color: "#d63384" };
|
||||
let displayMessage = false;
|
||||
let cbmode = ccconfig?.plot_general_colorblindMode || false;
|
||||
|
||||
/* State Init */
|
||||
let message = $state({ msg: "", target: "", color: "#d63384" });
|
||||
let displayMessage = $state(false);
|
||||
let cbmode = $state(ccconfig?.plot_general_colorblindMode || false);
|
||||
|
||||
async function handleSettingSubmit(event) {
|
||||
const selector = event.detail.selector
|
||||
const target = event.detail.target
|
||||
/* Functions */
|
||||
async function handleSettingSubmit(event, setting) {
|
||||
event.preventDefault();
|
||||
|
||||
const selector = setting.selector
|
||||
const target = setting.target
|
||||
let form = document.querySelector(selector);
|
||||
let formData = new FormData(form);
|
||||
try {
|
||||
@@ -53,6 +62,6 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<UserOptions config={ccconfig} {username} {isApi} bind:message bind:displayMessage on:update-config={(e) => handleSettingSubmit(e)}/>
|
||||
<PlotRenderOptions config={ccconfig} bind:message bind:displayMessage on:update-config={(e) => handleSettingSubmit(e)}/>
|
||||
<PlotColorScheme config={ccconfig} bind:cbmode bind:message bind:displayMessage on:update-config={(e) => handleSettingSubmit(e)}/>
|
||||
<UserOptions config={ccconfig} {username} {isApi} bind:message bind:displayMessage updateSetting={(e, newSetting) => handleSettingSubmit(e, newSetting)}/>
|
||||
<PlotRenderOptions config={ccconfig} bind:message bind:displayMessage updateSetting={(e, newSetting) => handleSettingSubmit(e, newSetting)}/>
|
||||
<PlotColorScheme config={ccconfig} bind:cbmode bind:message bind:displayMessage updateSetting={(e, newSetting) => handleSettingSubmit(e, newSetting)}/>
|
||||
|
||||
Reference in New Issue
Block a user