-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Starting on #3 switching to data binding
Move to codicon icons for status Added query limit option Added progress indicator for load
- Loading branch information
Showing
10 changed files
with
201 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
|
||
namespace GitHubActionsVS.Converters; | ||
|
||
public class ConclusionColorConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
string status = value as string; | ||
return GetConclusionColor(status); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value; | ||
} | ||
|
||
private SolidColorBrush GetConclusionColor(string status) => status.ToLowerInvariant() switch | ||
{ | ||
"success" => new SolidColorBrush(Colors.Green), | ||
"failure" => new SolidColorBrush(Colors.Red), | ||
_ => new SolidColorBrush(Colors.Black), | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
|
||
namespace GitHubActionsVS.Converters; | ||
public class ConclusionIconConverter : IValueConverter | ||
{ | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
string status = value as string; | ||
return GetConclusionIndicator(status); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return value; | ||
} | ||
|
||
private string GetConclusionIndicator(string status) => status.ToLowerInvariant() switch | ||
{ | ||
"success" => "\uEBB3 ", | ||
"failure" => "\uEBB4 ", | ||
"cancelled" => "\uEABD ", | ||
"skipped" => "\uEABD ", | ||
_ => "🤷🏽", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace GitHubActionsVS.Models; | ||
|
||
public abstract class BaseWorkflowType | ||
{ | ||
public string Name { get; set; } | ||
|
||
public abstract string DisplayName { get; } | ||
public string Conclusion { get; set; } | ||
public DateTimeOffset? LogDate { get; set; } | ||
public string DisplayDate => $"{LogDate:g}"; | ||
public string? Url { get; set; } | ||
public string Id { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace GitHubActionsVS.Models; | ||
|
||
public class SimpleJob : SimpleRun | ||
{ | ||
public override string DisplayName => Name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace GitHubActionsVS.Models; | ||
public class SimpleRun : BaseWorkflowType | ||
{ | ||
public List<SimpleJob> Jobs { get; set; } | ||
public string RunNumber { get; set; } | ||
|
||
public override string DisplayName => $"{Name} #{RunNumber}"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.ComponentModel; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace GitHubActionsVS; | ||
internal partial class OptionsProvider | ||
{ | ||
// Register the options with this attribute on your package class: | ||
// [ProvideOptionPage(typeof(OptionsProvider.ExtensionOptionsOptions), "GitHubActionsVS", "ExtensionOptions", 0, 0, true, SupportsProfiles = true)] | ||
[ComVisible(true)] | ||
public class ExtensionOptionsOptions : BaseOptionPage<ExtensionOptions> { } | ||
} | ||
|
||
public class ExtensionOptions : BaseOptionModel<ExtensionOptions> | ||
{ | ||
[Category("Query Settings")] | ||
[DisplayName("Max Runs")] | ||
[Description("The maximum number of runs to retrieve")] | ||
[DefaultValue(10)] | ||
public int MaxRuns { get; set; } = 10; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters