Remotely/Server/Pages/Shared/_Layout.cshtml
Jared Goodwin 3f8d63c2c0
Azure Pipelines, Docker, and embedded server data. (#543)
* Add Azure Pipelines yml.

* Remove Server Installer.

* Update Release Build.yml for Azure Pipelines

* Update Release Build.yml

* Update Release Build.yml for Azure Pipelines

* Update Release Build.yml for Azure Pipelines

* Update Release Build.yml for Azure Pipelines

* Update Release Build.yml for Azure Pipelines

* Update signtool.exe

* Update Release Build.yml

* Update Publish.ps1

* Update pipeline and Dockerfile.

* Move docker files.

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Move files.

* Update Dockerfile

* Update Dockerfile

* Create RewritableStream.

* Finish implementation of rewritable stream and embedded data searcher.

* Remove RelayCode.

* Get branding from default org if orgId is missing.

* Update README.md

* Remove AppConstants.ServerUrl.  Fix main module file path.

* Update submodule.

* Extract embedded data in Program.cs.

* Add logging.  Update submodule.

* Remove size block.  BinaryWriter prefixes size.

* Remove unused async

* Update Immense.RemoteControl

* Update Release Build.yml for Azure Pipelines

* Update Release Build.yml for Azure Pipelines

* Use UpgradeService for determining out of date clients.
2022-12-31 19:10:40 -08:00

123 lines
4.9 KiB
Plaintext

@using Microsoft.AspNetCore.Hosting
@using Microsoft.AspNetCore.Mvc.ViewEngines
@using Remotely.Server.Services
@using Remotely.Shared.Models
@inject IApplicationConfig AppConfig
@inject IWebHostEnvironment Environment
@inject ICompositeViewEngine Engine
@inject IDataService DataService
@{
var organizationName = "Remotely";
var user = DataService.GetUserByNameWithOrg(User?.Identity?.Name);
if (user is null)
{
var defaultOrg = await DataService.GetDefaultOrganization();
if (!string.IsNullOrWhiteSpace(defaultOrg?.OrganizationName))
{
organizationName = defaultOrg.OrganizationName;
}
}
else if (!string.IsNullOrWhiteSpace(user.Organization?.OrganizationName))
{
organizationName = user.Organization.OrganizationName;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=550, user-scalable=no" />
<title>@ViewData["Title"] - Remotely</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="description" content="Remote access tools designed to get things done quickly." />
<link href="~/manifest.json" rel="manifest" />
<link rel="stylesheet" href="~/Identity/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/Identity/css/site.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
@if (user is RemotelyUser)
{
switch (user.UserOptions.Theme)
{
case Remotely.Shared.Enums.Theme.Light:
<link rel="stylesheet" href="~/css/Themes/yeti.min.css" />
<link rel="stylesheet" href="~/css/Themes/yeti.custom.css" asp-append-version="true" />
break;
case Remotely.Shared.Enums.Theme.Dark:
<link rel="stylesheet" href="~/css/Themes/darkly.min.css" />
<link rel="stylesheet" href="~/css/Themes/darkly.custom.css" asp-append-version="true" />
break;
default:
break;
}
}
else
{
if (AppConfig.Theme == Remotely.Shared.Enums.Theme.Light)
{
<link rel="stylesheet" href="~/css/Themes/yeti.min.css" />
<link rel="stylesheet" href="~/css/Themes/yeti.custom.css" asp-append-version="true" />
}
else
{
<link rel="stylesheet" href="~/css/Themes/darkly.min.css" />
<link rel="stylesheet" href="~/css/Themes/darkly.custom.css" asp-append-version="true" />
}
}
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-primary navbar-expand-sm navbar-toggleable-sm mb-3">
<div class="container">
<a class="navbar-brand text-left" href="~/">
<div>
@organizationName
</div>
<div class="logo-subtitle">Support Portal</div>
</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>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
@{
var result = Engine.FindView(ViewContext, "_LoginPartial", isMainPage: false);
}
@if (result.Success)
{
await Html.RenderPartialAsync("_LoginPartial");
}
else
{
throw new InvalidOperationException("The default Identity UI layout requires a partial view '_LoginPartial' " +
"usually located at '/Pages/_LoginPartial' or at '/Views/Shared/_LoginPartial' to work. Based on your configuration " +
$"we have looked at it in the following locations: {System.Environment.NewLine}{string.Join(System.Environment.NewLine, result.SearchedLocations)}.");
}
</div>
</div>
</nav>
</header>
<div class="container">
<main role="main" class="pb-3">
@RenderBody()
</main>
</div>
<footer class="footer border-top text-muted mt-4">
<div class="container">
&copy; @DateTimeOffset.Now.Year - <a href="https://lucency.co">Immense Networks</a>
</div>
</footer>
<script src="~/Identity/lib/jquery/dist/jquery.min.js"></script>
<script src="~/Identity/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/Identity/js/site.js" asp-append-version="true"></script>
@RenderSection("Scripts", required: false)
</body>
</html>