mirror of
https://github.com/frosch95/K8sFileBrowser.git
synced 2026-04-11 12:58:22 +02:00
Compare commits
1 Commits
v.0.0.3-al
...
v0.0.4-alp
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e3c4248e1 |
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reactive;
|
using System.Reactive;
|
||||||
|
using System.Reactive.Concurrency;
|
||||||
using System.Reactive.Linq;
|
using System.Reactive.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using K8sFileBrowser.Models;
|
using K8sFileBrowser.Models;
|
||||||
@@ -167,7 +168,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
GetPodsForNamespace = ReactiveCommand.CreateFromObservable<Namespace, IEnumerable<Pod>>(ns =>
|
GetPodsForNamespace = ReactiveCommand.CreateFromObservable<Namespace, IEnumerable<Pod>>(ns =>
|
||||||
Observable.StartAsync(_ => PodsAsync(ns, kubernetesService), RxApp.TaskpoolScheduler));
|
Observable.StartAsync(_ => PodsAsync(ns, kubernetesService), RxApp.TaskpoolScheduler));
|
||||||
|
|
||||||
GetPodsForNamespace.ThrownExceptions
|
GetPodsForNamespace.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
}, isNotRoot, RxApp.MainThreadScheduler);
|
}, isNotRoot, RxApp.MainThreadScheduler);
|
||||||
|
|
||||||
ParentCommand.ThrownExceptions
|
ParentCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +212,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
}, RxApp.TaskpoolScheduler);
|
}, RxApp.TaskpoolScheduler);
|
||||||
}, isSelectedPod, RxApp.MainThreadScheduler);
|
}, isSelectedPod, RxApp.MainThreadScheduler);
|
||||||
|
|
||||||
DownloadLogCommand.ThrownExceptions
|
DownloadLogCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +238,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
}, RxApp.TaskpoolScheduler);
|
}, RxApp.TaskpoolScheduler);
|
||||||
}, isFile, RxApp.MainThreadScheduler);
|
}, isFile, RxApp.MainThreadScheduler);
|
||||||
|
|
||||||
DownloadCommand.ThrownExceptions
|
DownloadCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -250,7 +251,7 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
OpenCommand = ReactiveCommand.Create(() => { SelectedPath = SelectedFile != null ? SelectedFile!.Name : "/"; },
|
OpenCommand = ReactiveCommand.Create(() => { SelectedPath = SelectedFile != null ? SelectedFile!.Name : "/"; },
|
||||||
isDirectory, RxApp.MainThreadScheduler);
|
isDirectory, RxApp.MainThreadScheduler);
|
||||||
|
|
||||||
OpenCommand.ThrownExceptions
|
OpenCommand.ThrownExceptions.ObserveOn(RxApp.MainThreadScheduler)
|
||||||
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
.Subscribe(ex => ShowErrorMessage(ex.Message).ConfigureAwait(false).GetAwaiter().GetResult());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -277,8 +278,10 @@ public class MainWindowViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
await ShowErrorMessage(e.Message);
|
RxApp.MainThreadScheduler.Schedule(Action);
|
||||||
return new List<Namespace>();
|
return new List<Namespace>();
|
||||||
|
|
||||||
|
async void Action() => await ShowErrorMessage(e.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user