Browse Source

财政赤字

feature/MultiClientLog
root 1 month ago
parent
commit
5b86df5dd2
  1. 82
      LTEMvcApp/Views/Home/Index.cshtml

82
LTEMvcApp/Views/Home/Index.cshtml

@ -9,10 +9,10 @@
} }
.client-table th { .client-table th {
background-color: #f8f9fa; background-color: #f8f9fa !important;
color: #212529 !important;
border-top: none; border-top: none;
font-weight: 600; font-weight: 600;
color: #495057;
} }
.client-table td { .client-table td {
@ -36,6 +36,19 @@
padding: 0.375rem 0.75rem; padding: 0.375rem 0.75rem;
} }
.badge-red, .badge.badge-red {
background-color: #ffd6d6 !important;
color: #111 !important;
font-weight: bold !important;
font-size: 1.1rem !important;
letter-spacing: 1px !important;
box-shadow: none !important;
padding: 0.375rem 0.75rem !important;
border-radius: 0.375rem !important;
display: inline-block !important;
text-shadow: none !important;
}
/* 页面容器 */ /* 页面容器 */
.card-body { .card-body {
max-height: calc(100vh - 280px); max-height: calc(100vh - 280px);
@ -93,6 +106,29 @@
max-height: calc(100vh - 220px); max-height: calc(100vh - 220px);
} }
} }
.status-dot {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 6px;
vertical-align: middle;
}
.status-running {
background: #28a745;
}
.status-stopped {
background: #dc3545;
}
.status-idle {
background: #adb5bd;
}
.status-text {
font-weight: bold;
color: #333;
vertical-align: middle;
}
</style> </style>
<div class="container"> <div class="container">
@ -131,19 +167,15 @@
<td> <td>
@if (state == LTEMvcApp.Models.ClientState.Connected) @if (state == LTEMvcApp.Models.ClientState.Connected)
{ {
<span class="badge badge-success">已连接</span> <span class="status-dot status-running"></span><span class="status-text">运行</span>
}
else if (state == LTEMvcApp.Models.ClientState.Connecting)
{
<span class="badge badge-warning">连接中</span>
} }
else if (state == LTEMvcApp.Models.ClientState.Error) else if (state == LTEMvcApp.Models.ClientState.Stop)
{ {
<span class="badge badge-danger">错误</span> <span class="status-dot status-idle"></span><span class="status-text">未启动</span>
} }
else else
{ {
<span class="badge badge-danger">已停止</span> <span class="status-dot status-stopped"></span><span class="status-text">停止</span>
} }
</td> </td>
<td class="text-center"> <td class="text-center">
@ -202,25 +234,35 @@
@section Scripts { @section Scripts {
<script> <script>
function startTestClient(address) { function startTestClient(address) {
$.post('/api/testconfig/start', { address: address }) $.ajax({
.done(function() { url: '/api/testconfig/start',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ address: address }),
success: function() {
alert('启动请求已发送!页面将在2秒后刷新。'); alert('启动请求已发送!页面将在2秒后刷新。');
setTimeout(() => location.reload(), 2000); setTimeout(() => location.reload(), 2000);
}) },
.fail(function(xhr) { error: function(xhr) {
alert('启动失败:' + xhr.responseText); alert('启动失败:' + xhr.responseText);
}); }
});
} }
function stopTestClient(address) { function stopTestClient(address) {
$.post('/api/testconfig/stop', { address: address }) $.ajax({
.done(function() { url: '/api/testconfig/stop',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ address: address }),
success: function() {
alert('停止请求已发送!页面将在2秒后刷新。'); alert('停止请求已发送!页面将在2秒后刷新。');
setTimeout(() => location.reload(), 2000); setTimeout(() => location.reload(), 2000);
}) },
.fail(function(xhr) { error: function(xhr) {
alert('停止失败:' + xhr.responseText); alert('停止失败:' + xhr.responseText);
}); }
});
} }
function deleteTestClient(address) { function deleteTestClient(address) {

Loading…
Cancel
Save