@@ -41,7 +41,7 @@ public string LastChecked
41
41
}
42
42
}
43
43
44
- private string GetBackgroundColor ( OrcanodeOnlineStatus status )
44
+ private string GetBackgroundColor ( OrcanodeOnlineStatus status , OrcanodeOnlineStatus ? orcasoundStatus = null )
45
45
{
46
46
if ( status == OrcanodeOnlineStatus . Online )
47
47
{
@@ -51,6 +51,10 @@ private string GetBackgroundColor(OrcanodeOnlineStatus status)
51
51
{
52
52
return ColorTranslator . ToHtml ( Color . Yellow ) ;
53
53
}
54
+ if ( orcasoundStatus . HasValue && ( orcasoundStatus != OrcanodeOnlineStatus . Online ) )
55
+ {
56
+ return ColorTranslator . ToHtml ( Color . FromArgb ( 0xff , 0xcc , 0xcb ) ) ;
57
+ }
54
58
return ColorTranslator . ToHtml ( Color . Red ) ;
55
59
}
56
60
@@ -65,35 +69,52 @@ private string GetTextColor(OrcanodeOnlineStatus status)
65
69
return ColorTranslator . ToHtml ( Color . White ) ;
66
70
}
67
71
68
- public string NodeS3BackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . S3StreamStatus ) ;
72
+ private string GetTextColor ( string backgroundColor )
73
+ {
74
+ if ( backgroundColor == ColorTranslator . ToHtml ( Color . Red ) )
75
+ {
76
+ return ColorTranslator . ToHtml ( Color . White ) ;
77
+ }
78
+ return ColorTranslator . ToHtml ( Color . FromArgb ( 0 , 0 , 238 ) ) ;
79
+ }
80
+
81
+ public string NodeS3BackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . S3StreamStatus , node . OrcasoundStatus ) ;
69
82
70
- public string NodeS3TextColor ( Orcanode node ) => GetTextColor ( node . S3StreamStatus ) ;
83
+ public string NodeS3TextColor ( Orcanode node ) => GetTextColor ( NodeS3BackgroundColor ( node ) ) ;
71
84
72
- public string NodeOrcaHelloTextColor ( Orcanode node ) => GetTextColor ( node . OrcaHelloStatus ) ;
85
+ public string NodeOrcaHelloTextColor ( Orcanode node ) => GetTextColor ( NodeOrcaHelloBackgroundColor ( node ) ) ;
73
86
74
- public string NodeOrcaHelloBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . OrcaHelloStatus ) ;
87
+ public string NodeOrcaHelloBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . OrcaHelloStatus , node . OrcasoundStatus ) ;
75
88
76
89
/// <summary>
77
90
/// Gets the text color for the Mezmo status of the specified node.
78
91
/// </summary>
79
92
/// <param name="node">The Orcanode instance.</param>
80
93
/// <returns>A string representation of the text color.</returns>
81
- public string NodeMezmoTextColor ( Orcanode node ) => GetTextColor ( node . MezmoStatus ) ;
94
+ public string NodeMezmoTextColor ( Orcanode node ) => GetTextColor ( NodeMezmoBackgroundColor ( node ) ) ;
82
95
83
96
/// <summary>
84
97
/// Gets the background color for the Mezmo status of the specified node.
85
98
/// </summary>
86
99
/// <param name="node">The Orcanode instance.</param>
87
100
/// <returns>A string representation of the background color.</returns>
88
- public string NodeMezmoBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . MezmoStatus ) ;
101
+ public string NodeMezmoBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . MezmoStatus , node . OrcasoundStatus ) ;
89
102
90
- public string NodeDataplicityBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . DataplicityConnectionStatus ) ;
103
+ public string NodeDataplicityBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . DataplicityConnectionStatus , node . OrcasoundStatus ) ;
91
104
92
- public string NodeDataplicityTextColor ( Orcanode node ) => GetTextColor ( node . DataplicityConnectionStatus ) ;
105
+ public string NodeDataplicityTextColor ( Orcanode node ) => GetTextColor ( NodeDataplicityBackgroundColor ( node ) ) ;
93
106
94
- public string NodeOrcasoundBackgroundColor ( Orcanode node ) => GetBackgroundColor ( node . OrcasoundStatus ) ;
107
+ public string NodeOrcasoundBackgroundColor ( Orcanode node )
108
+ {
109
+ string color = GetBackgroundColor ( node . OrcasoundStatus ) ;
110
+ if ( ( node . Type != "Live" ) && ( color == ColorTranslator . ToHtml ( Color . Red ) ) )
111
+ {
112
+ return ColorTranslator . ToHtml ( Color . FromArgb ( 0xff , 0xcc , 0xcb ) ) ;
113
+ }
114
+ return color ;
115
+ }
95
116
96
- public string NodeOrcasoundTextColor ( Orcanode node ) => GetTextColor ( node . OrcasoundStatus ) ;
117
+ public string NodeOrcasoundTextColor ( Orcanode node ) => GetTextColor ( NodeOrcasoundBackgroundColor ( node ) ) ;
97
118
98
119
private DateTime SinceTime => DateTime . UtcNow . AddDays ( - 7 ) ;
99
120
@@ -104,6 +125,10 @@ public string NodeUptimePercentageBackgroundColor(Orcanode node)
104
125
int value = GetUptimePercentage ( node ) ;
105
126
if ( value < 1 )
106
127
{
128
+ if ( node . OrcasoundStatus != OrcanodeOnlineStatus . Online )
129
+ {
130
+ return ColorTranslator . ToHtml ( Color . FromArgb ( 0xff , 0xcc , 0xcb ) ) ;
131
+ }
107
132
return ColorTranslator . ToHtml ( Color . Red ) ;
108
133
}
109
134
else if ( value > 99 )
@@ -113,14 +138,7 @@ public string NodeUptimePercentageBackgroundColor(Orcanode node)
113
138
114
139
return ColorTranslator . ToHtml ( Color . Yellow ) ;
115
140
}
116
- public string NodeUptimePercentageTextColor ( Orcanode node )
117
- {
118
- if ( NodeUptimePercentageBackgroundColor ( node ) == ColorTranslator . ToHtml ( Color . Red ) )
119
- {
120
- return ColorTranslator . ToHtml ( Color . White ) ;
121
- }
122
- return ColorTranslator . ToHtml ( Color . FromArgb ( 0 , 0 , 238 ) ) ;
123
- }
141
+ public string NodeUptimePercentageTextColor ( Orcanode node ) => GetTextColor ( NodeUptimePercentageBackgroundColor ( node ) ) ;
124
142
125
143
public string NodeDataplicityUpgradeColor ( Orcanode node )
126
144
{
0 commit comments