2020-04-13 00:21:36 +02:00
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Seenginx.Shared
|
|
|
|
|
{
|
|
|
|
|
public class NavMenuBase : ComponentBase
|
|
|
|
|
{
|
|
|
|
|
protected Dictionary<string, string> ActiveNav { get; set; }
|
|
|
|
|
public bool CollapsePanel { get; set; } = false;
|
|
|
|
|
|
|
|
|
|
protected async override Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
ActiveNav = new Dictionary<string, string>
|
|
|
|
|
{
|
|
|
|
|
{ "nginx", null },
|
2020-04-19 03:04:46 +02:00
|
|
|
|
{ "nginxlogs", null },
|
2020-04-13 00:21:36 +02:00
|
|
|
|
{ "systemd", null },
|
2020-04-19 03:04:46 +02:00
|
|
|
|
{ "systemdlogs", null },
|
2020-04-13 00:21:36 +02:00
|
|
|
|
{ "dmesg", null }
|
|
|
|
|
};
|
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void SelectMenuItem(string menuItem)
|
|
|
|
|
{
|
|
|
|
|
foreach (var key in ActiveNav.Keys.ToArray())
|
|
|
|
|
ActiveNav[key] = null;
|
|
|
|
|
|
2020-04-14 04:42:03 +02:00
|
|
|
|
ActiveNav[menuItem] = "is-active";
|
2020-04-13 00:21:36 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|