2022-03-02 18:28:12 +01:00
|
|
|
@using BTCPayServer.Abstractions.Extensions
|
2022-08-21 20:38:14 +02:00
|
|
|
@using Microsoft.AspNetCore.Hosting
|
|
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
|
|
@using Newtonsoft.Json.Linq
|
|
|
|
@using System.IO
|
2023-07-22 14:15:41 +02:00
|
|
|
@using BTCPayServer.Services
|
2023-01-30 09:23:49 +01:00
|
|
|
@inject IWebHostEnvironment WebHostEnvironment
|
2023-07-22 14:15:41 +02:00
|
|
|
@inject BTCPayServerEnvironment Env
|
2022-07-18 20:51:53 +02:00
|
|
|
@model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel
|
2018-04-03 11:50:41 +09:00
|
|
|
@{
|
2023-01-30 09:23:49 +01:00
|
|
|
ViewData["Title"] = string.IsNullOrEmpty(Model.Title) ? Model.StoreName : Model.Title;
|
2018-04-03 11:50:41 +09:00
|
|
|
Layout = null;
|
2022-08-21 20:38:14 +02:00
|
|
|
|
|
|
|
async Task<string> GetDynamicManifest(string title)
|
|
|
|
{
|
|
|
|
var manifest = WebHostEnvironment.WebRootFileProvider.GetFileInfo("manifest.json");
|
|
|
|
if (!manifest.Exists)
|
|
|
|
{
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
using var reader = new StreamReader(manifest.CreateReadStream());
|
|
|
|
var jObject = JObject.Parse(await reader.ReadToEndAsync());
|
|
|
|
jObject["short_name"] = title;
|
|
|
|
jObject["name"] = $"BTCPay Server: {title}";
|
2022-11-28 12:35:52 +01:00
|
|
|
foreach (var jToken in jObject["icons"]!)
|
|
|
|
{
|
|
|
|
var icon = (JObject)jToken;
|
|
|
|
icon["src"] = $"{Context.Request.GetAbsoluteRoot()}/{icon["src"]}";
|
|
|
|
}
|
|
|
|
return $"data:application/manifest+json,{Safe.Json(jObject)}";
|
2022-08-21 20:38:14 +02:00
|
|
|
}
|
2018-04-03 11:50:41 +09:00
|
|
|
}
|
|
|
|
<!DOCTYPE html>
|
2023-01-30 09:23:49 +01:00
|
|
|
<html class="h-100" lang="en" @(Env.IsDeveloping ? " data-devenv" : "")>
|
2018-04-03 11:50:41 +09:00
|
|
|
<head>
|
2023-01-30 09:23:49 +01:00
|
|
|
<partial name="LayoutHead"/>
|
|
|
|
<partial name="LayoutHeadStoreBranding" model="@(Model.BrandColor, Model.CssFileId, Model.CustomCSSLink, Model.EmbeddedCSS)" />
|
2018-04-03 11:50:41 +09:00
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
2018-12-13 21:36:19 +08:00
|
|
|
<link rel="apple-touch-icon" href="~/img/icons/icon-512x512.png">
|
|
|
|
<link rel="apple-touch-startup-image" href="~/img/splash.png">
|
2023-01-30 09:23:49 +01:00
|
|
|
<link rel="manifest" href="@(await GetDynamicManifest(ViewData["Title"]!.ToString()))">
|
2023-07-22 14:15:41 +02:00
|
|
|
<link href="~/pos/common.css" asp-append-version="true" rel="stylesheet" />
|
2023-02-10 16:26:38 +01:00
|
|
|
@await RenderSectionAsync("PageHeadContent", false)
|
2018-04-03 11:50:41 +09:00
|
|
|
</head>
|
2023-01-30 09:23:49 +01:00
|
|
|
<body class="min-vh-100">
|
2020-05-28 08:50:04 +02:00
|
|
|
@RenderBody()
|
2023-02-10 16:26:38 +01:00
|
|
|
<partial name="LayoutFoot"/>
|
|
|
|
@await RenderSectionAsync("PageFootContent", false)
|
2018-04-03 11:50:41 +09:00
|
|
|
</body>
|
|
|
|
</html>
|