forked from SciSharp/BotSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginMenuDef.cs
More file actions
84 lines (66 loc) · 2.44 KB
/
PluginMenuDef.cs
File metadata and controls
84 lines (66 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
namespace BotSharp.Abstraction.Plugins.Models;
public class PluginMenuDef(string label, string? link = null, string? icon = null, int weight = 0)
{
[JsonIgnore]
public string Id { get; set; } = default!;
public string Label { get; set; } = label;
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Icon { get; set; } = icon;
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Link { get; set; } = link;
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public EmbeddingData? EmbeddingInfo { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IsHeader { get; set; }
[JsonIgnore]
public int Weight { get; set; } = weight;
[JsonIgnore]
public List<string>? Roles { get; set; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<PluginMenuDef>? SubMenu { get; set; }
public override string ToString()
{
return $"{Label} {Link} {Weight}";
}
}
public class EmbeddingData
{
/// <summary>
/// Embedding source, e.g., tableau
/// </summary>
public string Source { get; set; } = default!;
/// <summary>
/// Embedding url
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Url { get; set; }
/// <summary>
/// Html tag
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? HtmlTag { get; set; }
/// <summary>
/// Html element style
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? HtmlStyle { get; set; } = "justify-content: center; width: 100%; height: 100%;";
/// <summary>
/// Javascript script src
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ScriptSrc { get; set; }
/// <summary>
/// Javascript script type, e.g., module
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ScriptType { get; set; }
/// <summary>
/// Token name to append after url, e.g., url?tokenName={bearerToken}
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? AppendTokenName { get; set; }
/// <summary>
/// Whether to enable full screen or not
/// </summary>
public bool FullScreen { get; set; }
}