fix(adminui): preserve historize on Galaxy re-pick + clear stale script-create error (review)
This commit is contained in:
@@ -298,10 +298,16 @@
|
|||||||
private void OnGalaxyAddressPicked(string address)
|
private void OnGalaxyAddressPicked(string address)
|
||||||
{
|
{
|
||||||
_galaxyAddress = address;
|
_galaxyAddress = address;
|
||||||
var config = JsonSerializer.Serialize(new { FullName = address });
|
// A fresh {FullName} blob would drop any tag-level historize the operator already set on this
|
||||||
|
// edit; re-merge it so re-picking a Galaxy address never silently clears "Historize this tag".
|
||||||
|
var config = TagHistorizeConfig.Set(
|
||||||
|
JsonSerializer.Serialize(new { FullName = address }),
|
||||||
|
_historizeState.IsHistorized,
|
||||||
|
_historizeState.HistorianTagname);
|
||||||
_form.TagConfig = _galaxyPickedIsAlarm
|
_form.TagConfig = _galaxyPickedIsAlarm
|
||||||
? NativeAlarmModel.SeedDefaultAlarm(config)
|
? NativeAlarmModel.SeedDefaultAlarm(config)
|
||||||
: config;
|
: config;
|
||||||
|
_historizeState = TagHistorizeConfig.Read(_form.TagConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IDictionary<string, object> BuildEditorParameters() => new Dictionary<string, object>
|
private IDictionary<string, object> BuildEditorParameters() => new Dictionary<string, object>
|
||||||
|
|||||||
@@ -260,6 +260,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
_error = null;
|
_error = null;
|
||||||
|
_scriptCreateError = null;
|
||||||
_scriptExpanded = false;
|
_scriptExpanded = false;
|
||||||
|
|
||||||
// Load the bound script's source for the inline panel when editing an existing tag that
|
// Load the bound script's source for the inline panel when editing an existing tag that
|
||||||
|
|||||||
Reference in New Issue
Block a user