@@ -123,6 +123,7 @@ public MainWindow()
123123 Default_StackPanel . Visibility = Visibility . Visible ;
124124 Info_StackPanel . Visibility = Visibility . Hidden ;
125125
126+ if ( reg . KeyExistsRoot ( "SysinfoTS" ) ) SysinfoTS . IsChecked = ( bool ) reg . ReadKeyValueRoot ( "SysinfoTS" ) ; HideShowElementPairs ( SysInfoLBL , SysinfoCard , SysinfoTS ) ;
126127 if ( reg . KeyExistsRoot ( "RecentBlocksTS" ) ) RecentBlocksTS . IsChecked = ( bool ) reg . ReadKeyValueRoot ( "RecentBlocksTS" ) ; HideShowElementPairs ( RecentBlockLBL , BlockHistoryCard , RecentBlocksTS ) ;
127128 if ( reg . KeyExistsRoot ( "QueryTS" ) ) QueryTS . IsChecked = ( bool ) reg . ReadKeyValueRoot ( "QueryTS" ) ; HideShowElementPairs ( QueryLBL , QueryCard , QueryTS ) ; Debug . WriteLine ( " " ) ;
128129 if ( reg . KeyExistsRoot ( "SourcesTS" ) ) SourcesTS . IsChecked = ( bool ) reg . ReadKeyValueRoot ( "SourcesTS" ) ; HideShowElementPairs ( SourcesLBL , SourcesCard , SourcesTS ) ;
@@ -522,6 +523,8 @@ private async void UpdateInfo(Instance instance, CancellationToken token)
522523
523524 dynamic summary = new ExpandoObject ( ) ;
524525 dynamic status = new ExpandoObject ( ) ;
526+ dynamic cpuTemp = new ExpandoObject ( ) ;
527+ dynamic cpuRamUsage = new ExpandoObject ( ) ;
525528
526529
527530 //if (coldRun)
@@ -588,8 +591,15 @@ private async void UpdateInfo(Instance instance, CancellationToken token)
588591 status = JsonConvert . DeserializeObject < dynamic > ( await httpClient . GetStringAsync ( $ "{ instance . Address } /dns/blocking") ) ! ;
589592 await Task . Delay ( 50 , token ) ;
590593
594+ if ( ( bool ) SysinfoTS . IsChecked ! )
595+ {
596+ cpuTemp = JsonConvert . DeserializeObject < dynamic > ( await httpClient . GetStringAsync ( $ "{ instance . Address } /info/sensors") ) ;
597+ await Task . Delay ( 50 , token ) ;
591598
592- if ( ( bool ) RecentBlocksTS . IsChecked ! )
599+ cpuRamUsage = JsonConvert . DeserializeObject < dynamic > ( await httpClient . GetStringAsync ( $ "{ instance . Address } /info/system") ) ;
600+ await Task . Delay ( 50 , token ) ;
601+ }
602+ if ( ( bool ) RecentBlocksTS . IsChecked ! )
593603 {
594604 response = JsonConvert . DeserializeObject < dynamic > ( await httpClient . GetStringAsync ( $ "{ instance . Address } /queries?length=100&upstream=blocklist") ) ;
595605 blocked = ( JArray ) response . queries ;
@@ -731,6 +741,12 @@ private async void UpdateInfo(Instance instance, CancellationToken token)
731741 : new SolidColorBrush ( ( Color ) ColorConverter . ConvertFromString ( "#FF7B8BF5" ) ) ;
732742
733743
744+ CpuTempTB . Foreground = blueBrush ;
745+ CpuUsageTB . Foreground = blueBrush ;
746+ RamUsageTB . Foreground = blueBrush ;
747+ ramUsedRun . Foreground = blueBrush ;
748+ ramTotalRun . Foreground = blueBrush ;
749+
734750 if ( instance . isV6 == true )
735751 {
736752 GravityLB . Visibility = Visibility . Collapsed ;
@@ -755,6 +771,7 @@ private async void UpdateInfo(Instance instance, CancellationToken token)
755771 if ( StatusTB . Text == "enabled" ) StatusTB . Foreground = greenBrush ;
756772 else StatusTB . Foreground = redBrush ;
757773
774+ if ( ( bool ) SysinfoTS . IsChecked ) await new SystemInfoLoader ( ) . LoadAsync ( CpuTempTB , CpuUsageTB , ramUsedRun , ramTotalRun , cpuTemp , cpuRamUsage , ( bool ) instance . isV6 , blueBrush ) ;
758775 if ( ( bool ) RecentBlocksTS . IsChecked ) await new RecentBlocksLoader ( ) . LoadAsync ( BlockHistoryItemsControl , blocked , ( bool ) instance . isV6 , redBrush ) ;
759776 if ( ( bool ) SourcesTS . IsChecked ) await new SourcesLoader ( ) . LoadAsync ( SourcesItemsControl , topClients , ( bool ) instance . isV6 , purpleBrush , blueBrush ) ;
760777 if ( ( bool ) ForwardDestinationsTS . IsChecked ) await new DnsRoutesLoader ( ) . LoadAsync ( ForwardDestinationsGrid , upStreams , ( bool ) instance . isV6 , isDarkTheme ) ;
@@ -1158,6 +1175,11 @@ private void Resize()
11581175 }
11591176
11601177
1178+ private void SysinfoTS_Click ( object sender , RoutedEventArgs e )
1179+ {
1180+ HideShowElementPairs ( SysInfoLBL , SysinfoCard , SysinfoTS ) ;
1181+
1182+ }
11611183 private void RecentBlocksTS_Click ( object sender , RoutedEventArgs e )
11621184 {
11631185 HideShowElementPairs ( RecentBlockLBL , BlockHistoryCard , RecentBlocksTS ) ;
0 commit comments