분리후 첫 Crawling 성공 모델
This commit is contained in:
24
OpcPksPlatform/OpcPks.Web/Views/Engineering/Admin.cshtml
Normal file
24
OpcPksPlatform/OpcPks.Web/Views/Engineering/Admin.cshtml
Normal file
@@ -0,0 +1,24 @@
|
||||
<div class="card border-danger">
|
||||
<div class="card-header bg-danger text-white">System Engineering - Discovery Mode</div>
|
||||
<div class="card-body">
|
||||
<h5>1. 하니웰 자산 모델 탐사 (Crawler)</h5>
|
||||
<p class="text-muted">서버의 모든 노드를 훑어 CSV 파일을 생성합니다. (시간이 오래 걸릴 수 있음)</p>
|
||||
<button id="btnRunCrawler" class="btn btn-danger" onclick="runCrawler()">🚀 탐사 및 CSV 생성 시작</button>
|
||||
|
||||
<hr>
|
||||
|
||||
<h5>2. DB 동기화 (CSV to Database)</h5>
|
||||
<p class="text-muted">생성된 Honeywell_FullMap.csv 파일을 읽어 DB에 일괄 저장합니다.</p>
|
||||
<button id="btnImportCsv" class="btn btn-warning" onclick="importCsvToDb()">📥 CSV 데이터를 DB로 가져오기</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function runCrawler() {
|
||||
if(!confirm("전체 노드 탐사를 시작하시겠습니까? 하니웰 서버에 부하가 갈 수 있습니다.")) return;
|
||||
// API 호출: /Engineering/RunCrawler
|
||||
}
|
||||
function importCsvToDb() {
|
||||
// API 호출: /Engineering/ImportCsv
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,51 @@
|
||||
@{
|
||||
ViewData["Title"] = "Honeywell Engineering";
|
||||
}
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="card border-success shadow">
|
||||
<div class="card-header bg-success text-white">
|
||||
<strong>✅ Connection Verified (Ready to Crawl)</strong>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<h5 class="mb-4">하니웰 서버 탐사 준비 완료</h5>
|
||||
|
||||
<button type="button" onclick="startHoneywellCrawler()" class="btn btn-success btn-lg px-5 fw-bold">
|
||||
🚀 Run Honeywell Crawler
|
||||
</button>
|
||||
|
||||
<div id="debugLog" class="mt-4 p-3 bg-light text-start small border" style="display:none; max-height: 200px; overflow-y: auto;">
|
||||
<strong>로그:</strong> <div id="logContent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function startHoneywellCrawler() {
|
||||
const logDiv = document.getElementById('debugLog');
|
||||
const content = document.getElementById('logContent');
|
||||
logDiv.style.display = 'block';
|
||||
content.innerHTML += "<div>📡 서버에 탐사 신호를 보냅니다...</div>";
|
||||
|
||||
// curl -X POST와 동일한 동작
|
||||
fetch('/Engineering/RunCrawler', {
|
||||
method: 'POST'
|
||||
})
|
||||
.then(async res => {
|
||||
const data = await res.json();
|
||||
content.innerHTML += `<div>📥 서버 응답 (${res.status}): ${data.message || '완료'}</div>`;
|
||||
|
||||
if (res.ok) {
|
||||
alert("성공! 우분투 터미널에서 탐사 진행 상황을 확인하세요.");
|
||||
} else {
|
||||
// 아까 curl에서 보셨던 인증서 에러가 여기 팝업으로 뜰 겁니다.
|
||||
alert("서버 내부 로직 에러: " + (data.message || "알 수 없는 오류"));
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
content.innerHTML += `<div class="text-danger">❌ 통신 실패: ${err}</div>`;
|
||||
alert("서버 연결 실패!");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
6
OpcPksPlatform/OpcPks.Web/Views/Home/Privacy.cshtml
Normal file
6
OpcPksPlatform/OpcPks.Web/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>
|
||||
37
OpcPksPlatform/OpcPks.Web/Views/Home/index.cshtml
Normal file
37
OpcPksPlatform/OpcPks.Web/Views/Home/index.cshtml
Normal file
@@ -0,0 +1,37 @@
|
||||
cat <<EOF > ~/projects/OpcPksPlatform/OpcPks.Web/Views/Home/Index.cshtml
|
||||
@{
|
||||
ViewData["Title"] = "PKS 통합 플랫폼";
|
||||
}
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="p-5 mb-4 bg-light rounded-3 border">
|
||||
<div class="container-fluid py-5 text-center">
|
||||
<h1 class="display-5 fw-bold text-primary">Honeywell PKS 관리 플랫폼</h1>
|
||||
<p class="col-md-12 fs-4 mt-3">
|
||||
OPC UA 기반의 실시간 데이터 수집 및 엔지니어링 도구입니다.<br/>
|
||||
하니웰 자산 모델(Asset Model) 탐사 및 태그 등록을 시작하세요.
|
||||
</p>
|
||||
<hr class="my-4">
|
||||
<div class="d-grid gap-3 d-sm-flex justify-content-sm-center">
|
||||
<a href="/Engineering/TagExplorer" class="btn btn-primary btn-lg px-4">태그 탐색기 실행</a>
|
||||
<a href="/Engineering/Admin" class="btn btn-outline-secondary btn-lg px-4">시스템 관리</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row align-items-md-stretch text-center">
|
||||
<div class="col-md-6">
|
||||
<div class="h-100 p-4 border rounded-3 bg-white">
|
||||
<h2>데이터 동기화</h2>
|
||||
<p>CSV 파일로부터 하니웰 노드 맵을 읽어와 로컬 데이터베이스와 동기화합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="h-100 p-4 border rounded-3 bg-white">
|
||||
<h2>실시간 모니터링</h2>
|
||||
<p>등록된 태그들의 현재값(PV, SP, OP) 및 알람 상태를 실시간으로 확인합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
EOF
|
||||
25
OpcPksPlatform/OpcPks.Web/Views/Shared/Error.cshtml
Normal file
25
OpcPksPlatform/OpcPks.Web/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>
|
||||
49
OpcPksPlatform/OpcPks.Web/Views/Shared/_Layout.cshtml
Normal file
49
OpcPksPlatform/OpcPks.Web/Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - OpcPks.Web</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/OpcPks.Web.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">OpcPks.Web</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-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 justify-content-between">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2026 - OpcPks.Web - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
48
OpcPksPlatform/OpcPks.Web/Views/Shared/_Layout.cshtml.css
Normal file
48
OpcPksPlatform/OpcPks.Web/Views/Shared/_Layout.cshtml.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
for details on configuring this project to bundle and minify static web assets. */
|
||||
|
||||
a.navbar-brand {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0077cc;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
button.accept-policy {
|
||||
font-size: 1rem;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
line-height: 60px;
|
||||
}
|
||||
@@ -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
OpcPksPlatform/OpcPks.Web/Views/_ViewImports.cshtml
Normal file
3
OpcPksPlatform/OpcPks.Web/Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@using OpcPks.Web
|
||||
@using OpcPks.Web.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
3
OpcPksPlatform/OpcPks.Web/Views/_ViewStart.cshtml
Normal file
3
OpcPksPlatform/OpcPks.Web/Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
Reference in New Issue
Block a user