Added new file manager, renamed websites to webspaces. Added cloudpanel integration partialy. Added generic repos and more stuff
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@using Moonlight.App.Helpers.Files
|
||||
@using Logging.Net
|
||||
|
||||
<div class="badge badge-lg badge-light-primary">
|
||||
<div class="d-flex align-items-center flex-wrap">
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
<div class="card-body pt-0 pb-0">
|
||||
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold">
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/admin/websites">
|
||||
<TL>Websites</TL>
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/admin/webspaces">
|
||||
<TL>Webspaces</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/admin/websites/servers">
|
||||
<TL>Plesk servers</TL>
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/admin/webspaces/servers">
|
||||
<TL>Cloud panels</TL>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -1,14 +1,14 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject WebsiteService WebsiteService
|
||||
@inject WebSpaceService WebSpaceService
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
|
||||
<div class="row gy-5 g-xl-10">
|
||||
<div class="col-xl-4 mb-xl-10">
|
||||
<div class="card h-md-100">
|
||||
<div class="card-body d-flex flex-column flex-center">
|
||||
<img class="img-fluid" src="https://image.thum.io/get/http://@(CurrentWebsite.BaseDomain)" alt="Website screenshot"/>
|
||||
<img class="img-fluid" src="https://image.thum.io/get/http://@(CurrentWebSpace.Domain)" alt="Website screenshot"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -85,7 +85,7 @@
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public Website CurrentWebsite { get; set; }
|
||||
public WebSpace CurrentWebSpace { get; set; }
|
||||
|
||||
private string[] Certs;
|
||||
|
||||
@@ -94,18 +94,18 @@
|
||||
private async Task Load(LazyLoader lazyLoader)
|
||||
{
|
||||
await lazyLoader.SetText("Loading certificates");
|
||||
Certs = await WebsiteService.GetSslCertificates(CurrentWebsite);
|
||||
Certs = await WebSpaceService.GetSslCertificates(CurrentWebSpace);
|
||||
}
|
||||
|
||||
private async Task CreateCertificate()
|
||||
{
|
||||
await WebsiteService.CreateSslCertificate(CurrentWebsite);
|
||||
await WebSpaceService.CreateSslCertificate(CurrentWebSpace);
|
||||
await LazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task DeleteCertificate(string name)
|
||||
{
|
||||
await WebsiteService.DeleteSslCertificate(CurrentWebsite, name);
|
||||
await WebSpaceService.DeleteSslCertificate(CurrentWebSpace, name);
|
||||
await LazyLoader.Reload();
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject SmartTranslateService SmartTranslateService
|
||||
@inject WebsiteService WebsiteService
|
||||
@inject WebSpaceService WebSpaceService
|
||||
|
||||
<LazyLoader @ref="LazyLoader" Load="Load">
|
||||
<div class="card w-100 mb-4">
|
||||
@@ -93,7 +93,7 @@
|
||||
else
|
||||
{
|
||||
<div class="alert alert-warning">
|
||||
<TL>No databases found for this website</TL>
|
||||
<TL>No databases found for this webspace</TL>
|
||||
</div>
|
||||
}
|
||||
</LazyLoader>
|
||||
@@ -101,7 +101,7 @@
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public Website CurrentWebsite { get; set; }
|
||||
public WebSpace CurrentWebSpace { get; set; }
|
||||
|
||||
private LazyLoader LazyLoader;
|
||||
private Database[] Databases;
|
||||
@@ -112,25 +112,19 @@
|
||||
|
||||
private async Task Load(LazyLoader arg)
|
||||
{
|
||||
Databases = await WebsiteService.GetDatabases(CurrentWebsite);
|
||||
|
||||
if (Databases.Any())
|
||||
{
|
||||
DatabaseServer = (await WebsiteService.GetDefaultDatabaseServer(CurrentWebsite))!;
|
||||
Host = await WebsiteService.GetHost(CurrentWebsite);
|
||||
}
|
||||
Databases = await WebSpaceService.GetDatabases(CurrentWebSpace);
|
||||
}
|
||||
|
||||
private async Task OnValidSubmit()
|
||||
{
|
||||
await WebsiteService.CreateDatabase(CurrentWebsite, Model.Name, Model.Password);
|
||||
await WebSpaceService.CreateDatabase(CurrentWebSpace, Model.Name, Model.Password);
|
||||
Model = new();
|
||||
await LazyLoader.Reload();
|
||||
}
|
||||
|
||||
private async Task DeleteDatabase(Database database)
|
||||
{
|
||||
await WebsiteService.DeleteDatabase(CurrentWebsite, database);
|
||||
await WebSpaceService.DeleteDatabase(CurrentWebSpace, database);
|
||||
await LazyLoader.Reload();
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
@using Moonlight.App.Services
|
||||
@using Moonlight.Shared.Components.FileManagerPartials
|
||||
|
||||
@inject WebsiteService WebsiteService
|
||||
@inject WebSpaceService WebSpaceService
|
||||
|
||||
<LazyLoader Load="Load">
|
||||
<FileManager Access="Access">
|
||||
@@ -13,12 +13,12 @@
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public Website CurrentWebsite { get; set; }
|
||||
public WebSpace CurrentWebSpace { get; set; }
|
||||
|
||||
private FileAccess Access;
|
||||
|
||||
private async Task Load(LazyLoader arg)
|
||||
{
|
||||
Access = await WebsiteService.CreateFileAccess(CurrentWebsite);
|
||||
Access = await WebSpaceService.CreateFileAccess(CurrentWebSpace);
|
||||
}
|
||||
}
|
||||
55
Moonlight/Shared/Components/WebsiteControl/WebSpaceFtp.razor
Normal file
55
Moonlight/Shared/Components/WebsiteControl/WebSpaceFtp.razor
Normal file
@@ -0,0 +1,55 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject WebSpaceService WebSpaceService
|
||||
|
||||
<div class="card card-flush h-xl-100">
|
||||
<div class="card-body pt-2">
|
||||
<div class="mt-7 row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Host</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(CurrentWebSpace.CloudPanel.Host)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Port</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="21">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Username</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(CurrentWebSpace.UserName)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Password</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled blur-unless-hover" disabled="disabled" value="@(CurrentWebSpace.Password)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public WebSpace CurrentWebSpace { get; set; }
|
||||
}
|
||||
@@ -10,8 +10,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column">
|
||||
<div class="mb-1 fs-4">@(Website.BaseDomain)</div>
|
||||
<div class="text-muted fs-5">@(Website.PleskServer.Name)</div>
|
||||
<div class="mb-1 fs-4">@(WebSpace.Domain)</div>
|
||||
<div class="text-muted fs-5">@(WebSpace.CloudPanel.Name)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,22 +24,22 @@
|
||||
<div class="card-body pt-0 pb-0">
|
||||
<ul class="nav nav-stretch nav-line-tabs nav-line-tabs-2x border-transparent fs-5 fw-bold">
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/website/@(Website.Id)">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 0 ? "active" : "")" href="/webspace/@(WebSpace.Id)">
|
||||
<TL>Dashboard</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/website/@(Website.Id)/files">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 1 ? "active" : "")" href="/webspace/@(WebSpace.Id)/files">
|
||||
<TL>Files</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 2 ? "active" : "")" href="/website/@(Website.Id)/ftp">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 2 ? "active" : "")" href="/webspace/@(WebSpace.Id)/ftp">
|
||||
<TL>Ftp</TL>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item mt-2">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 3 ? "active" : "")" href="/website/@(Website.Id)/databases">
|
||||
<a class="nav-link text-active-primary ms-0 me-10 py-5 @(Index == 3 ? "active" : "")" href="/webspace/@(WebSpace.Id)/databases">
|
||||
<TL>Databases</TL>
|
||||
</a>
|
||||
</li>
|
||||
@@ -53,5 +53,5 @@
|
||||
public int Index { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Website Website { get; set; }
|
||||
public WebSpace WebSpace { get; set; }
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
@using Moonlight.App.Database.Entities
|
||||
@using Moonlight.App.Services
|
||||
|
||||
@inject WebsiteService WebsiteService
|
||||
|
||||
<div class="card card-flush h-xl-100">
|
||||
<div class="card-body pt-2">
|
||||
<LazyLoader Load="Load">
|
||||
<div class="mt-7 row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Host</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(FtpHost)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Port</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="21">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Username</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled" disabled="disabled" value="@(Website.FtpLogin)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row fv-row mb-7">
|
||||
<div class="col-md-3 text-md-start">
|
||||
<label class="fs-6 fw-semibold form-label mt-3">
|
||||
<TL>Ftp Password</TL>
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control form-control-solid disabled blur-unless-hover" disabled="disabled" value="@(Website.FtpPassword)">
|
||||
</div>
|
||||
</div>
|
||||
</LazyLoader>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code
|
||||
{
|
||||
[CascadingParameter]
|
||||
public Website Website { get; set; }
|
||||
|
||||
private string FtpHost = "N/A";
|
||||
|
||||
private async Task Load(LazyLoader arg)
|
||||
{
|
||||
FtpHost = await WebsiteService.GetHost(Website.PleskServer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user