mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-04-19 19:14:51 +00:00
89 lines
No EOL
2.6 KiB
Text
89 lines
No EOL
2.6 KiB
Text
@page "/admin"
|
|
@using LBPUnion.ProjectLighthouse.Administration
|
|
@using LBPUnion.ProjectLighthouse.Administration.Maintenance
|
|
@using LBPUnion.ProjectLighthouse.Extensions
|
|
@using LBPUnion.ProjectLighthouse.Helpers
|
|
@using LBPUnion.ProjectLighthouse.Types
|
|
@model LBPUnion.ProjectLighthouse.Servers.Website.Pages.Admin.AdminPanelPage
|
|
|
|
@{
|
|
Layout = "Layouts/BaseLayout";
|
|
Model.Title = "Admin Panel";
|
|
}
|
|
|
|
@if (Model.Log != null)
|
|
{
|
|
<div class="ui bottom attached message">
|
|
<h2>Command Output</h2>
|
|
@foreach (string line in Model.Log.Split("\n"))
|
|
{
|
|
<code>@line.TrimEnd()</code><br>
|
|
}
|
|
</div>
|
|
}
|
|
|
|
@if (!this.Request.IsMobile())
|
|
{
|
|
<div class="ui center aligned grid">
|
|
@foreach (AdminPanelStatistic statistic in Model.Statistics)
|
|
{
|
|
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
|
|
}
|
|
</div>
|
|
<br>
|
|
}
|
|
else
|
|
{
|
|
@foreach (AdminPanelStatistic statistic in Model.Statistics)
|
|
{
|
|
@await Html.PartialAsync("Partials/AdminPanelStatisticPartial", statistic)
|
|
<br>
|
|
}
|
|
}
|
|
|
|
<h2>Commands</h2>
|
|
@foreach (ICommand command in MaintenanceHelper.Commands)
|
|
{
|
|
<div class="ui blue segment">
|
|
<h3>@command.Name()</h3>
|
|
<form>
|
|
<input type="text" name="command" style="display: none;" value="@command.FirstAlias">
|
|
@if (command.RequiredArgs() > 0)
|
|
{
|
|
<div class="ui left action input" style="width: 100%">
|
|
<button type="submit" class="ui green button">
|
|
<i class="play icon"></i>
|
|
Execute
|
|
</button>
|
|
<input type="text" name="args" placeholder="@command.Arguments()">
|
|
</div>
|
|
}
|
|
else
|
|
{
|
|
<button type="submit" class="ui green button">
|
|
<i class="play icon"></i>
|
|
Execute
|
|
</button>
|
|
}
|
|
</form>
|
|
</div>
|
|
}
|
|
<h2>Maintenance Jobs</h2>
|
|
<p>
|
|
<b>Warning: Interrupting Lighthouse during maintenance may leave the database in an unclean state.</b>
|
|
</p>
|
|
|
|
@foreach (IMaintenanceJob job in MaintenanceHelper.MaintenanceJobs)
|
|
{
|
|
<div class="ui red segment">
|
|
<h3>@job.Name()</h3>
|
|
<p>@job.Description()</p>
|
|
<form>
|
|
<input type="text" name="maintenanceJob" style="display: none;" value="@job.GetType().Name">
|
|
<button type="submit" class="ui green button">
|
|
<i class="play icon"></i>
|
|
Run Job
|
|
</button>
|
|
</form>
|
|
</div>
|
|
} |