webhooks.client rebranded
This commit is contained in:
parent
94ff3fa8c2
commit
3d0aae8961
@ -4,9 +4,17 @@
|
|||||||
ViewData["Title"] = "Home page";
|
ViewData["Title"] = "Home page";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<section class="esh-catalog-hero">
|
||||||
|
</section>
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1 class="display-4">Welcome</h1>
|
<p> </p>
|
||||||
<p>eShopOnContainers - Webhook client</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)
|
@if (!User.Identity.IsAuthenticated)
|
||||||
{
|
{
|
||||||
<a class="btn-primary btn" href="@Url.Action("SignIn", "Account")">Login</a>
|
<a class="btn-primary btn" href="@Url.Action("SignIn", "Account")">Login</a>
|
||||||
@ -15,8 +23,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<h3>Current webhooks received</h3>
|
<h3>Current webhooks received (orders paid)</h3>
|
||||||
<p>(Data since last time web started up)<p>
|
<p>(Data since last time web started up). <strong>Note: </strong>Must manually refresh this page.<p>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
@foreach (var webhook in Model.WebHooksReceived)
|
@foreach (var webhook in Model.WebHooksReceived)
|
||||||
{
|
{
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
ViewData["Title"] = "RegisterWebhook";
|
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">
|
<form method="post">
|
||||||
<p>Token: <input type="text" asp-for="Token" /></p>
|
<p>Token: <input type="text" asp-for="Token" /></p>
|
||||||
@ -15,5 +15,6 @@
|
|||||||
|
|
||||||
@if (Model.ResponseCode != (int)System.Net.HttpStatusCode.OK)
|
@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>
|
||||||
}
|
}
|
@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using WebhookClient.Models;
|
using WebhookClient.Models;
|
||||||
|
|
||||||
namespace WebhookClient.Pages
|
namespace WebhookClient.Pages
|
||||||
@ -27,7 +28,7 @@ namespace WebhookClient.Pages
|
|||||||
public string RequestUrl { get; set; }
|
public string RequestUrl { get; set; }
|
||||||
public string GrantUrl { get; set; }
|
public string GrantUrl { get; set; }
|
||||||
public string ResponseMessage { get; set; }
|
public string ResponseMessage { get; set; }
|
||||||
|
public string RequestBodyJson { get; set; }
|
||||||
|
|
||||||
public RegisterWebhookModel(IOptions<Settings> settings, IHttpClientFactory httpClientFactory)
|
public RegisterWebhookModel(IOptions<Settings> settings, IHttpClientFactory httpClientFactory)
|
||||||
{
|
{
|
||||||
@ -69,6 +70,7 @@ namespace WebhookClient.Pages
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
RequestBodyJson = JsonConvert.SerializeObject(payload);
|
||||||
ResponseCode = (int)response.StatusCode;
|
ResponseCode = (int)response.StatusCode;
|
||||||
ResponseMessage = response.ReasonPhrase;
|
ResponseMessage = response.ReasonPhrase;
|
||||||
GrantUrl = granturl;
|
GrantUrl = granturl;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<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">
|
<environment include="Development">
|
||||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||||
@ -21,7 +21,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container">
|
<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"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<footer class="border-top footer text-muted">
|
<footer class="border-top footer text-muted">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
© 2019 - WebhookClient - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
|
© 2019 - Order Management - <a asp-area="" asp-page="/RegisterWebhook">Register Webhook</a> | <a asp-area="" asp-page="/WebhooksList">Webhooks registered in API</a>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
@ -54,3 +54,15 @@ body {
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 60px; /* Vertically center the text there */
|
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;
|
||||||
|
}
|
||||||
|
BIN
src/Web/WebhookClient/wwwroot/images/brand.png
Normal file
BIN
src/Web/WebhookClient/wwwroot/images/brand.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.9 KiB |
BIN
src/Web/WebhookClient/wwwroot/images/main_banner.png
Normal file
BIN
src/Web/WebhookClient/wwwroot/images/main_banner.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 851 KiB |
Loading…
x
Reference in New Issue
Block a user