Match TFS Changeset 303362
This commit is contained in:
47
EDA Viewer/Views/Home/Background.cshtml
Normal file
47
EDA Viewer/Views/Home/Background.cshtml
Normal file
@ -0,0 +1,47 @@
|
||||
@using EDAViewer.Controllers
|
||||
@{
|
||||
ViewBag.Title = "Background";
|
||||
int i = 0;
|
||||
string homeController = nameof(HomeController).Replace("Controller", string.Empty);
|
||||
}
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>EDA - @(ViewBag.IsPrimaryInstance) - @(ViewBag.Profile) - @(ViewBag.URLs) - 013</h1>
|
||||
<p class="lead">@(ViewBag.WorkingDirectory)</p>
|
||||
<p class="lead">@(ViewBag.Message)</p>
|
||||
<h1>@(ViewBag.ExceptionsCount)</h1>
|
||||
</div>
|
||||
<div>
|
||||
<ul>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))">Background Message</a></li>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-message_clear="true">Background Message Clear</a></li>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-exceptions_clear="true">Background Exceptions Clear</a></li>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-set_is_primary_instance="true">Background Set Is Primary Instance</a></li>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-set_is_primary_instance="false">Background Clear Primary Instance</a></li>
|
||||
<li><a asp-area="" asp-controller="@(homeController)" asp-action="@(nameof(HomeController.Background))" asp-route-invoke_eda_dcp="100">Background Invoke EDA DCP Plans Timer Change</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<p> </p>
|
||||
<hr />
|
||||
<div>
|
||||
<form action="">
|
||||
@foreach (Exception exception in ViewBag.Exceptions)
|
||||
{
|
||||
<p>
|
||||
@Html.Raw(string.Concat("<textarea name=\"message_", i, "\" rows='1' cols='400'>", exception.Message, "</textarea>"));
|
||||
</p>
|
||||
<p>
|
||||
@Html.Raw(string.Concat("<textarea name=\"stackTrace_", i, "\" rows='4' cols='400'>", exception.StackTrace, "</textarea>"));
|
||||
</p>
|
||||
<hr />
|
||||
@(i += 1);
|
||||
}
|
||||
</form>
|
||||
</div>
|
||||
@section scripts {
|
||||
<script>
|
||||
$(function () {
|
||||
console.log("ready!");
|
||||
});
|
||||
</script>
|
||||
}
|
12
EDA Viewer/Views/Home/Index.cshtml
Normal file
12
EDA Viewer/Views/Home/Index.cshtml
Normal file
@ -0,0 +1,12 @@
|
||||
@{
|
||||
ViewData["Title"] = "Home Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<component render-mode="ServerPrerendered" type="typeof(EDAViewer.Blazor.Counter)" />
|
||||
</div>
|
6
EDA Viewer/Views/Home/Privacy.cshtml
Normal file
6
EDA Viewer/Views/Home/Privacy.cshtml
Normal file
@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
182
EDA Viewer/Views/Home/ViewEdaHtmlDiff.cshtml
Normal file
182
EDA Viewer/Views/Home/ViewEdaHtmlDiff.cshtml
Normal file
@ -0,0 +1,182 @@
|
||||
@model EDAViewer.Models.EdaHtmlDiff
|
||||
@{
|
||||
ViewBag.Title = "EDA HTML Diff";
|
||||
string idForm = "Form";
|
||||
string idSubmit = "Submit";
|
||||
string idUp = "Up";
|
||||
string idRoot = "Root";
|
||||
string idRefresh = "Refresh";
|
||||
string background = "Background"; //Background
|
||||
string viewEdaHtmlDiff = "ViewEdaHtmlDiff"; //ViewEdaHtmlDiff
|
||||
string actionNameForForm = nameof(EDAViewer.Controllers.HomeController.ViewEdaHtmlDiff);
|
||||
string actionNameForList = nameof(EDAViewer.Controllers.HomeController.GetDirectoriesOrFiles);
|
||||
string homeController = nameof(EDAViewer.Controllers.HomeController).Replace("Controller", string.Empty);
|
||||
}
|
||||
|
||||
<div class="jumbotron">
|
||||
<h1>@(ViewBag.Message)</h1>
|
||||
</div>
|
||||
<div>
|
||||
@Html.Raw(ViewBag.Diff)
|
||||
<hr />
|
||||
@Html.Raw(ViewBag.OldText)
|
||||
<hr />
|
||||
@Html.Raw(ViewBag.NewText)
|
||||
<hr />
|
||||
<div style="min-height:44px;">
|
||||
<button id="@(idRoot)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Root Directory</button>
|
||||
<button id="@(idUp)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Up Directory</button>
|
||||
<button id="@(idRefresh)" style="margin-left: 50px; margin-bottom:10px" class="btn btn-info">Refresh List</button>
|
||||
</div>
|
||||
@using (Html.BeginForm(actionNameForForm, homeController, FormMethod.Post, new { id = idForm }))
|
||||
{
|
||||
@Html.AntiForgeryToken();
|
||||
@Html.ValidationSummary(true);
|
||||
@Html.HiddenFor(m => m.user_name)
|
||||
@Html.HiddenFor(m => m.machine_name)
|
||||
@Html.HiddenFor(m => m.now_ticks)
|
||||
@Html.HiddenFor(m => m.PathAndFileName)
|
||||
@Html.HiddenFor(m => m.Paths)
|
||||
<p>
|
||||
@Html.LabelFor(m => m.CurrentPath)
|
||||
@Html.DropDownListFor(m => m.CurrentPath, new SelectList(Enumerable.Empty<SelectListItem>()), htmlAttributes: new { style = "min-width:600px" })
|
||||
@Html.ValidationMessageFor(m => m.CurrentPath)
|
||||
</p>
|
||||
<p>
|
||||
@Html.LabelFor(m => m.FileName)
|
||||
@Html.TextBoxFor(m => m.FileName, htmlAttributes: new { style = "min-width:600px" })
|
||||
@Html.ValidationMessageFor(m => m.FileName)
|
||||
</p>
|
||||
<br />
|
||||
<input type="submit" value="Save" id="@(idSubmit)" class="btn btn-default" />
|
||||
}
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>@Html.RouteLink("View EDA HTML Diff", new { action = viewEdaHtmlDiff, controller = homeController })</li>
|
||||
<li>@Html.RouteLink("Background Invoke EDA DCP Plans Timer Change", new { action = background, controller = homeController, invoke_eda_dcp = 100 })</li>
|
||||
</ul>
|
||||
</div>
|
||||
@section scripts {
|
||||
<script>
|
||||
//
|
||||
function getEncodedLastPath() {
|
||||
var encodedPath;
|
||||
var control = "@(nameof(Model.Paths))";
|
||||
encodedPath = $("#" + control).val().substr(0, $("#" + control).val().lastIndexOf("|"));
|
||||
$("#" + control).val(encodedPath)
|
||||
encodedPath = encodeURIComponent($("#" + control).val());
|
||||
return encodedPath;
|
||||
}
|
||||
//
|
||||
function getEncodedCurrentPath() {
|
||||
var encodedPath;
|
||||
var control = "@(nameof(Model.CurrentPath))";
|
||||
var pathSelected = $("#" + control).val();
|
||||
if (pathSelected == null) {
|
||||
encodedPath = "";
|
||||
}
|
||||
else {
|
||||
$("#@(nameof(Model.FileName))").val($("#" + control + " option:selected").text());
|
||||
$("#@(nameof(Model.PathAndFileName))").val(pathSelected);
|
||||
encodedPath = encodeURIComponent(pathSelected);
|
||||
}
|
||||
return encodedPath;
|
||||
}
|
||||
//
|
||||
function setList(prefix, encodedPath, upDirectory) {
|
||||
var actionName = prefix + "@(actionNameForList)?path=" + encodedPath + "&upDirectory=" + upDirectory + "&filter=";
|
||||
$('select').empty();
|
||||
$("#@(idUp)").hide();
|
||||
$("#@(idRoot)").hide();
|
||||
$("#@(idRefresh)").hide();
|
||||
$("#@(nameof(Model.CurrentPath))").hide();
|
||||
//
|
||||
$.ajax({
|
||||
url: actionName,
|
||||
type: "GET",
|
||||
contentType: "application/json; charset=utf-8",
|
||||
datatype: JSON,
|
||||
success: function (result) {
|
||||
if (result.length > 7000) {
|
||||
setList("../", encodedPath, upDirectory);
|
||||
}
|
||||
else {
|
||||
var control = "@(nameof(Model.CurrentPath))";
|
||||
$(result).each(function (index, value) {
|
||||
$("#" + control).append($("<option></option>").val(value.value).html(value.text));
|
||||
});
|
||||
console.log("results lenght {" + result.length + "}");
|
||||
if (result.length == 1) {
|
||||
console.log("selecting first option");
|
||||
$("select#elem").attr('selectedIndex', 0);
|
||||
console.log("selected first option");
|
||||
}
|
||||
$("#@(nameof(Model.CurrentPath))").show();
|
||||
$("#@(idRefresh)").show();
|
||||
$("#@(idRoot)").show();
|
||||
$("#@(idUp)").show();
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
},
|
||||
always: function (data) {
|
||||
$("#@(nameof(Model.CurrentPath))").show();
|
||||
$("#@(idRefresh)").show();
|
||||
$("#@(idRoot)").show();
|
||||
$("#@(idUp)").show();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function () {
|
||||
//
|
||||
console.log("ready!");
|
||||
//
|
||||
$("#@(idRefresh)").click(function (e) {
|
||||
$('#message').html('');
|
||||
var encodedPath = getEncodedCurrentPath();
|
||||
setList("", encodedPath, false);
|
||||
});
|
||||
//
|
||||
$("#@(idUp)").click(function (e) {
|
||||
$('#message').html('');
|
||||
var encodedPath = getEncodedLastPath();
|
||||
setList("", encodedPath, true);
|
||||
});
|
||||
//
|
||||
$("#@(idRoot)").click(function (e) {
|
||||
$('#message').html('');
|
||||
var encodedPath = "";
|
||||
setList("", encodedPath, false);
|
||||
});
|
||||
//
|
||||
$("#@(idSubmit)").click(function (e) {
|
||||
//$("#@(idSubmit)").hide();
|
||||
//e.preventDefault();
|
||||
});
|
||||
//
|
||||
$("select").change(function () {
|
||||
var str = "";
|
||||
$("select option:selected").each(function () {
|
||||
str += $(this).text() + " ";
|
||||
});
|
||||
console.debug(str);
|
||||
if (str.length > 0) {
|
||||
var control = "@(nameof(Model.CurrentPath))";
|
||||
var encodedPath = getEncodedCurrentPath();
|
||||
if (encodedPath.length > 0) {
|
||||
var pathsValue =$("#@(nameof(Model.Paths))").val();
|
||||
$("#@(nameof(Model.Paths))").val(pathsValue + "|" + $("#" + control).val());
|
||||
}
|
||||
setList("", encodedPath, false);
|
||||
}
|
||||
}).change();
|
||||
//
|
||||
$("#@(idForm)").removeAttr("novalidate");
|
||||
//
|
||||
setList("", encodeURIComponent("@(Model.CurrentPath.Replace(@"\",@"\\"))"), false);
|
||||
//
|
||||
});
|
||||
</script>
|
||||
}
|
25
EDA Viewer/Views/Shared/Error.cshtml
Normal file
25
EDA Viewer/Views/Shared/Error.cshtml
Normal file
@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
71
EDA Viewer/Views/Shared/_Layout.cshtml
Normal file
71
EDA Viewer/Views/Shared/_Layout.cshtml
Normal file
@ -0,0 +1,71 @@
|
||||
@using EDAViewer.Controllers
|
||||
@{
|
||||
string index = nameof(HomeController.Index);
|
||||
string privacy = nameof(HomeController.Privacy);
|
||||
string background = nameof(HomeController.Background);
|
||||
string homeController = nameof(HomeController).Replace("Controller", string.Empty);
|
||||
string schemeHostURL = string.Concat(Context.Request.Scheme, "://", Context.Request.Host);
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
@await RenderSectionAsync("Meta", required: false)
|
||||
<title>@ViewData["Title"] - EDAViewer</title>
|
||||
|
||||
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
|
||||
|
||||
<environment exclude="Staging,Development">
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="@(schemeHostURL)/Common%20Shared%20Repository/HTML5Shiv/3.7.2/html5shiv.js"></script>
|
||||
<script src="@(schemeHostURL)/Common%20Shared%20Repository/Respond/1.4.2/respond.js"></script>
|
||||
<![endif]-->
|
||||
</environment>
|
||||
|
||||
<link href="~/css/bundles/css.css" rel="stylesheet" />
|
||||
<base href="~/" />
|
||||
@await RenderSectionAsync("Style", required: false)
|
||||
|
||||
<script src="~/js/bundles/modernizr.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" asp-area="" asp-controller="@(homeController)" asp-action="@(index)">EDA Viewer</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="@(homeController)" asp-action="@(background)">Background</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="container body-content">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2021 - EDAViewer - <a asp-area="" asp-controller="@(homeController)" asp-action="@(privacy)">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/js/bundles/jquery.js"></script>
|
||||
<script src="~/js/bundles/bootstrap.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
<!--script src="_framework/blazor.server.js" asp-append-version="true"></script-->
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
2
EDA Viewer/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
2
EDA Viewer/Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
@ -0,0 +1,2 @@
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
3
EDA Viewer/Views/_ViewImports.cshtml
Normal file
3
EDA Viewer/Views/_ViewImports.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@using EDAViewer
|
||||
@using EDAViewer.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
3
EDA Viewer/Views/_ViewStart.cshtml
Normal file
3
EDA Viewer/Views/_ViewStart.cshtml
Normal file
@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
Reference in New Issue
Block a user