Files
Accusys c151b49334 feat: implement service management API for VLM control
- Add /api/v1/mbe/health endpoint for status checks
- Add /api/v2/service/start to start llama-server
- Add /api/v2/service/stop to stop llama-server
- Use TCP connection test for port detection (more reliable than lsof)
- Add ps aux fallback for PID detection
- Implement structured bilingual VLM tags
- Add VLM integration documentation for Studio team

Endpoints tested and working with Momentry Studio AdminView UI.
2026-10-24 02:37:53 +08:00

168 lines
8.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Momentry Monitor</title>
<script src="https://cdn.tailwindcss.com"></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
</head>
<body class="bg-gray-900 text-white min-h-screen">
<div x-data="monitorApp()" x-init="init()" class="container mx-auto px-4 py-8">
<!-- Header -->
<header class="mb-8 flex justify-between items-center">
<div>
<h1 class="text-3xl font-bold">Momentry Monitor</h1>
<p class="text-gray-400 text-sm mt-1">
Last updated: <span x-text="lastUpdate"></span>
</p>
</div>
<button @click="refresh()" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded">
Refresh
</button>
</header>
<!-- Queue Overview -->
<div class="bg-gray-800 rounded-lg p-6 mb-6">
<h2 class="text-xl font-semibold mb-4">Queue Overview</h2>
<div class="grid grid-cols-4 gap-4 text-center">
<div>
<div class="text-3xl font-bold text-yellow-400" x-text="queue.pending"></div>
<div class="text-sm text-gray-400">Pending</div>
</div>
<div>
<div class="text-3xl font-bold text-blue-400" x-text="queue.running"></div>
<div class="text-sm text-gray-400">Running</div>
</div>
<div>
<div class="text-3xl font-bold text-green-400" x-text="queue.completed"></div>
<div class="text-sm text-gray-400">Completed</div>
</div>
<div>
<div class="text-3xl font-bold text-red-400" x-text="queue.failed"></div>
<div class="text-sm text-gray-400">Failed</div>
</div>
</div>
<div class="mt-4 text-sm text-gray-400">
Currently processing: <span class="text-blue-400 font-semibold" x-text="queue.running"></span> jobs
</div>
</div>
<!-- Running Jobs -->
<div class="bg-gray-800 rounded-lg p-6 mb-6">
<h2 class="text-xl font-semibold mb-4">Running Jobs</h2>
<div class="space-y-4">
<template x-for="job in runningJobs" :key="job.job_id">
<div class="border border-gray-700 rounded-lg p-4">
<div class="flex justify-between items-start mb-3">
<div>
<div class="flex items-center gap-2">
<span class="text-lg font-semibold">Job #<span x-text="job.job_id"></span></span>
<span class="px-2 py-1 bg-blue-500/20 text-blue-400 rounded text-sm">RUNNING</span>
</div>
<div class="text-sm text-gray-400 mt-1">
<span x-text="job.file_name"></span> | UUID: <span x-text="job.file_uuid"></span>
</div>
</div>
<div class="text-right">
<div class="text-sm text-gray-400">Duration</div>
<div class="font-semibold" x-text="formatDuration(job.duration_secs)"></div>
</div>
</div>
<div class="space-y-3">
<template x-for="phase in [1,2,3,4]" :key="phase">
<div>
<div class="text-sm font-semibold mb-2"
x-text="'Phase ' + phase + ': ' + getPhaseName(phase)"></div>
<div class="grid grid-cols-4 gap-2">
<template x-for="proc in job.processors.filter(p => p.phase === phase)" :key="proc.name">
<div class="bg-gray-700 rounded p-2">
<div class="flex items-center justify-between mb-1">
<span class="text-sm" x-text="proc.name"></span>
<span x-text="getProcessorIcon(proc.status)"></span>
</div>
<div class="flex items-center gap-2">
<div class="flex-1 bg-gray-600 rounded-full h-1.5">
<div class="h-1.5 rounded-full"
:class="getProcessorColor(proc.status)"
:style="'width: ' + proc.progress + '%'"></div>
</div>
<span class="text-xs text-gray-400" x-text="proc.progress + '%'"></span>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
<div x-show="runningJobs.length === 0" class="text-center text-gray-500 py-8">
No jobs currently running
</div>
</div>
<!-- Worker Resources -->
<div class="bg-gray-800 rounded-lg p-6 mb-6">
<h2 class="text-xl font-semibold mb-4">Worker Resources</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-4">
<div>
<div class="flex justify-between mb-1">
<span>CPU</span>
<span x-text="worker.cpu_percent.toFixed(1) + '%'"></span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-blue-500 h-2 rounded-full"
:style="'width: ' + worker.cpu_percent + '%'"></div>
</div>
</div>
<div>
<div class="flex justify-between mb-1">
<span>GPU</span>
<span x-text="worker.gpu_percent.toFixed(1) + '%'"></span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-green-500 h-2 rounded-full"
:style="'width: ' + worker.gpu_percent + '%'"></div>
</div>
</div>
<div>
<div class="flex justify-between mb-1">
<span>Memory</span>
<span x-text="worker.memory_percent.toFixed(1) + '%'"></span>
</div>
<div class="w-full bg-gray-700 rounded-full h-2">
<div class="bg-purple-500 h-2 rounded-full"
:style="'width: ' + worker.memory_percent + '%'"></div>
</div>
</div>
</div>
<div class="text-sm text-gray-400">
Active Processors: <span x-text="worker.active_processors"></span> / <span x-text="worker.max_processors"></span>
</div>
<div x-show="worker.processors.length > 0" class="mt-4">
<div class="text-sm font-semibold mb-2">Active Processors:</div>
<div class="space-y-1">
<template x-for="proc in worker.processors" :key="proc.name + proc.job_id">
<div class="text-sm text-gray-400">
<span class="font-medium" x-text="proc.name"></span> (Job #<span x-text="proc.job_id"></span>)
</div>
</template>
</div>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>