|
@@ -2,36 +2,44 @@ import { apiRequest } from "./common.js";
|
|
|
|
|
|
let _controllerList = [];
|
|
|
|
|
|
-export function main(container) {
|
|
|
- const params = new URLSearchParams(location.search);
|
|
|
- const facility = params.get("facility") || "(시설물 없음)";
|
|
|
+export function main(container, { facility } = {}) {
|
|
|
+ const facilityCode = facility?.name ?? "-";
|
|
|
+ const facilityDesc = facility?.description ?? "-";
|
|
|
|
|
|
container.innerHTML = `
|
|
|
- <div class="pingpage-container">
|
|
|
- <div class="content right-align">
|
|
|
- <button id="pingAllBtn">전체 Ping</button>
|
|
|
- </div>
|
|
|
+<!-- <div class="pingpage-container">-->
|
|
|
+ <section class="sub-main-info">
|
|
|
+ <fieldset>
|
|
|
+ <legend>🏭 ${facilityDesc} Network Ping Information</legend>
|
|
|
|
|
|
- <div class="content">
|
|
|
- <h2 id="facility-title">📡 ${facility} PING 결과</h2>
|
|
|
- <table id="facilityTable" class="ping-table">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>관리번호</th>
|
|
|
- <th>ID</th>
|
|
|
- <th>명칭</th>
|
|
|
- <th>IP</th>
|
|
|
- <th>상태</th>
|
|
|
- <th>마지막 ping</th>
|
|
|
- <th>명령</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody id="tableBody">
|
|
|
- <tr><td colspan="7" class="loading-text">로딩 중입니다...</td></tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <div class="ping-controls">
|
|
|
+ <button id="pingAllBtn" class="button-link">전체 Ping</button>
|
|
|
+ </div>
|
|
|
|
|
|
+ <div class="ping-table-wrapper">
|
|
|
+ <table id="facilityTable" class="ping-table">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>관리번호</th>
|
|
|
+ <th>ID</th>
|
|
|
+ <th>명칭</th>
|
|
|
+ <th>IP</th>
|
|
|
+ <th>상태</th>
|
|
|
+ <th>마지막 ping</th>
|
|
|
+ <th>명령</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="tableBody">
|
|
|
+ <tr>
|
|
|
+ <td colspan="7" class="loading-text">로딩 중입니다...</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </fieldset>
|
|
|
+</section>
|
|
|
+
|
|
|
+ <section class="sub-detail-info">
|
|
|
<div class="content">
|
|
|
<fieldset id="FileForm">
|
|
|
<legend id="logFileName">Ping Test</legend>
|
|
@@ -42,10 +50,12 @@ export function main(container) {
|
|
|
</div>
|
|
|
</fieldset>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </section>
|
|
|
+
|
|
|
+<!-- </div>-->
|
|
|
`;
|
|
|
|
|
|
- apiRequest("GET", `/api/facility/${facility}`)
|
|
|
+ apiRequest("GET", `/api/facility/${facilityCode}`)
|
|
|
.then(list => {
|
|
|
_controllerList = list || [];
|
|
|
const tbody = document.getElementById("tableBody");
|
|
@@ -58,9 +68,9 @@ export function main(container) {
|
|
|
<td>${entry.ctlrId || "-"}</td>
|
|
|
<td>${entry.istlLctnNm || "-"}</td>
|
|
|
<td>${entry.ctlrIp || "-"}</td>
|
|
|
- <td>${entry.netState === 0 ? "-" : "✅ Alive"}</td>
|
|
|
+ <td class="${entry.netState === 1 ? 'alive' : 'dead'}">${entry.netState === 0 ? "-" : "Alive"}</td>
|
|
|
<td>${entry.pingTime || "-"}</td>
|
|
|
- <td><a href="#" data-id="${entry.ctlrId}" data-name="${entry.istlLctnNm}" data-ip="${entry.ctlrIp}">ping</a></td>
|
|
|
+ <td><a href="#" class="button-link"data-id="${entry.ctlrId}" data-name="${entry.istlLctnNm}" data-ip="${entry.ctlrIp}">ping</a></td>
|
|
|
`;
|
|
|
tbody.appendChild(tr);
|
|
|
|