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 {
background-color: #f8f9fa;
background-color: #f8f9fa !important;
color: #212529 !important;
border-top: none;
font-weight: 600;
color: #495057;
}
.client-table td {
@ -36,6 +36,19 @@
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 {
max-height: calc(100vh - 280px);
@ -93,6 +106,29 @@
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>
<div class="container">
@ -131,19 +167,15 @@
<td>
@if (state == LTEMvcApp.Models.ClientState.Connected)
{
<span class="badge badge-success">已连接</span>
}
else if (state == LTEMvcApp.Models.ClientState.Connecting)
{
<span class="badge badge-warning">连接中</span>
<span class="status-dot status-running"></span><span class="status-text">运行</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
{
<span class="badge badge-danger">已停止</span>
<span class="status-dot status-stopped"></span><span class="status-text">停止</span>
}
</td>
<td class="text-center">
@ -202,25 +234,35 @@
@section Scripts {
<script>
function startTestClient(address) {
$.post('/api/testconfig/start', { address: address })
.done(function() {
$.ajax({
url: '/api/testconfig/start',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ address: address }),
success: function() {
alert('启动请求已发送!页面将在2秒后刷新。');
setTimeout(() => location.reload(), 2000);
})
.fail(function(xhr) {
},
error: function(xhr) {
alert('启动失败:' + xhr.responseText);
});
}
});
}
function stopTestClient(address) {
$.post('/api/testconfig/stop', { address: address })
.done(function() {
$.ajax({
url: '/api/testconfig/stop',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({ address: address }),
success: function() {
alert('停止请求已发送!页面将在2秒后刷新。');
setTimeout(() => location.reload(), 2000);
})
.fail(function(xhr) {
},
error: function(xhr) {
alert('停止失败:' + xhr.responseText);
});
}
});
}
function deleteTestClient(address) {

Loading…
Cancel
Save