Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit01fa531

Browse files
fix
1 parentd290c0e commit01fa531

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed
Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
usingSystem;
2-
usingWindows.UI;
3-
usingCoder.Desktop.App.ViewModels;
4-
usingMicrosoft.UI.Xaml.Data;
5-
usingMicrosoft.UI.Xaml.Media;
6-
7-
namespaceCoder.Desktop.App.Converters;
8-
9-
publicclassAgentStatusToColorConverter:IValueConverter
10-
{
11-
privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89));
12-
privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48));
13-
privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147));
14-
15-
publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage)
16-
{
17-
if(valueis notAgentConnectionStatusstatus)returnGray;
18-
19-
returnstatusswitch
20-
{
21-
AgentConnectionStatus.Green=>Green,
22-
AgentConnectionStatus.Red=>Red,
23-
_=>Gray,
24-
};
25-
}
26-
27-
publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage)
28-
{
29-
thrownewNotImplementedException();
30-
}
31-
}
1+
usingSystem;
2+
usingWindows.UI;
3+
usingCoder.Desktop.App.ViewModels;
4+
usingMicrosoft.UI.Xaml.Data;
5+
usingMicrosoft.UI.Xaml.Media;
6+
7+
namespaceCoder.Desktop.App.Converters;
8+
9+
publicclassAgentStatusToColorConverter:IValueConverter
10+
{
11+
privatestaticreadonlySolidColorBrushGreen=new(Color.FromArgb(255,52,199,89));
12+
privatestaticreadonlySolidColorBrushRed=new(Color.FromArgb(255,255,59,48));
13+
privatestaticreadonlySolidColorBrushGray=new(Color.FromArgb(255,142,142,147));
14+
privatestaticreadonlySolidColorBrushYellow=new(Color.FromArgb(255,204,1,0));
15+
16+
publicobjectConvert(objectvalue,TypetargetType,objectparameter,stringlanguage)
17+
{
18+
if(valueis notAgentConnectionStatusstatus)returnGray;
19+
20+
returnstatusswitch
21+
{
22+
AgentConnectionStatus.Green=>Green,
23+
AgentConnectionStatus.Red=>Red,
24+
AgentConnectionStatus.Yellow=>Yellow,
25+
_=>Gray,
26+
};
27+
}
28+
29+
publicobjectConvertBack(objectvalue,TypetargetType,objectparameter,stringlanguage)
30+
{
31+
thrownewNotImplementedException();
32+
}
33+
}

‎App/ViewModels/AgentViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public enum AgentConnectionStatus
1010
{
1111
Green,
1212
Red,
13+
Yellow,
1314
Gray,
1415
}
1516

‎App/ViewModels/TrayWindowViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private void UpdateFromRpcModel(RpcModel rpcModel)
137137
HostnameSuffix=fqdnSuffix,
138138
ConnectionStatus=lastHandshakeAgo<TimeSpan.FromMinutes(5)
139139
?AgentConnectionStatus.Green
140-
:AgentConnectionStatus.Red,
140+
:AgentConnectionStatus.Yellow,
141141
DashboardUrl=WorkspaceUri(coderUri,workspace?.Name),
142142
});
143143
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp