mirror of
https://github.com/frosch95/K8sFileBrowser.git
synced 2026-04-11 21:08:22 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b33552531a |
@@ -9,7 +9,7 @@
|
|||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Platforms>AnyCPU</Platforms>
|
<Platforms>AnyCPU</Platforms>
|
||||||
<ApplicationIcon>Assets/app.ico</ApplicationIcon>
|
<ApplicationIcon>Assets/app.ico</ApplicationIcon>
|
||||||
<Version>0.1.1</Version>
|
<Version>0.1.2</Version>
|
||||||
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public string? Version { get; set; } = null!;
|
public string? Version { get; set; }
|
||||||
|
|
||||||
[Reactive]
|
[Reactive]
|
||||||
public IEnumerable<ClusterContext> ClusterContexts { get; set; } = null!;
|
public IEnumerable<ClusterContext> ClusterContexts { get; set; } = null!;
|
||||||
@@ -59,6 +59,8 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
[Reactive]
|
[Reactive]
|
||||||
public Message Message { get; set; } = null!;
|
public Message Message { get; set; } = null!;
|
||||||
|
|
||||||
|
private string _lastDirectory = ".";
|
||||||
|
|
||||||
#endregion Properties
|
#endregion Properties
|
||||||
|
|
||||||
#region Commands
|
#region Commands
|
||||||
@@ -232,9 +234,10 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
await Observable.StartAsync(async () =>
|
await Observable.StartAsync(async () =>
|
||||||
{
|
{
|
||||||
var fileName = SelectedPod?.Name + ".log";
|
var fileName = SelectedPod?.Name + ".log";
|
||||||
var saveFileName = await ApplicationHelper.SaveFile(".", fileName);
|
var saveFileName = await ApplicationHelper.SaveFile(_lastDirectory, fileName);
|
||||||
if (saveFileName != null)
|
if (saveFileName != null)
|
||||||
{
|
{
|
||||||
|
SetLastDirectory(saveFileName);
|
||||||
ShowWorkingMessage("Downloading Log...");
|
ShowWorkingMessage("Downloading Log...");
|
||||||
await kubernetesService.DownloadLog(SelectedNamespace, SelectedPod, SelectedContainer, saveFileName);
|
await kubernetesService.DownloadLog(SelectedNamespace, SelectedPod, SelectedContainer, saveFileName);
|
||||||
HideWorkingMessage();
|
HideWorkingMessage();
|
||||||
@@ -258,9 +261,10 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
var fileName = SelectedFile!.Name.Substring(SelectedFile!.Name.LastIndexOf('/') + 1,
|
var fileName = SelectedFile!.Name.Substring(SelectedFile!.Name.LastIndexOf('/') + 1,
|
||||||
SelectedFile!.Name.Length - SelectedFile!.Name.LastIndexOf('/') - 1);
|
SelectedFile!.Name.Length - SelectedFile!.Name.LastIndexOf('/') - 1);
|
||||||
var saveFileName = await ApplicationHelper.SaveFile(".", fileName);
|
var saveFileName = await ApplicationHelper.SaveFile(_lastDirectory, fileName);
|
||||||
if (saveFileName != null)
|
if (saveFileName != null)
|
||||||
{
|
{
|
||||||
|
SetLastDirectory(saveFileName);
|
||||||
ShowWorkingMessage("Downloading File...");
|
ShowWorkingMessage("Downloading File...");
|
||||||
await kubernetesService.DownloadFile(SelectedNamespace, SelectedPod, SelectedContainer, SelectedFile, saveFileName);
|
await kubernetesService.DownloadFile(SelectedNamespace, SelectedPod, SelectedContainer, SelectedFile, saveFileName);
|
||||||
HideWorkingMessage();
|
HideWorkingMessage();
|
||||||
@@ -272,6 +276,11 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
.Subscribe(ShowErrorMessage);
|
.Subscribe(ShowErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SetLastDirectory(string saveFileName)
|
||||||
|
{
|
||||||
|
_lastDirectory = saveFileName.Substring(0, saveFileName.LastIndexOf('\\'));
|
||||||
|
}
|
||||||
|
|
||||||
private void ConfigureOpenDirectoryCommand()
|
private void ConfigureOpenDirectoryCommand()
|
||||||
{
|
{
|
||||||
var isDirectory = this
|
var isDirectory = this
|
||||||
|
|||||||
Reference in New Issue
Block a user