update console
This commit is contained in:
@@ -3,111 +3,16 @@
|
||||
@push('viewStyles')
|
||||
<link rel="stylesheet" href="{{ asset('lib/wmks/css/wmks-all.css') }}" />
|
||||
<link rel="stylesheet" href="{{ asset('lib/adminlte/adminlte.css') }}">
|
||||
<style>
|
||||
.console-container {
|
||||
background: #1a1a1a;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.console-header {
|
||||
background: #2a2a2a;
|
||||
border-bottom: 1px solid #3a3a3a;
|
||||
padding: 12px 20px;
|
||||
}
|
||||
|
||||
.control-panel {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e5e7eb;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #3b82f6;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #2563eb;
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
background: #f8f9fa;
|
||||
color: #374151;
|
||||
border: 1px solid #d1d5db;
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.btn-secondary:hover {
|
||||
background: #e5e7eb;
|
||||
}
|
||||
|
||||
.input-field {
|
||||
width: 100%;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #d1d5db;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
transition: border-color 0.2s;
|
||||
}
|
||||
|
||||
.input-field:focus {
|
||||
outline: none;
|
||||
border-color: #3b82f6;
|
||||
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 3px solid #e5e7eb;
|
||||
border-top: 3px solid #3b82f6;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #111827;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.status-connecting { background: #f59e0b; }
|
||||
.status-connected { background: #10b981; }
|
||||
.status-error { background: #ef4444; }
|
||||
</style>
|
||||
<link rel="stylesheet" href="{{ asset('css/service/console.css') }}">
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="min-h-screen bg-gray-50">
|
||||
<div class="container mx-auto px-6 py-8">
|
||||
|
||||
|
||||
<!-- Main Layout: 2 Columns -->
|
||||
<div class="grid grid-cols-1 lg:grid-cols-4 gap-6">
|
||||
|
||||
|
||||
<!-- Console Display - Main Column (3/4) -->
|
||||
<div class="lg:col-span-3">
|
||||
<div class="console-container">
|
||||
@@ -122,89 +27,72 @@
|
||||
</div>
|
||||
<div class="flex items-center space-x-3">
|
||||
<span class="status-dot status-connecting" id="statusDot"></span>
|
||||
<span class="text-sm text-gray-400" id="statusText">Connecting...</span>
|
||||
<span class="text-sm text-gray-400" id="statusText">Đang kết nối...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Loading State -->
|
||||
<div id="loadingState" class="w-full h-[70vh] flex items-center justify-center bg-gray-900">
|
||||
<div class="text-center">
|
||||
<div class="loading-spinner mx-auto mb-4"></div>
|
||||
<h3 class="text-xl font-medium text-white mb-2">Connecting to vCenter</h3>
|
||||
<p class="text-gray-400">Please wait...</p>
|
||||
<h3 class="text-xl font-medium text-white mb-2">Đang kết nối với vCenter</h3>
|
||||
<p class="text-gray-400">Vui lòng chờ...</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Console Display -->
|
||||
<div id="wmksContainer" class="w-full h-[70vh] relative bg-black hidden">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Control Panel - Sidebar (1/4) -->
|
||||
<div class="lg:col-span-1">
|
||||
<div class="space-y-6">
|
||||
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="control-panel p-6">
|
||||
<h3 class="section-title">Control Panel</h3>
|
||||
|
||||
<h3 class="section-title">Bảng điều khiển</h3>
|
||||
|
||||
<div class="space-y-3">
|
||||
<button onclick="enterFullScreen()"
|
||||
class="btn-secondary w-full flex items-center justify-center">
|
||||
<button onclick="enterFullScreen()"
|
||||
class="btn-secondary w-full flex items-center justify-center">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" />
|
||||
</svg>
|
||||
Full Screen
|
||||
Toàn màn hình
|
||||
</button>
|
||||
|
||||
<button onclick="sendCAD()"
|
||||
class="btn-secondary w-full flex items-center justify-center">
|
||||
|
||||
<button onclick="sendCAD()" class="btn-secondary w-full flex items-center justify-center">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
|
||||
</svg>
|
||||
Ctrl + Alt + Del
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Text Input -->
|
||||
<div class="control-panel p-6">
|
||||
<h4 class="section-title">Send Text</h4>
|
||||
|
||||
<h4 class="section-title">Gửi văn bản</h4>
|
||||
|
||||
<div class="space-y-3">
|
||||
<input type="text"
|
||||
id="sendStringText"
|
||||
placeholder="Type your message..."
|
||||
class="input-field"/>
|
||||
|
||||
<button onclick="sendInputString()"
|
||||
class="btn-primary w-full flex items-center justify-center">
|
||||
<input type="text" id="sendStringText" placeholder="Type your message..."
|
||||
class="input-field" />
|
||||
|
||||
<button onclick="sendInputString()"
|
||||
class="btn-primary w-full flex items-center justify-center">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8"/>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
|
||||
</svg>
|
||||
Send
|
||||
Gửi
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Help -->
|
||||
<div class="control-panel p-6">
|
||||
<h4 class="section-title">Keyboard Shortcuts</h4>
|
||||
|
||||
<div class="space-y-2 text-sm text-gray-600">
|
||||
<div class="flex justify-between">
|
||||
<span>Full Screen</span>
|
||||
<code class="bg-gray-100 px-2 py-1 rounded text-xs">F11</code>
|
||||
</div>
|
||||
<div class="flex justify-between">
|
||||
<span>Send Text</span>
|
||||
<code class="bg-gray-100 px-2 py-1 rounded text-xs">Ctrl+Enter</code>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -228,11 +116,11 @@
|
||||
.register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE, function(event, data) {
|
||||
if (data.state === WMKS.CONST.ConnectionState.CONNECTED) {
|
||||
console.log("Connected successfully");
|
||||
|
||||
|
||||
// Update status
|
||||
$('#statusDot').removeClass('status-connecting').addClass('status-connected');
|
||||
$('#statusText').text('Connected');
|
||||
|
||||
|
||||
// Hide loading and show console
|
||||
$('#loadingState').addClass('hidden');
|
||||
$('#wmksContainer').removeClass('hidden');
|
||||
@@ -328,7 +216,7 @@
|
||||
e.preventDefault();
|
||||
enterFullScreen();
|
||||
}
|
||||
|
||||
|
||||
if (e.ctrlKey && e.key === 'Enter') {
|
||||
sendInputString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user