mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-21 15:22:20 +02:00
save config
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
}
|
||||
|
||||
&__toolbar {
|
||||
margin-top: var(--padding-default);
|
||||
padding-top: var(--padding-default);
|
||||
display: flex;
|
||||
flex-flow: row;
|
||||
|
||||
@@ -32,13 +32,6 @@ pub fn ApiConfigView() -> Html {
|
||||
ApiConfigFormState { form: ConfigApiDto::default(), modified: false }
|
||||
});
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
use_effect_with(form_state.clone(), move |state| {
|
||||
on_form_change.emit(ConfigForm::Api(state.modified, state.form.clone()));
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
@@ -48,61 +41,6 @@ pub fn ApiConfigView() -> Html {
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let deps = (form_state.form.clone(), form_state.modified);
|
||||
use_effect_with(deps, move |(form, modified)| {
|
||||
on_form_change.emit(ConfigForm::Api(*modified, form.clone()));
|
||||
|| ()
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
let form_state = form_state.clone();
|
||||
let api_config = config_ctx
|
||||
|
||||
@@ -87,10 +87,11 @@ pub fn VideoConfigView() -> Html {
|
||||
let on_form_change = config_view_ctx.on_form_change.clone();
|
||||
let download_state = download_state.clone();
|
||||
let video_state = video_state.clone();
|
||||
use_effect_with((video_state, download_state), move |(v, d)| {
|
||||
use_effect_with((video_state.modified, download_state.modified, video_state, download_state),
|
||||
move |(vm, dm, v, d)| {
|
||||
let mut form = v.form.clone();
|
||||
form.download = Some(d.form.clone());
|
||||
let modified = v.modified || d.modified;
|
||||
form.download = if *dm { Some(d.form.clone()) } else { form.download };
|
||||
let modified = *vm || *dm;
|
||||
on_form_change.emit(ConfigForm::Video(modified, form));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,12 +80,13 @@ pub fn WebUiConfigView() -> Html {
|
||||
let auth_state = auth_state.clone();
|
||||
let csp_state = csp_state.clone();
|
||||
|
||||
use_effect_with((webui_state, auth_state, csp_state), move |(w, a, c)| {
|
||||
use_effect_with((webui_state.modified, auth_state.modified, csp_state.modified, webui_state, auth_state, csp_state),
|
||||
move |(wm, am, cm, w, a, c)| {
|
||||
let mut form = w.form.clone();
|
||||
form.auth = Some(a.form.clone());
|
||||
form.content_security_policy = Some(c.form.clone());
|
||||
|
||||
let modified = w.modified || a.modified || c.modified;
|
||||
let modified = *wm || *am || *cm;
|
||||
on_form_change.emit(ConfigForm::WebUi(modified, form));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user