Skip to content

Commit 18526d6

Browse files
committed
feat(dashboard): add 30-day range selection to charts and fix translation errors
Added 30-day time range option for Dashboard charts Fixed several translation issues in the interface
1 parent e87dd76 commit 18526d6

File tree

4 files changed

+44
-13
lines changed

4 files changed

+44
-13
lines changed

FanX/Components/Pages/Dashboard.razor

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@
138138
<MudText Typo="Typo.h6">Historical Data</MudText>
139139
<MudSelect T="int" Value="_selectedTimeRange" ValueChanged="OnTimeRangeChanged"
140140
Label="Chart Time Range" Variant="Variant.Outlined" Margin="Margin.Dense">
141-
<MudSelectItem Value="1">Last 1 Hour</MudSelectItem>
142-
<MudSelectItem Value="6">Last 6 Hours</MudSelectItem>
143-
<MudSelectItem Value="24">Last 24 Hours</MudSelectItem>
144-
<MudSelectItem Value="168">Last 7 Days</MudSelectItem>
141+
<MudSelectItem Value="1">@string.Format(Localization.LastHours, 1)</MudSelectItem>
142+
<MudSelectItem Value="6">@string.Format(Localization.LastHours, 6)</MudSelectItem>
143+
<MudSelectItem Value="24">@string.Format(Localization.LastHours, 24)</MudSelectItem>
144+
<MudSelectItem Value="168">@string.Format(Localization.LastDays, 7)</MudSelectItem>
145+
<MudSelectItem Value="720">@string.Format(Localization.LastDays, 30)</MudSelectItem>
145146
</MudSelect>
146147
</MudStack>
147148
</MudItem>

FanX/Resources/Localization.Designer.cs

Lines changed: 21 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FanX/Resources/Localization.resx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@
363363
<comment>Fans card header</comment>
364364
</data>
365365
<data name="TemperatureHistory" xml:space="preserve">
366-
<value>Temperature History (Last Hour)</value>
366+
<value>Temperature History</value>
367367
<comment>Temperature history chart title</comment>
368368
</data>
369369
<data name="PowerHistory" xml:space="preserve">
370-
<value>Power History (Last Hour)</value>
370+
<value>Power History</value>
371371
<comment>Power history chart title</comment>
372372
</data>
373373
<data name="FanSpeedHistory" xml:space="preserve">
374-
<value>Fan Speed History (Last Hour)</value>
374+
<value>Fan Speed History</value>
375375
<comment>Fan speed history chart title</comment>
376376
</data>
377377
<data name="FanControlSettings" xml:space="preserve">
@@ -885,4 +885,10 @@
885885
<data name="RedirectingToLogin" xml:space="preserve">
886886
<value>Redirecting to login...</value>
887887
</data>
888+
<data name="LastHours" xml:space="preserve">
889+
<value>Last {0} Hours</value>
890+
</data>
891+
<data name="LastDays" xml:space="preserve">
892+
<value>Last {0} Days</value>
893+
</data>
888894
</root>

FanX/Resources/Localization.zh.resx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
<value>功耗</value>
532532
</data>
533533
<data name="PowerHistory" xml:space="preserve">
534-
<value>历史功耗(一小时前)</value>
534+
<value>历史功耗</value>
535535
</data>
536536
<data name="Rule" xml:space="preserve">
537537
<value>规则</value>
@@ -543,13 +543,13 @@
543543
<value>温度</value>
544544
</data>
545545
<data name="TemperatureHistory" xml:space="preserve">
546-
<value>温度历史(一小时前)</value>
546+
<value>温度历史</value>
547547
</data>
548548
<data name="Fans" xml:space="preserve">
549549
<value>风扇</value>
550550
</data>
551551
<data name="FanSpeedHistory" xml:space="preserve">
552-
<value>风扇转速历史(一小时前)</value>
552+
<value>风扇转速历史</value>
553553
</data>
554554
<data name="Disabled" xml:space="preserve">
555555
<value>已禁用</value>
@@ -857,4 +857,10 @@
857857
<data name="RedirectingToLogin" xml:space="preserve">
858858
<value>正在跳转至登录页面...</value>
859859
</data>
860+
<data name="LastHours" xml:space="preserve">
861+
<value>{0} 小时前</value>
862+
</data>
863+
<data name="LastDays" xml:space="preserve">
864+
<value>{0} 天前</value>
865+
</data>
860866
</root>

0 commit comments

Comments
 (0)