Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Dashboard/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@ private void OpenServerTab(ServerConnection server)

ServerTabControl.Items.Add(tabItem);
_openTabs[server.Id] = tabItem;
ServerTabControl.SelectedItem = tabItem;

var prefs = _preferencesService.GetPreferences();
if (prefs.FocusServerTabOnClick)
{
ServerTabControl.SelectedItem = tabItem;
}

_serverManager.UpdateLastConnected(server.Id);
}
Expand Down
3 changes: 3 additions & 0 deletions Dashboard/Models/UserPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public class UserPreferences
public bool McpEnabled { get; set; } = false;
public int McpPort { get; set; } = 5150;

// Navigation settings
public bool FocusServerTabOnClick { get; set; } = true;

// Update check settings
public bool CheckForUpdatesOnStartup { get; set; } = true;

Expand Down
8 changes: 7 additions & 1 deletion Dashboard/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

<!-- Default Time Range Section -->
<TextBlock Text="Default Time Range" FontWeight="Bold" FontSize="13" Margin="0,0,0,10"/>
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Margin="0,0,0,20">
<TextBlock Text="Show data from last:" VerticalAlignment="Center" Margin="0,0,10,0"/>
<ComboBox x:Name="DefaultTimeRangeComboBox" Width="120" SelectionChanged="DefaultTimeRangeComboBox_Changed">
<ComboBoxItem Content="1 hour" Tag="1"/>
Expand All @@ -63,6 +63,12 @@
<ComboBoxItem Content="7 days" Tag="168"/>
</ComboBox>
</StackPanel>

<!-- Navigation Section -->
<TextBlock Text="Navigation" FontWeight="Bold" FontSize="13" Margin="0,0,0,10"/>
<CheckBox x:Name="FocusServerTabCheckBox"
Content="Focus server tab when clicking a server card"
Margin="0,0,0,0"/>
</StackPanel>
</ScrollViewer>
</TabItem>
Expand Down
6 changes: 6 additions & 0 deletions Dashboard/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ private void LoadSettings()
DefaultTimeRangeComboBox.SelectedIndex = 2; // 24 hours
}

// Navigation settings
FocusServerTabCheckBox.IsChecked = prefs.FocusServerTabOnClick;

// Query logging settings
LogSlowQueriesCheckBox.IsChecked = prefs.LogSlowQueries;
QueryLogger.SetEnabled(prefs.LogSlowQueries);
Expand Down Expand Up @@ -420,6 +423,9 @@ private void OkButton_Click(object sender, RoutedEventArgs e)
prefs.DefaultHoursBack = int.Parse(rangeItem.Tag.ToString()!, CultureInfo.InvariantCulture);
}

// Save navigation settings
prefs.FocusServerTabOnClick = FocusServerTabCheckBox.IsChecked == true;

// Save query logging settings
prefs.LogSlowQueries = LogSlowQueriesCheckBox.IsChecked == true;
QueryLogger.SetEnabled(prefs.LogSlowQueries);
Expand Down
Loading