add scaffolding for web UI (#358)

This commit is contained in:
Jesse Plamondon-Willard 2017-10-27 19:36:31 -04:00
parent 3d8bdacc8c
commit 65f0fa6255
7 changed files with 143 additions and 3 deletions

View File

@ -14,8 +14,8 @@ namespace StardewModdingAPI.Web.Controllers
{
/// <summary>Provides an API to perform mod update checks.</summary>
[Produces("application/json")]
[Route("api/{version:semanticVersion}/[controller]")]
internal class ModsController : Controller
[Route("api/{version:semanticVersion}/mods")]
internal class ModsApiController : Controller
{
/*********
** Properties
@ -39,7 +39,7 @@ namespace StardewModdingAPI.Web.Controllers
/// <summary>Construct an instance.</summary>
/// <param name="cache">The cache in which to store mod metadata.</param>
/// <param name="configProvider">The config settings for mod update checks.</param>
public ModsController(IMemoryCache cache, IOptions<ModUpdateCheckConfig> configProvider)
public ModsApiController(IMemoryCache cache, IOptions<ModUpdateCheckConfig> configProvider)
{
ModUpdateCheckConfig config = configProvider.Value;

View File

@ -64,6 +64,7 @@ namespace StardewModdingAPI.Web
loggerFactory.AddDebug();
app
.UseRewriter(new RewriteOptions().Add(new RewriteSubdomainRule())) // convert subdomain.smapi.io => smapi.io/subdomain for routing
.UseStaticFiles() // wwwroot folder
.UseMvc();
}
}

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewData["Title"] - SMAPI.io</title>
<link rel="stylesheet" href="~/Content/main.css" />
</head>
<body>
<div id="sidebar">
<h4>SMAPI</h4>
<ul>
<li><a href="https://stardewvalleywiki.com/Modding:Index">FAQs & guides</a></li>
<li><a href="https://github.com/pathoschild/SMAPI/releases">Download SMAPI</a></li>
<li><a href="https://discord.gg/stardewvalley">Get help on Discord</a></li>
</ul>
</div>
<div id="content-column">
<div id="content">
<h1>@ViewData["Title"]</h1>
@RenderBody()
</div>
<div id="footer">
<div id="license">
Hi! You can <a href="https://github.com/pathoschild/SMAPI" title="view source">view the source code</a> or <a href="https://github.com/pathoschild/SMAPI/issues" title="report issue">report a bug or suggestion</a>.
</div>
</div>
</div>
</body>
</html>

View File

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

View File

@ -0,0 +1,107 @@
/* tags */
html {
height: 100%;
}
body {
height: 100%;
font-family: sans-serif;
}
h1, h2, h3 {
font-weight: bold;
margin: 0.2em 0 0.1em 0;
padding-top: .5em;
}
h1 {
font-size: 1.5em;
color: #888;
margin-bottom: 0;
}
h2 {
font-size: 1.5em;
border-bottom: 1px solid #AAA;
}
h3 {
font-size: 1.2em;
border-bottom: 1px solid #AAA;
width: 50%;
}
a {
color: #006;
}
/* content */
#content-column {
position: absolute;
top: 1em;
left: 10em;
}
#content {
min-height: 140px;
padding: 0 1em 1em 1em;
border-left: 1px solid #CCC;
background: #FFF;
font-size: 0.9em;
}
#content p {
max-width: 55em;
}
.section {
border: 1px solid #CCC;
padding: 0.5em;
margin-bottom: 1em;
}
/* sidebar */
#sidebar {
margin-top: 3em;
min-height: 75%;
width: 12em;
background: url("sidebar-bg.gif") no-repeat top right;
color: #666;
}
#sidebar h4 {
margin: 0 0 0.2em 0;
width: 10em;
border-bottom: 1px solid #CCC;
font-size: 0.8em;
font-weight: normal;
}
#sidebar a {
color: #77B;
border: 0;
}
#sidebar ul, #sidebar li {
margin: 0;
padding: 0;
list-style: none none;
font-size: 0.9em;
color: #888;
}
#sidebar li {
margin-left: 1em;
}
/* footer */
#footer {
margin: 1em;
padding: 1em;
font-size: 0.6em;
color: gray;
}
#footer a {
color: #669;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB