Discord Bot web UI first preview

This commit is contained in:
2023-04-08 13:18:25 +03:00
parent 0a2dff0c6d
commit 810a527cc1
86 changed files with 74906 additions and 0 deletions

View File

@@ -0,0 +1,116 @@
@model DiscordBotUI.Models.Bot.BotModel
<label>Bot Name: @Model.BotName</label>
<br />
<label>Connection Status: @Model.StartStatus</label>
<br />
<label>Number of plugins loaded: @Model.PluginsLoaded</label>
<style>
* {
box-sizing: border-box;
}
.row {
margin-left: -5px;
margin-right: -5px;
}
.column {
float: left;
width: 100%;
padding: 5px;
}
/* Clearfix (clear floats) */
.row::after {
content: "";
clear: both;
display: table;
}
table {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
border: 1px solid #ddd;
}
th, td {
text-align: left;
padding: 16px;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
</style>
<div class="row">
<div class="column">
<h2>Commands</h2>
<table>
<tr>
<th> Name</th>
<th> Description</th>
<th> Usage</th>
<th> Aliases</th>
</tr>
@foreach(var cmd in Model.Commands)
{
<tr>
<td>@cmd.Command</td>
<td>@cmd.Description</td>
<td>@cmd.Usage</td>
@if (cmd.Aliases is not null)
{
<td>@cmd.Aliases</td>
} else
{
<td>No aliases found</td>
}
</tr>
}
</table>
</div>
<div class="column">
<h2>Events</h2>
<table>
<tr>
<th> Name</th>
<th> Description</th>
</tr>
@foreach(var eve in Model.Events)
{
<tr>
<td>@eve.Name</td>
<td>@eve.Description</td>
</tr>
}
</table>
</div>
<div class="column">
<h2>Slash Commands</h2>
<table>
<tr>
<th> Name</th>
<th> Description</th>
<th> Avalable in DM</th>
</tr>
@foreach(var scmd in Model.SlashCommands)
{
<tr>
<td>@scmd.Name</td>
<td>@scmd.Description</td>
@if (scmd.canUseDM)
{
<td>true</td>
} else {
<td>false</td>
}
</tr>
}
</table>
</div>
</div>

View File

@@ -0,0 +1,25 @@
@model DiscordBotUI.Models.Home.IndexModel
@{
ViewData["Title"] = "Home Page";
}
<link rel="stylesheet" href="~/css/home/index.css" asp-append-version="true" />
<form>
<div class="col-sm-6 align-self-center p-5">
<div class="form-group row">
<label for="staticServerID" class="col-sm-2 col-form-label text-white">Server ID</label>
<div class="col-sm-10">
<input type="text" readonly="" border="0" class="form-control-plaintext text-white" id="staticServerID" value="@Model.ServerID">
</div>
</div>
<div class="form-group row">
<label for="botPrefix" class="col-sm-2 col-form-label text-white">Bot Prefix</label>
<div class="col-sm-10">
<input type="text" readonly="" class="form-control-plaintext text-white" id="botPrefix" value="@Model.BotPrefix">
</div>
</div>
</div>
</form>

View File

@@ -0,0 +1,6 @@
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>

View File

@@ -0,0 +1,26 @@
@model DiscordBotUI.Models.Home.SettingsModel
@{
ViewData["Title"] = "Settings page";
}
<link rel="stylesheet" href="~/css/home/settings.css" asp-append-version="true" />
<div class="login-box">
<h2>Settings page</h2>
<form method="post" enctype="multipart/form-data">
<div class="user-box">
<input asp-for=BotToken type="text" name="BotToken" required="">
<label>Bot Token</label>
</div>
<div class="user-box">
<input asp-for=BotPrefix type="text" name="BotPrefix" required="">
<label>Bot Prefix</label>
</div>
<div class="user-box">
<input asp-for=ServerID type="text" name="ServerID">
<label>Server ID</label>
</div>
<input type="submit" class="btn btn-dark" value="Save Changes" />
</form>
</div>

View File

@@ -0,0 +1,25 @@
@model ErrorViewModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
<p>
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
</p>
<p>
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
It can result in displaying sensitive information from exceptions to end users.
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
and restarting the app.
</p>

View File

@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - DiscordBotUI</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
<link rel="stylesheet" href="~/DiscordBotUI.styles.css" asp-append-version="true" />
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="navbarColor02">
<ul class="navbar-nav me-auto">
<li class="nav-item">
<a class="nav-link text-light" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-light" asp-area="" asp-controller="Home" asp-action="Settings">Settings</a>
</li>
<li class="nav-item">
<a class="nav-link text-light" asp-area="" asp-controller="Bot" asp-action="Start">Start Bot</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>

View File

@@ -0,0 +1,48 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
a {
color: #0077cc;
}
.btn-primary {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
color: #fff;
background-color: #1b6ec2;
border-color: #1861ac;
}
.border-top {
border-top: 1px solid #e5e5e5;
}
.border-bottom {
border-bottom: 1px solid #e5e5e5;
}
.box-shadow {
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}
button.accept-policy {
font-size: 1rem;
line-height: inherit;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
white-space: nowrap;
line-height: 60px;
}

View File

@@ -0,0 +1,2 @@
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>

View File

@@ -0,0 +1,3 @@
@using DiscordBotUI
@using DiscordBotUI.Models
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

View File

@@ -0,0 +1,3 @@
@{
Layout = "_Layout";
}