webhooks.client rebranded

This commit is contained in:
eiximenis 2019-03-21 11:12:07 +01:00
parent 94ff3fa8c2
commit 3d0aae8961
7 changed files with 34 additions and 11 deletions

View File

@ -4,9 +4,17 @@
ViewData["Title"] = "Home page";
}
<section class="esh-catalog-hero">
</section>
<div class="text-center">
<h1 class="display-4">Welcome</h1>
<p>eShopOnContainers - Webhook client</p>
<p>&nbsp;</p>
<img class="esh-app-footer-brand" src="~/images/brand.png" />
<h2>eShopOnContainers - Order Management</h2>
<p>
This is a <bold>sample</bold> web client that uses the Webhooks API to show you all orders that reached the "paid" status. This is accomplished by creating a Webhook
that will be called by eShopOnContainers core when the order reached this "paid" status. If not created you can create this webhook going to <a asp-page="RegisterWebhook">webhook registration</a>.
</p>
@if (!User.Identity.IsAuthenticated)
{
<a class="btn-primary btn" href="@Url.Action("SignIn", "Account")">Login</a>
@ -15,8 +23,8 @@
</div>
<div class="table">
<h3>Current webhooks received</h3>
<p>(Data since last time web started up)<p>
<h3>Current webhooks received (orders paid)</h3>
<p>(Data since last time web started up). <strong>Note: </strong>Must manually refresh this page.<p>
<table class="table">
@foreach (var webhook in Model.WebHooksReceived)
{

View File

@ -4,9 +4,9 @@
ViewData["Title"] = "RegisterWebhook";
}
<h3>Register webhook</h3>
<h3>Register a new webhook</h3>
<p>This page registers the "OrderPaid" Webhook by sending a POST to webhooks.</p>
<p>This page registers the "OrderPaid" Webhook by sending a POST to the WebHooks API. Once the Webhook is set, you will be able to see new paid orders from the <a asp-page="Index">Index</a> page.</p>
<form method="post">
<p>Token: <input type="text" asp-for="Token" /></p>
@ -15,5 +15,6 @@
@if (Model.ResponseCode != (int)System.Net.HttpStatusCode.OK)
{
<p>Error @Model.ResponseCode (@Model.ResponseMessage) when calling the Webhooks API (@Model.RequestUrl) with GrantUrl: @Model.GrantUrl):(</p>
<p>Error @Model.ResponseCode (@Model.ResponseMessage) when calling the Webhooks API (@Model.RequestUrl) with GrantUrl: @Model.GrantUrl)</p>
<p>Data sent to the webhooks API was <raw>@Model.RequestBodyJson</raw></p>
}

View File

@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using WebhookClient.Models;
namespace WebhookClient.Pages
@ -27,7 +28,7 @@ namespace WebhookClient.Pages
public string RequestUrl { get; set; }
public string GrantUrl { get; set; }
public string ResponseMessage { get; set; }
public string RequestBodyJson { get; set; }
public RegisterWebhookModel(IOptions<Settings> settings, IHttpClientFactory httpClientFactory)
{
@ -69,6 +70,7 @@ namespace WebhookClient.Pages
}
else
{
RequestBodyJson = JsonConvert.SerializeObject(payload);
ResponseCode = (int)response.StatusCode;
ResponseMessage = response.ReasonPhrase;
GrantUrl = granturl;

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - WebhookClient</title>
<title>@ViewData["Title"] - Order Management</title>
<environment include="Development">
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
@ -21,7 +21,7 @@
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">WebhookClient</a>
<a class="navbar-brand" asp-area="" asp-page="/Index">Order Management</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@ -50,7 +50,7 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2019 - WebhookClient - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
&copy; 2019 - Order Management - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
</div>
</footer>

View File

@ -54,3 +54,15 @@ body {
height: 60px;
line-height: 60px; /* Vertically center the text there */
}
.esh-catalog-hero {
background-image: url("../images/main_banner.png");
background-size: cover;
height: 260px;
width: 100%;
}
.esh-app-footer-brand {
height: 50px;
width: 230px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 851 KiB