code_style: run dotnet format
Some checks are pending
Continuous Integration / Build (push) Waiting to run
Continuous Integration / Prepare version string (push) Waiting to run
Continuous Integration / Package (push) Blocked by required conditions
Localization Check / localization-check (push) Waiting to run

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-11-14 21:15:40 +08:00
parent 28c93da73b
commit a824adf6d3
No known key found for this signature in database
6 changed files with 9 additions and 10 deletions

View file

@ -6,7 +6,7 @@ namespace SourceGit.Converters
public static class FilterModeConverters public static class FilterModeConverters
{ {
public static readonly FuncValueConverter<Models.FilterMode, IBrush> ToBorderBrush = public static readonly FuncValueConverter<Models.FilterMode, IBrush> ToBorderBrush =
new FuncValueConverter<Models.FilterMode, IBrush>(v => new FuncValueConverter<Models.FilterMode, IBrush>(v =>
{ {
switch (v) switch (v)
{ {

View file

@ -20,19 +20,19 @@ namespace SourceGit.Models
public class Filter : ObservableObject public class Filter : ObservableObject
{ {
public string Pattern public string Pattern
{ {
get => _pattern; get => _pattern;
set => SetProperty(ref _pattern, value); set => SetProperty(ref _pattern, value);
} }
public FilterType Type public FilterType Type
{ {
get; get;
set; set;
} = FilterType.LocalBranch; } = FilterType.LocalBranch;
public FilterMode Mode public FilterMode Mode
{ {
get => _mode; get => _mode;
set => SetProperty(ref _mode, value); set => SetProperty(ref _mode, value);

View file

@ -159,7 +159,7 @@ namespace SourceGit.Models
if (Server.Contains("openai.azure.com/", StringComparison.Ordinal)) if (Server.Contains("openai.azure.com/", StringComparison.Ordinal))
client.DefaultRequestHeaders.Add("api-key", ApiKey); client.DefaultRequestHeaders.Add("api-key", ApiKey);
else else
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}"); client.DefaultRequestHeaders.Add("Authorization", $"Bearer {ApiKey}");
} }
var req = new StringContent(JsonSerializer.Serialize(chat, JsonCodeGen.Default.OpenAIChatRequest), Encoding.UTF8, "application/json"); var req = new StringContent(JsonSerializer.Serialize(chat, JsonCodeGen.Default.OpenAIChatRequest), Encoding.UTF8, "application/json");

View file

@ -234,7 +234,7 @@ namespace SourceGit.Models
{ {
var name = filter.Pattern.Substring(11); var name = filter.Pattern.Substring(11);
var b = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]"; var b = $"{name.Substring(0, name.Length - 1)}[{name[^1]}]";
if (filter.Mode == FilterMode.Included) if (filter.Mode == FilterMode.Included)
includedBranches.Add(b); includedBranches.Add(b);
else if (filter.Mode == FilterMode.Excluded) else if (filter.Mode == FilterMode.Excluded)

View file

@ -701,7 +701,7 @@ namespace SourceGit.ViewModels
if (local.FullName.StartsWith(filter.Pattern, StringComparison.Ordinal)) if (local.FullName.StartsWith(filter.Pattern, StringComparison.Ordinal))
return; return;
hasIncludedBranch |= filter.Mode == Models.FilterMode.Included; hasIncludedBranch |= filter.Mode == Models.FilterMode.Included;
} }
else if (filter.Type == Models.FilterType.RemoteBranch || filter.Type == Models.FilterType.RemoteBranchFolder) else if (filter.Type == Models.FilterType.RemoteBranch || filter.Type == Models.FilterType.RemoteBranchFolder)
{ {
@ -2035,7 +2035,7 @@ namespace SourceGit.ViewModels
{ {
node.FilterMode = _settings.GetHistoriesFilterMode(node.Path, isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder); node.FilterMode = _settings.GetHistoriesFilterMode(node.Path, isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder);
UpdateBranchTreeFilterMode(node.Children, isLocal); UpdateBranchTreeFilterMode(node.Children, isLocal);
} }
} }
} }

View file

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
@ -89,7 +88,7 @@ namespace SourceGit.Views
menu.Items.Add(unset); menu.Items.Add(unset);
menu.Items.Add(new MenuItem() { Header = "-" }); menu.Items.Add(new MenuItem() { Header = "-" });
} }
var include = new MenuItem(); var include = new MenuItem();
include.Icon = App.CreateMenuIcon("Icons.Filter"); include.Icon = App.CreateMenuIcon("Icons.Filter");