feat: init the pages for reverse proxy configs and global configs
This commit is contained in:
36
CaddyManager/Components/Pages/Caddyfile.razor.cs
Normal file
36
CaddyManager/Components/Pages/Caddyfile.razor.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using BlazorMonaco.Editor;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace CaddyManager.Components.Pages;
|
||||
|
||||
public partial class Caddyfile: ComponentBase
|
||||
{
|
||||
private string _caddyConfigurationContent = string.Empty;
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
// Load the content of the Caddy configuration file
|
||||
_caddyConfigurationContent = CaddyService.GetCaddyGlobalConfigurationContent();
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private StandaloneEditorConstructionOptions EditorConstructionOptions(StandaloneCodeEditor editor)
|
||||
{
|
||||
return new StandaloneEditorConstructionOptions
|
||||
{
|
||||
AutomaticLayout = true,
|
||||
Language = "plaintext",
|
||||
Value = _caddyConfigurationContent,
|
||||
};
|
||||
}
|
||||
|
||||
private void Submit()
|
||||
{
|
||||
// CaddyService.SaveCaddyGlobalConfigurationContent(_caddyConfigurationContent);
|
||||
}
|
||||
|
||||
private void Cancel()
|
||||
{
|
||||
// CaddyService.GetCaddyGlobalConfigurationContent();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user