mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-13 12:47:21 +00:00
Fixed plugin values which depended on the region settings of the computer (#1194)
This commit is contained in:
1 parent
65d50de033
commit
a1b493cb13
20 files changed
+397
-137
No files matched your search
@@ -32,14 +32,6 @@ internal sealed class AssistantDropdown : StatefulAssistantComponentBase
|
||||
set => this.Props[nameof(this.Items)] = value;
|
||||
}
|
||||
|
||||
public string ValueType
|
||||
{
|
||||
get => this.Props.TryGetValue(nameof(this.ValueType), out var v)
|
||||
? v.ToString() ?? "string"
|
||||
: "string";
|
||||
set => this.Props[nameof(this.ValueType)] = value;
|
||||
}
|
||||
|
||||
public bool IsMultiselect
|
||||
{
|
||||
get => AssistantComponentPropHelper.ReadBool(this.Props, nameof(this.IsMultiselect));
|
||||
@@ -141,28 +133,6 @@ internal sealed class AssistantDropdown : StatefulAssistantComponentBase
|
||||
return [this.Default, .. this.Items];
|
||||
}
|
||||
|
||||
public IEnumerable<object> GetParsedDropdownValues()
|
||||
{
|
||||
foreach (var item in this.Items)
|
||||
{
|
||||
switch (this.ValueType.ToLowerInvariant())
|
||||
{
|
||||
case "int":
|
||||
if (int.TryParse(item.Value, out var i)) yield return i;
|
||||
break;
|
||||
case "double":
|
||||
if (double.TryParse(item.Value, out var d)) yield return d;
|
||||
break;
|
||||
case "bool":
|
||||
if (bool.TryParse(item.Value, out var b)) yield return b;
|
||||
break;
|
||||
default:
|
||||
yield return item.Value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string Class
|
||||
{
|
||||
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Class));
|
||||
|
||||
Reference in new issue
Block a user