feat: Implement configurable pump control preprocessing logic #5

Merged
solipsism merged 34 commits from feature/pump-control-preprocessing into master 2025-11-17 14:23:42 +00:00
1 changed files with 96 additions and 21 deletions
Showing only changes of commit 22a1059e7b - Show all commits

View File

@ -310,6 +310,80 @@ DASHBOARD_HTML = """
color: #856404;
border: 1px solid #ffeaa7;
}
/* Table Layout Fixes for Protocol Mappings */
.protocol-mappings-table-container {
overflow-x: auto;
margin-top: 20px;
}
#protocol-mappings-table {
table-layout: fixed;
width: 100%;
min-width: 800px;
}
#protocol-mappings-table th,
#protocol-mappings-table td {
padding: 8px 10px;
border: 1px solid #ddd;
text-align: left;
word-wrap: break-word;
overflow-wrap: break-word;
}
#protocol-mappings-table th:nth-child(1) { width: 10%; min-width: 80px; } /* ID */
#protocol-mappings-table th:nth-child(2) { width: 8%; min-width: 80px; } /* Protocol */
#protocol-mappings-table th:nth-child(3) { width: 15%; min-width: 120px; } /* Station */
#protocol-mappings-table th:nth-child(4) { width: 15%; min-width: 120px; } /* Equipment */
#protocol-mappings-table th:nth-child(5) { width: 15%; min-width: 120px; } /* Data Type */
#protocol-mappings-table th:nth-child(6) { width: 12%; min-width: 100px; } /* Protocol Address */
#protocol-mappings-table th:nth-child(7) { width: 15%; min-width: 120px; } /* Database Source */
#protocol-mappings-table th:nth-child(8) { width: 10%; min-width: 100px; } /* Actions */
/* Protocol Signals Table */
.protocol-signals-table-container {
overflow-x: auto;
margin-top: 20px;
}
#protocol-signals-table {
table-layout: fixed;
width: 100%;
min-width: 700px;
}
#protocol-signals-table th,
#protocol-signals-table td {
padding: 8px 10px;
border: 1px solid #ddd;
text-align: left;
word-wrap: break-word;
overflow-wrap: break-word;
}
#protocol-signals-table th:nth-child(1) { width: 20%; min-width: 120px; } /* Signal Name */
#protocol-signals-table th:nth-child(2) { width: 12%; min-width: 100px; } /* Protocol Type */
#protocol-signals-table th:nth-child(3) { width: 20%; min-width: 150px; } /* Tags */
#protocol-signals-table th:nth-child(4) { width: 15%; min-width: 100px; } /* Protocol Address */
#protocol-signals-table th:nth-child(5) { width: 18%; min-width: 120px; } /* Database Source */
#protocol-signals-table th:nth-child(6) { width: 8%; min-width: 80px; } /* Status */
#protocol-signals-table th:nth-child(7) { width: 7%; min-width: 100px; } /* Actions */
/* Mobile responsiveness */
@media (max-width: 768px) {
.protocol-mappings-table-container,
.protocol-signals-table-container {
font-size: 14px;
}
#protocol-mappings-table th,
#protocol-mappings-table td,
#protocol-signals-table th,
#protocol-signals-table td {
padding: 6px 8px;
}
}
</style>
</head>
<body>
@ -638,18 +712,18 @@ DASHBOARD_HTML = """
<button onclick="exportProtocolMappings()">Export to CSV</button>
</div>
<div style="margin-top: 20px;">
<table style="width: 100%; border-collapse: collapse;" id="protocol-mappings-table">
<div class="protocol-mappings-table-container">
<table id="protocol-mappings-table">
<thead>
<tr style="background: #f8f9fa;">
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">ID</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Protocol</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Station (Name & ID)</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Equipment (Name & ID)</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Data Type (Name & ID)</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Protocol Address</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Database Source</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Actions</th>
<th>ID</th>
<th>Protocol</th>
<th>Station (Name & ID)</th>
<th>Equipment (Name & ID)</th>
<th>Data Type (Name & ID)</th>
<th>Protocol Address</th>
<th>Database Source</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="protocol-mappings-body">
@ -659,22 +733,22 @@ DASHBOARD_HTML = """
</div>
</div>
<!-- Simplified Protocol Signals Table (for discovery integration) -->
<!-- Protocol Signals Table (for discovery integration) -->
<div class="config-section">
<h3>Protocol Signals (Simplified)</h3>
<h3>Protocol Signals</h3>
<p>Signals discovered through protocol discovery will appear here</p>
<div style="margin-top: 20px;">
<table style="width: 100%; border-collapse: collapse;" id="protocol-signals-table">
<div class="protocol-signals-table-container">
<table id="protocol-signals-table">
<thead>
<tr style="background: #f8f9fa;">
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Signal Name</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Protocol Type</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Tags</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Protocol Address</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Database Source</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Status</th>
<th style="padding: 10px; border: 1px solid #ddd; text-align: left;">Actions</th>
<th>Signal Name</th>
<th>Protocol Type</th>
<th>Tags</th>
<th>Protocol Address</th>
<th>Database Source</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody id="protocol-signals-body">
@ -827,6 +901,7 @@ DASHBOARD_HTML = """
<script src="/static/protocol_mapping.js"></script>
<script src="/static/simplified_protocol_mapping.js"></script>
<script src="/static/discovery.js"></script>
<script src="/static/simplified_discovery.js"></script>
</body>
</html>
"""