5 Commits

Author SHA1 Message Date
9f2ada68be Bum version 2025-10-09 18:44:32 +02:00
171ef6a87c Update to newer nuget versions 2025-10-09 18:42:57 +02:00
dependabot[bot]
74807bcfac Bump KubernetesClient from 16.0.2 to 17.0.14 (#13)
---
updated-dependencies:
- dependency-name: KubernetesClient
  dependency-version: 17.0.14
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-23 18:34:42 +02:00
6223e982d7 bump version 2025-03-13 06:20:00 +01:00
07912b3239 improved the context menu 2025-03-13 06:19:04 +01:00
6 changed files with 315 additions and 262 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
@@ -22,21 +22,22 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.5" /> <PackageReference Include="Avalonia" Version="11.3.7" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.5" /> <PackageReference Include="Avalonia.Desktop" Version="11.3.7" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.2.5" /> <PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.7" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.5" /> <PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.7" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.7" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.5" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.5" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.3.7" />
<PackageReference Include="Avalonia.Xaml.Interactions" Version="11.2.0.14" /> <PackageReference Include="Avalonia.Xaml.Interactions" Version="11.3.0.6" />
<PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.2.0.14" /> <PackageReference Include="Avalonia.Xaml.Interactivity" Version="11.3.0.6" />
<PackageReference Include="KubernetesClient" Version="16.0.2" /> <PackageReference Include="KubernetesClient" Version="17.0.14" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" /> <PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="Serilog" Version="4.2.0" /> <PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="2.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="7.0.0" />
<PackageReference Include="SharpZipLib" Version="1.4.2" /> <PackageReference Include="SharpZipLib" Version="1.4.2" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -9,7 +9,6 @@ using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
using K8sFileBrowser.Models; using K8sFileBrowser.Models;
using K8sFileBrowser.Services; using K8sFileBrowser.Services;
using Microsoft.IdentityModel.Tokens;
using ReactiveUI; using ReactiveUI;
using ReactiveUI.Fody.Helpers; using ReactiveUI.Fody.Helpers;
using Serilog; using Serilog;
@@ -65,14 +64,11 @@ public class MainWindowViewModel : ViewModelBase
#endregion Properties #endregion Properties
#region Commands #region Commands
public ReactiveCommand<Unit, Unit> DownloadCommand { get; private set; } = null!;
public ReactiveCommand<Unit, Unit> DownloadLogCommand { get; private set; } = null!; public ReactiveCommand<Unit, Unit> DownloadLogCommand { get; private set; } = null!;
public ReactiveCommand<Unit, Unit> RefreshCommand { get; private set; } = null!; public ReactiveCommand<Unit, Unit> RefreshCommand { get; private set; } = null!;
public ReactiveCommand<Unit, Unit> ParentCommand { get; private set; } = null!; public ReactiveCommand<Unit, Unit> ParentCommand { get; private set; } = null!;
public ReactiveCommand<Unit, Unit> OpenCommand { get; private set; } = null!;
public ReactiveCommand<FileInformation, Unit> OpenContextCommand { get; private set; } = null!; public ReactiveCommand<FileInformation, Unit> OpenContextCommand { get; private set; } = null!;
public ReactiveCommand<FileInformation, Unit> DownloadContextCommand { get; private set; } = null!; public ReactiveCommand<FileInformation, Unit> DownloadContextCommand { get; private set; } = null!;
private ReactiveCommand<Namespace, IEnumerable<Pod>> GetPodsForNamespace { get; set; } = null!; private ReactiveCommand<Namespace, IEnumerable<Pod>> GetPodsForNamespace { get; set; } = null!;
@@ -85,9 +81,7 @@ public class MainWindowViewModel : ViewModelBase
Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString();
// commands // commands
ConfigureOpenDirectoryCommand();
ConfigureOpenDirectoryContextCommand(); ConfigureOpenDirectoryContextCommand();
ConfigureDownloadFileCommand(kubernetesService);
ConfigureDownloadFileContextCommand(kubernetesService); ConfigureDownloadFileContextCommand(kubernetesService);
ConfigureRefreshCommand(kubernetesService); ConfigureRefreshCommand(kubernetesService);
ConfigureDownloadLogCommand(kubernetesService); ConfigureDownloadLogCommand(kubernetesService);
@@ -275,32 +269,7 @@ public class MainWindowViewModel : ViewModelBase
.Subscribe(ShowErrorMessage); .Subscribe(ShowErrorMessage);
} }
private void ConfigureDownloadFileCommand(IKubernetesService kubernetesService)
{
var isFile = this
.WhenAnyValue(x => x.SelectedFile, x => x.Message.IsVisible)
.Select(x => x is { Item1.Type: FileType.File, Item2: false });
DownloadCommand = ReactiveCommand.CreateFromTask(async () =>
{
await Observable.StartAsync(async () =>
{
var fileName = SelectedFile!.Name.Substring(SelectedFile!.Name.LastIndexOf('/') + 1,
SelectedFile!.Name.Length - SelectedFile!.Name.LastIndexOf('/') - 1);
var saveFileName = await ApplicationHelper.SaveFile(_lastDirectory, fileName);
if (saveFileName != null)
{
SetLastDirectory(saveFileName);
ShowWorkingMessage("Downloading File...");
await kubernetesService.DownloadFile(SelectedNamespace, SelectedPod, SelectedContainer, SelectedFile, saveFileName);
HideWorkingMessage();
}
}, RxApp.TaskpoolScheduler);
}, isFile, RxApp.MainThreadScheduler);
DownloadCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(ShowErrorMessage);
}
private void ConfigureDownloadFileContextCommand(IKubernetesService kubernetesService) private void ConfigureDownloadFileContextCommand(IKubernetesService kubernetesService)
{ {
@@ -322,7 +291,7 @@ public class MainWindowViewModel : ViewModelBase
}, RxApp.TaskpoolScheduler); }, RxApp.TaskpoolScheduler);
}, outputScheduler: RxApp.MainThreadScheduler); }, outputScheduler: RxApp.MainThreadScheduler);
DownloadCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler) DownloadContextCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(ShowErrorMessage); .Subscribe(ShowErrorMessage);
} }
@@ -330,25 +299,7 @@ public class MainWindowViewModel : ViewModelBase
{ {
_lastDirectory = saveFileName.Substring(0, saveFileName.LastIndexOf(Path.DirectorySeparatorChar)); _lastDirectory = saveFileName.Substring(0, saveFileName.LastIndexOf(Path.DirectorySeparatorChar));
} }
private void ConfigureOpenDirectoryCommand()
{
var isDirectory = this
.WhenAnyValue(x => x.SelectedFile, x => x.Message.IsVisible)
.Select(x => x is { Item1.Type: FileType.Directory, Item2: false });
OpenCommand = ReactiveCommand.Create(() =>
{
if (".." == SelectedFile?.Name)
SelectedPath = SelectedFile?.Parent;
else
SelectedPath = SelectedFile != null ? SelectedFile!.Name : "/";
},
isDirectory, RxApp.MainThreadScheduler);
OpenCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(ShowErrorMessage);
}
private void ConfigureOpenDirectoryContextCommand() private void ConfigureOpenDirectoryContextCommand()
{ {
@@ -357,7 +308,7 @@ public class MainWindowViewModel : ViewModelBase
SelectedPath = ".." == file.Name ? file.Parent : file.Name; SelectedPath = ".." == file.Name ? file.Parent : file.Name;
}, outputScheduler: RxApp.MainThreadScheduler); }, outputScheduler: RxApp.MainThreadScheduler);
OpenCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler) OpenContextCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(ShowErrorMessage); .Subscribe(ShowErrorMessage);
} }

View File

@@ -15,196 +15,300 @@
</Design.DataContext> </Design.DataContext>
<Grid> <Grid>
<Border ZIndex="1" IsVisible="{Binding Message.IsVisible}" Background="{Binding Message.Color}" Opacity="{Binding Message.Opacity}"> <Border ZIndex="1" IsVisible="{Binding Message.IsVisible}" Background="{Binding Message.Color}"
Opacity="{Binding Message.Opacity}">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="20" MaxWidth="500"> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Spacing="20" MaxWidth="500">
<PathIcon Classes="loading" Data="{StaticResource arrow_rotate_clockwise_regular}" Width="100" Height="100" IsVisible="{Binding !Message.IsError}"></PathIcon> <PathIcon Classes="loading" Data="{StaticResource arrow_rotate_clockwise_regular}" Width="100"
<PathIcon Data="{StaticResource warning_regular}" Width="100" Height="100" IsVisible="{Binding Message.IsError}"></PathIcon> Height="100" IsVisible="{Binding !Message.IsError}">
</PathIcon>
<PathIcon Data="{StaticResource warning_regular}" Width="100" Height="100"
IsVisible="{Binding Message.IsError}">
</PathIcon>
<TextBlock TextWrapping="Wrap" Text="{Binding Message.Text}">.</TextBlock> <TextBlock TextWrapping="Wrap" Text="{Binding Message.Text}">.</TextBlock>
</StackPanel> </StackPanel>
</Border> </Border>
<Grid RowDefinitions="Auto, *"> <Grid RowDefinitions="Auto, *">
<Border Padding="10 14" Background="#21252b"> <Border Padding="10 14" Background="#21252b">
<Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto"> <Grid ColumnDefinitions="Auto,Auto,Auto,*,Auto">
<Label Grid.Column="0" <Label Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="0 0 10 0"> Margin="0 0 10 0">
Cluster: Cluster:
</Label> </Label>
<ComboBox Grid.Column="1" <ComboBox Grid.Column="1"
ItemsSource="{Binding ClusterContexts}" ItemsSource="{Binding ClusterContexts}"
SelectedItem="{Binding SelectedClusterContext}" SelectedItem="{Binding SelectedClusterContext}"
VerticalAlignment="Center" VerticalAlignment="Center"
MinWidth="200" MinWidth="200"
Margin="0 0 10 0"> Margin="0 0 10 0">
</ComboBox> </ComboBox>
<Label Grid.Column="2" <Label Grid.Column="2"
VerticalAlignment="Center" VerticalAlignment="Center"
Margin="0 0 10 0"> Margin="0 0 10 0">
Namespace: Namespace:
</Label> </Label>
<ComboBox Grid.Column="3" <ComboBox Grid.Column="3"
ItemsSource="{Binding Namespaces}" ItemsSource="{Binding Namespaces}"
SelectedItem="{Binding SelectedNamespace}" SelectedItem="{Binding SelectedNamespace}"
VerticalAlignment="Center" VerticalAlignment="Center"
MinWidth="200" MinWidth="200"
Margin="0 0 10 0"> Margin="0 0 10 0">
</ComboBox> </ComboBox>
<TextBlock Grid.Column="4" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Version}"/> <TextBlock Grid.Column="4" HorizontalAlignment="Right" VerticalAlignment="Center"
</Grid> Text="{Binding Version}" />
</Border> </Grid>
</Border>
<Grid ColumnDefinitions="*, 1, 3*" Grid.Row="1">
<ListBox <Grid ColumnDefinitions="*, 1, 3*" Grid.Row="1">
ItemsSource="{Binding Pods}" <ListBox
SelectedItem="{Binding SelectedPod}" Background="Transparent"> ItemsSource="{Binding Pods}"
<ListBox.Styles> SelectedItem="{Binding SelectedPod}" Background="Transparent">
<Style Selector="ListBoxItem"> <ListBox.Styles>
<Setter Property="Padding" Value="0" /> <Style Selector="ListBoxItem">
</Style> <Setter Property="Padding" Value="0" />
</ListBox.Styles> </Style>
<ListBox.ItemTemplate> </ListBox.Styles>
<DataTemplate> <ListBox.ItemTemplate>
<Border CornerRadius="0" Padding="0 4 0 4" BorderBrush="SlateGray" <DataTemplate>
BorderThickness="0 0 0 1"> <Border CornerRadius="0" Padding="0 4 0 4" BorderBrush="SlateGray"
<TextBlock Text="{Binding}" Padding="4" Margin="4" /> BorderThickness="0 0 0 1">
</Border> <TextBlock Text="{Binding}" Padding="4" Margin="4" />
</DataTemplate> </Border>
</ListBox.ItemTemplate> </DataTemplate>
</ListBox> </ListBox.ItemTemplate>
<GridSplitter Grid.Column="1" ResizeDirection="Columns" /> </ListBox>
<Grid Grid.Column="2" RowDefinitions="Auto, *"> <GridSplitter Grid.Column="1" ResizeDirection="Columns" />
<Grid ColumnDefinitions="*, Auto, Auto"> <Grid Grid.Column="2" RowDefinitions="Auto, *">
<StackPanel Grid.Column="0" Orientation="Horizontal"> <Grid ColumnDefinitions="*, Auto, Auto">
<TextBlock Text="Current Directory" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock> <StackPanel Grid.Column="0" Orientation="Horizontal">
<TextBlock Text="{Binding SelectedPath}" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock> <TextBlock Text="Current Directory" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock>
</StackPanel> <TextBlock Text="{Binding SelectedPath}" VerticalAlignment="Center" Margin="10 0 0 0"></TextBlock>
<StackPanel Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal"> </StackPanel>
<Label VerticalAlignment="Center" <StackPanel Grid.Column="1" VerticalAlignment="Center" Orientation="Horizontal">
Margin="0 0 10 0"> <Label VerticalAlignment="Center"
Container: Margin="0 0 10 0">
</Label> Container:
<ComboBox ItemsSource="{Binding Containers}" </Label>
SelectedItem="{Binding SelectedContainer}" <ComboBox ItemsSource="{Binding Containers}"
VerticalAlignment="Center" SelectedItem="{Binding SelectedContainer}"
MinWidth="200" VerticalAlignment="Center"
Margin="0 0 10 0"> MinWidth="200"
</ComboBox> Margin="0 0 10 0">
</StackPanel> </ComboBox>
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="4" Margin="10" HorizontalAlignment="Right"> </StackPanel>
<Button Command="{Binding DownloadLogCommand}" VerticalAlignment="Center" ToolTip.Tip="Download Container Log" Margin="0 0 48 0 "> <StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="4" Margin="10"
<PathIcon Data="{StaticResource document_one_page_regular}"></PathIcon> HorizontalAlignment="Right">
</Button> <Button Command="{Binding DownloadLogCommand}" VerticalAlignment="Center"
<Button Command="{Binding RefreshCommand}" VerticalAlignment="Center" ToolTip.Tip="Refresh Directory"> ToolTip.Tip="Download Container Log" Margin="0 0 48 0 ">
<PathIcon Data="{StaticResource arrow_sync_circle_regular}"></PathIcon> <PathIcon Data="{StaticResource document_one_page_regular}"></PathIcon>
</Button> </Button>
<Button Command="{Binding ParentCommand}" VerticalAlignment="Center" ToolTip.Tip="Go To Parent Directory"> <Button Command="{Binding RefreshCommand}" VerticalAlignment="Center"
<PathIcon Data="{StaticResource arrow_curve_up_left_regular}"></PathIcon> ToolTip.Tip="Refresh Directory">
</Button> <PathIcon Data="{StaticResource arrow_sync_circle_regular}"></PathIcon>
<Button Command="{Binding OpenCommand}" VerticalAlignment="Center" ToolTip.Tip="Browse Directory"> </Button>
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon> <Button Command="{Binding ParentCommand}" VerticalAlignment="Center"
</Button> ToolTip.Tip="Go To Parent Directory">
<Button Command="{Binding DownloadCommand}" VerticalAlignment="Center" ToolTip.Tip="Download File"> <PathIcon Data="{StaticResource arrow_curve_up_left_regular}"></PathIcon>
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon> </Button>
</Button> <Button Command="{Binding OpenContextCommand}" CommandParameter="{Binding SelectedFile}"
</StackPanel> IsEnabled="{Binding SelectedFile.IsDirectory}" VerticalAlignment="Center"
ToolTip.Tip="Browse Directory">
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon>
</Button>
<Button Command="{Binding DownloadContextCommand}"
CommandParameter="{Binding SelectedFile}" IsEnabled="{Binding SelectedFile.IsFile}"
VerticalAlignment="Center" ToolTip.Tip="Download File">
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon>
</Button>
</StackPanel>
</Grid>
<DataGrid Grid.Row="1"
Name="FileInformationDataGrid"
Margin="2 0 2 0"
ItemsSource="{Binding FileInformation}"
IsReadOnly="True"
GridLinesVisibility="Horizontal"
BorderThickness="1"
SelectionMode="Single"
SelectedItem="{Binding SelectedFile}"
Focusable="False">
<DataGrid.Styles>
<Style Selector="DataGridColumnHeader">
<Setter Property="FontSize" Value="14"></Setter>
<Setter Property="Padding" Value="10"></Setter>
</Style>
<Style Selector="DataGridCell">
<Setter Property="FontSize" Value="14"></Setter>
</Style>
</DataGrid.Styles>
<DataGrid.Columns>
<DataGridTemplateColumn Header="Type" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border ToolTip.Tip="{Binding Type}" Background="Transparent">
<Border.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Open"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Download"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DownloadContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsFile}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Border.ContextFlyout>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<PathIcon Data="{StaticResource folder_regular}"
IsVisible="{Binding IsDirectory}">
</PathIcon>
<PathIcon Data="{StaticResource document_regular}"
IsVisible="{Binding IsFile}">
</PathIcon>
<PathIcon Data="{StaticResource document_error_regular}"
IsVisible="{Binding IsSymbolicLink}">
</PathIcon>
<PathIcon Data="{StaticResource document_unknown_regular}"
IsVisible="{Binding IsUnknown}">
</PathIcon>
</StackPanel>
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Name" Width="*" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<Border.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Open"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Download"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DownloadContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsFile}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Border.ContextFlyout>
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" />
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Size" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<Border.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Open"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Download"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DownloadContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsFile}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Border.ContextFlyout>
<TextBlock Text="{Binding Size}" VerticalAlignment="Center"
HorizontalAlignment="Right" Margin="0 0 10 0" />
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Date" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<Border.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Open"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_right_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Download"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DownloadContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsFile}">
<MenuItem.Icon>
<PathIcon Data="{StaticResource arrow_download_regular}"></PathIcon>
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Border.ContextFlyout>
<TextBlock Text="{Binding DateTimeOffsetString}" VerticalAlignment="Center"
Margin="10 0 8 0" />
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}"/>
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid> </Grid>
<DataGrid Grid.Row="1"
Name="FileInformationDataGrid"
Margin="2 0 2 0"
ItemsSource="{Binding FileInformation}"
IsReadOnly="True"
GridLinesVisibility="Horizontal"
BorderThickness="1"
SelectionMode="Single"
SelectedItem="{Binding SelectedFile}"
Focusable="False">
<DataGrid.Styles>
<Style Selector="DataGridColumnHeader">
<Setter Property="FontSize" Value="14"></Setter>
<Setter Property="Padding" Value="10"></Setter>
</Style>
<Style Selector="DataGridCell">
<Setter Property="FontSize" Value="14"></Setter>
</Style>
</DataGrid.Styles>
<DataGrid.Columns>
<DataGridTemplateColumn Header="Type" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border ToolTip.Tip="{Binding Type}" Background="Transparent">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<PathIcon Data="{StaticResource folder_regular}" IsVisible="{Binding IsDirectory}"></PathIcon>
<PathIcon Data="{StaticResource document_regular}" IsVisible="{Binding IsFile}"></PathIcon>
<PathIcon Data="{StaticResource document_error_regular}" IsVisible="{Binding IsSymbolicLink}"></PathIcon>
<PathIcon Data="{StaticResource document_unknown_regular}" IsVisible="{Binding IsUnknown}"></PathIcon>
</StackPanel>
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction Command="{Binding ((vm:MainWindowViewModel)DataContext).OpenCommand, RelativeSource={RelativeSource AncestorType=Window }}" />
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Name" Width="*" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<Border.ContextFlyout>
<MenuFlyout>
<MenuItem Header="Open"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).OpenContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsDirectory}"/>
<MenuItem Header="Download"
Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).DownloadContextCommand}"
CommandParameter="{Binding}"
IsEnabled="{Binding IsFile}"/>
</MenuFlyout>
</Border.ContextFlyout>
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" />
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction Command="{Binding ((vm:MainWindowViewModel)DataContext).OpenCommand, RelativeSource={RelativeSource AncestorType=Window }}" />
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Size" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<TextBlock Text="{Binding Size}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0 0 10 0"/>
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction Command="{Binding ((vm:MainWindowViewModel)DataContext).OpenCommand, RelativeSource={RelativeSource AncestorType=Window }}" />
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Header="Date" CanUserSort="False">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate DataType="models:FileInformation">
<Border Background="Transparent">
<TextBlock Text="{Binding DateTimeOffsetString}" VerticalAlignment="Center" Margin="10 0 8 0"/>
<Interaction.Behaviors>
<EventTriggerBehavior EventName="DoubleTapped">
<InvokeCommandAction Command="{Binding ((vm:MainWindowViewModel)DataContext).OpenCommand, RelativeSource={RelativeSource AncestorType=Window}}" />
</EventTriggerBehavior>
</Interaction.Behaviors>
</Border>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid> </Grid>
</Grid> </Grid>
</Grid> </Grid>
</Grid>
</Window> </Window>

