56 lines
1.5 KiB
C#
56 lines
1.5 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using Radzen;
|
|
using Radzen.Blazor;
|
|
using Seenginx.Models;
|
|
using Seenginx.Services;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Seenginx.Pages
|
|
{
|
|
public class NginxBase : ComponentBase
|
|
{
|
|
[Inject]
|
|
public INginxService NginxService { get; set; }
|
|
|
|
public string InputSearch { get; set; }
|
|
|
|
public List<ConfigFile> ConfigFiles { get; set; } = new List<ConfigFile>();
|
|
public ConfigFile SelectedFile { get; set; }
|
|
public List<string> Filters { get; set; } = new List<string>();
|
|
public List<int> FilteredOutFiles { get; set; } = new List<int>();
|
|
|
|
public Dictionary<string, string> FilterFolder { get; set; } = new Dictionary<string, string>();
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
ConfigFiles.AddRange(await NginxService.GetFilesAsync());
|
|
Filters.AddRange(new List<string> { "All", "Root", "Conf.d", "Enabled", "Disabled" });
|
|
FilterFolder.Add("All", null);
|
|
FilterFolder.Add("Root", "/");
|
|
FilterFolder.Add("Conf.d", "/conf.d");
|
|
FilterFolder.Add("Enabled", "/sites-enabled");
|
|
FilterFolder.Add("Disabled", "/sites-disabled");
|
|
await base.OnInitializedAsync();
|
|
}
|
|
|
|
public async Task SelectedFileChanged(ConfigFile configFile)
|
|
{
|
|
SelectedFile = configFile;
|
|
}
|
|
|
|
public async Task AddFile()
|
|
{
|
|
}
|
|
public async Task UpdateFile(ConfigFile configFile)
|
|
{
|
|
}
|
|
public async Task DeleteFile(ConfigFile configFile)
|
|
{
|
|
}
|
|
}
|
|
}
|