Skip to content

Commit

Permalink
feat(Node): Un/Cordon & Drain (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanJosipovic authored Nov 10, 2024
1 parent a16f81d commit ba5037b
Show file tree
Hide file tree
Showing 16 changed files with 526 additions and 99 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ KubeUI is a user interface for Kubernetes.
- Namespace specific Resource Permissions

### Resource Specific Features
- Node
- Codon/UnCordon
- Drain
- Pod
- View Logs
- View Console
Expand Down
8 changes: 7 additions & 1 deletion src/KubeUI/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reflection;
using System.Runtime.InteropServices;
using Avalonia.Controls.Notifications;
using Avalonia.Data.Core.Plugins;
using Avalonia.Logging;
using Avalonia.Markup.Xaml;
Expand All @@ -9,7 +10,6 @@
using HanumanInstitute.MvvmDialogs.Avalonia.Fluent;
using KubernetesCRDModelGen;
using KubeUI.Client;
using KubeUI.Desktop;
using KubeUI.Views;
using LiveChartsCore;
using LiveChartsCore.SkiaSharpView;
Expand All @@ -29,6 +29,8 @@ public partial class App : Application

public static TopLevel TopLevel { get; private set; }

private INotificationManager? NotificationManager { get; set; }

private ILogger<App> logger;

public override void Initialize()
Expand Down Expand Up @@ -138,6 +140,8 @@ public override void Initialize()
builder.Services.AddSingleton<IDialogManager, MyDialogManager>(x => new MyDialogManager(dialogFactory: x.GetRequiredService<IDialogFactory>(), logger: x.GetRequiredService<ILogger<DialogManager>>()));
builder.Services.AddSingleton<IDialogService, DialogService>(x => new DialogService(x.GetRequiredService<IDialogManager>()));

builder.Services.AddSingleton<INotificationManager>(_ => NotificationManager!);

Host = builder.Build();
Resources[typeof(IServiceProvider)] = Host.Services;
_ = Host.RunAsync();
Expand Down Expand Up @@ -190,6 +194,8 @@ public override void OnFrameworkInitializationCompleted()
TopLevel = TopLevel.GetTopLevel(singleViewPlatform.MainView);
}

NotificationManager = new WindowNotificationManager(TopLevel) { MaxItems = 4 };

base.OnFrameworkInitializationCompleted();
}

Expand Down
115 changes: 112 additions & 3 deletions src/KubeUI/Assets/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions src/KubeUI/Assets/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,40 @@ Are you sure?</value>
<data name="ResourceListViewModel_Restart_Secondary" xml:space="preserve">
<value>No</value>
</data>
<data name="ResourceListViewModel_CordonNode_Title" xml:space="preserve">
<value>Warning</value>
</data>
<data name="ResourceListViewModel_CordonNode_Content" xml:space="preserve">
<value>Cordon Nodes {0}</value>
</data>
<data name="ResourceListViewModel_CordonNode_Primary" xml:space="preserve">
<value>Yes</value>
</data>
<data name="ResourceListViewModel_CordonNode_Secondary" xml:space="preserve">
<value>No</value>
</data>
<data name="ResourceListViewModel_UnCordonNode_Content" xml:space="preserve">
<value>UnCordon Nodes {0}</value>
</data>
<data name="ResourceListViewModel_UnCordonNode_Primary" xml:space="preserve">
<value>Yes</value>
</data>
<data name="ResourceListViewModel_UnCordonNode_Secondary" xml:space="preserve">
<value>No</value>
</data>
<data name="ResourceListViewModel_UnCordonNode_Title" xml:space="preserve">
<value>Warning</value>
</data>
<data name="ResourceListViewModel_DrainNode_Content" xml:space="preserve">
<value>Drain Nodes {0}</value>
</data>
<data name="ResourceListViewModel_DrainNode_Title" xml:space="preserve">
<value>Warning</value>
</data>
<data name="ResourceListViewModel_DrainNode_Secondary" xml:space="preserve">
<value>No</value>
</data>
<data name="ResourceListViewModel_DrainNode_Primary" xml:space="preserve">
<value>Yes</value>
</data>
</root>
Loading

0 comments on commit ba5037b

Please sign in to comment.