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