Match TFS Changeset 303362

This commit is contained in:
2022-02-01 19:56:15 -07:00
parent 306279760c
commit 053c873d6b
151 changed files with 49858 additions and 13 deletions

View 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>&nbsp;</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>
}

View 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>

View 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>

View 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>
}