View File

@@ -12,7 +12,7 @@ class Build : NukeBuild
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] [Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release; readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
[Parameter] readonly string Version = "1.4.0"; [Parameter] readonly string Version = "1.6.0";
AbsolutePath SourceDirectory => RootDirectory / "K8sFileBrowser"; AbsolutePath SourceDirectory => RootDirectory / "K8sFileBrowser";
AbsolutePath OutputDirectory => RootDirectory / "output"; AbsolutePath OutputDirectory => RootDirectory / "output";
@@ -47,15 +47,14 @@ class Build : NukeBuild
.SetConfiguration(Configuration) .SetConfiguration(Configuration)
.SetOutput(WinOutputDirectory) .SetOutput(WinOutputDirectory)
.EnableSelfContained() .EnableSelfContained()
.SetFramework("net8.0") .SetFramework("net9.0")
.SetRuntime("win-x64") .SetRuntime("win-x64")
.EnablePublishSingleFile() .EnablePublishSingleFile()
.EnablePublishReadyToRun() .EnablePublishReadyToRun()
.SetAuthors("Andreas Billmann") .SetAuthors("Andreas Billmann")
.SetCopyright("Copyright (c) 2023") .SetCopyright("Copyright (c) 2023")
.SetVersion(Version) .SetVersion(Version)
.SetProcessArgumentConfigurator(_ => _ .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true"));
.Add("-p:IncludeNativeLibrariesForSelfExtract=true")));
WinOutputDirectory.ZipTo( WinOutputDirectory.ZipTo(
WinZip, WinZip,
@@ -73,15 +72,14 @@ class Build : NukeBuild
.SetConfiguration(Configuration) .SetConfiguration(Configuration)
.SetOutput(LinuxOutputDirectory) .SetOutput(LinuxOutputDirectory)
.EnableSelfContained() .EnableSelfContained()
.SetFramework("net8.0") .SetFramework("net9.0")
.SetRuntime("linux-x64") .SetRuntime("linux-x64")
.EnablePublishSingleFile() .EnablePublishSingleFile()
.EnablePublishReadyToRun() .EnablePublishReadyToRun()
.SetAuthors("Andreas Billmann") .SetAuthors("Andreas Billmann")
.SetCopyright("Copyright (c) 2023") .SetCopyright("Copyright (c) 2023")
.SetVersion(Version) .SetVersion(Version)
.SetProcessArgumentConfigurator(_ => _ .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true"));
.Add("-p:IncludeNativeLibrariesForSelfExtract=true")));
LinuxOutputDirectory.TarGZipTo( LinuxOutputDirectory.TarGZipTo(
LinuxGz, LinuxGz,
@@ -98,15 +96,14 @@ class Build : NukeBuild
.SetConfiguration(Configuration) .SetConfiguration(Configuration)
.SetOutput(OsxOutputDirectory) .SetOutput(OsxOutputDirectory)
.EnableSelfContained() .EnableSelfContained()
.SetFramework("net8.0") .SetFramework("net9.0")
.SetRuntime("osx-arm64") .SetRuntime("osx-arm64")
.EnablePublishSingleFile() .EnablePublishSingleFile()
.EnablePublishReadyToRun() .EnablePublishReadyToRun()
.SetAuthors("Andreas Billmann") .SetAuthors("Andreas Billmann")
.SetCopyright("Copyright (c) 2023") .SetCopyright("Copyright (c) 2023")
.SetVersion(Version) .SetVersion(Version)
.SetProcessArgumentConfigurator(_ => _ .SetProcessAdditionalArguments("-p:IncludeNativeLibrariesForSelfExtract=true"));
.Add("-p:IncludeNativeLibrariesForSelfExtract=true")));
OsxOutputDirectory.TarGZipTo( OsxOutputDirectory.TarGZipTo(
OsxGz, OsxGz,

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<RootNamespace></RootNamespace> <RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169</NoWarn> <NoWarn>CS0649;CS0169</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory> <NukeRootDirectory>..</NukeRootDirectory>
@@ -11,7 +11,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.1.4" /> <PackageReference Include="Nuke.Common" Version="9.0.4" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,6 +1,6 @@
{ {
"sdk": { "sdk": {
"version": "8.0.0", "version": "9.0.0",
"rollForward": "latestFeature", "rollForward": "latestFeature",
"allowPrerelease": false "allowPrerelease": false
} }