Add 3 files
Browse files- README.md +6 -4
- index.html +375 -18
- prompts.txt +0 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: ver2
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: gray
|
| 5 |
colorTo: red
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,376 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="ru">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
+
<title>MES System</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com "></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css "/>
|
| 9 |
+
<style>
|
| 10 |
+
.notification-badge {
|
| 11 |
+
position: absolute;
|
| 12 |
+
top: 0;
|
| 13 |
+
right: 0;
|
| 14 |
+
font-size: 0.625rem;
|
| 15 |
+
line-height: 1.25rem;
|
| 16 |
+
width: 1.25rem;
|
| 17 |
+
height: 1.25rem;
|
| 18 |
+
display: flex;
|
| 19 |
+
align-items: center;
|
| 20 |
+
justify-content: center;
|
| 21 |
+
border-radius: 9999px;
|
| 22 |
+
}
|
| 23 |
+
</style>
|
| 24 |
+
</head>
|
| 25 |
+
<body class="bg-gray-100 text-gray-900">
|
| 26 |
+
|
| 27 |
+
<!-- Sidebar -->
|
| 28 |
+
<div id="sidebar" class="fixed top-0 left-0 h-full bg-blue-800 text-white w-64 p-4 transition-all duration-300 z-10">
|
| 29 |
+
<div class="flex items-center justify-between mb-6">
|
| 30 |
+
<h1 class="text-xl font-bold">MES System</h1>
|
| 31 |
+
<button onclick="toggleSidebar()" class="text-white hover:text-blue-200">
|
| 32 |
+
<i class="fas fa-bars"></i>
|
| 33 |
+
</button>
|
| 34 |
+
</div>
|
| 35 |
+
|
| 36 |
+
<nav>
|
| 37 |
+
<ul class="space-y-2">
|
| 38 |
+
<li><button onclick="showTab('dashboard')" class="tab-btn active w-full text-left px-4 py-2 rounded-lg bg-blue-700"><i class="fas fa-tachometer-alt mr-2"></i> Главная</button></li>
|
| 39 |
+
<li><button onclick="showTab('schedule')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-calendar-alt mr-2"></i> График ТО</button></li>
|
| 40 |
+
<li><button onclick="showTab('equipment')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-tools mr-2"></i> Оборудование</button></li>
|
| 41 |
+
<li><button onclick="showTab('repairs')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-wrench mr-2"></i> Ремонт</button></li>
|
| 42 |
+
<li><button onclick="showTab('maintenance')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-clipboard-check mr-2"></i> Техобслуживание</button></li>
|
| 43 |
+
<li><button onclick="showTab('reports')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-chart-line mr-2"></i> Отчеты</button></li>
|
| 44 |
+
<li><button onclick="showTab('users')" class="tab-btn w-full text-left px-4 py-2 rounded-lg hover:bg-blue-700"><i class="fas fa-users-cog mr-2"></i> Пользователи</button></li>
|
| 45 |
+
</ul>
|
| 46 |
+
</nav>
|
| 47 |
+
</div>
|
| 48 |
+
|
| 49 |
+
<!-- Main Content -->
|
| 50 |
+
<div class="ml-64 p-6 min-h-screen">
|
| 51 |
+
<!-- Header -->
|
| 52 |
+
<header class="bg-white shadow-sm p-4 rounded-lg mb-6 flex justify-between items-center">
|
| 53 |
+
<h1 id="page-title" class="text-2xl font-semibold">Главная панель</h1>
|
| 54 |
+
<div class="flex space-x-4">
|
| 55 |
+
<button class="p-2 rounded-full hover:bg-gray-100 relative">
|
| 56 |
+
<i class="fas fa-bell text-gray-600"></i>
|
| 57 |
+
<span class="notification-badge bg-red-500 text-white">3</span>
|
| 58 |
+
</button>
|
| 59 |
+
<div class="relative">
|
| 60 |
+
<input type="text" placeholder="Поиск..." class="pl-10 pr-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
|
| 61 |
+
<i class="fas fa-search absolute left-3 top-3 text-gray-400"></i>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
</header>
|
| 65 |
+
|
| 66 |
+
<!-- Tabs -->
|
| 67 |
+
<div id="content" class="bg-white rounded-lg shadow p-6">
|
| 68 |
+
<!-- Default Tab - Dashboard -->
|
| 69 |
+
<div id="dashboard" class="tab-content active">
|
| 70 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
|
| 71 |
+
<div class="bg-white rounded-lg shadow p-6 border-l-4 border-blue-500">
|
| 72 |
+
<h4 class="font-medium text-gray-500">Всего оборудования</h4>
|
| 73 |
+
<p id="total-equipment" class="text-2xl font-bold">0</p>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="bg-white rounded-lg shadow p-6 border-l-4 border-green-500">
|
| 76 |
+
<h4 class="font-medium text-gray-500">Выполнено ТО</h4>
|
| 77 |
+
<p id="completed-maintenance" class="text-2xl font-bold">0</p>
|
| 78 |
+
</div>
|
| 79 |
+
<div class="bg-white rounded-lg shadow p-6 border-l-4 border-yellow-500">
|
| 80 |
+
<h4 class="font-medium text-gray-500">Просрочено ТО</h4>
|
| 81 |
+
<p id="overdue-maintenance" class="text-2xl font-bold">0</p>
|
| 82 |
+
</div>
|
| 83 |
+
<div class="bg-white rounded-lg shadow p-6 border-l-4 border-red-500">
|
| 84 |
+
<h4 class="font-medium text-gray-500">Текущие ремонты</h4>
|
| 85 |
+
<p id="current-repairs" class="text-2xl font-bold">0</p>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 90 |
+
<div class="p-4 border-b flex justify-between items-center">
|
| 91 |
+
<h2 class="text-lg font-semibold">Оборудование</h2>
|
| 92 |
+
<button onclick="showTab('equipment')" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg">
|
| 93 |
+
Перейти к оборудованию
|
| 94 |
+
</button>
|
| 95 |
+
</div>
|
| 96 |
+
<div class="overflow-x-auto">
|
| 97 |
+
<table id="dashboard-table" class="min-w-full divide-y divide-gray-200">
|
| 98 |
+
<thead class="bg-gray-50">
|
| 99 |
+
<tr>
|
| 100 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">ID</th>
|
| 101 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Название</th>
|
| 102 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Статус</th>
|
| 103 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Последнее ТО</th>
|
| 104 |
+
</tr>
|
| 105 |
+
</thead>
|
| 106 |
+
<tbody id="dashboard-body" class="bg-white divide-y divide-gray-200"></tbody>
|
| 107 |
+
</table>
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<!-- Equipment Tab -->
|
| 113 |
+
<div id="equipment" class="tab-content hidden">
|
| 114 |
+
<div class="mb-4 flex justify-between items-center">
|
| 115 |
+
<h2 class="text-2xl font-bold">Оборудование</h2>
|
| 116 |
+
<button onclick="openAddModal()" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg flex items-center">
|
| 117 |
+
<i class="fas fa-plus mr-2"></i> Добавить оборудование
|
| 118 |
+
</button>
|
| 119 |
+
</div>
|
| 120 |
+
|
| 121 |
+
<div class="bg-white rounded-lg shadow overflow-hidden">
|
| 122 |
+
<div class="overflow-x-auto">
|
| 123 |
+
<table class="min-w-full divide-y divide-gray-200">
|
| 124 |
+
<thead class="bg-gray-50">
|
| 125 |
+
<tr>
|
| 126 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">ID</th>
|
| 127 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Название</th>
|
| 128 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Тип</th>
|
| 129 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Статус</th>
|
| 130 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Инвентарный номер</th>
|
| 131 |
+
<th class="px-6 py-3 text-left text-xs uppercase tracking-wider">Действия</th>
|
| 132 |
+
</tr>
|
| 133 |
+
</thead>
|
| 134 |
+
<tbody id="equipment-list" class="bg-white divide-y divide-gray-200"></tbody>
|
| 135 |
+
</table>
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
</div>
|
| 139 |
+
|
| 140 |
+
<!-- Schedule Tab -->
|
| 141 |
+
<div id="schedule" class="tab-content hidden">
|
| 142 |
+
<h2 class="text-2xl font-bold mb-6">График ТО</h2>
|
| 143 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 144 |
+
<h3 class="text-lg font-semibold mb-4">Календарь ТО</h3>
|
| 145 |
+
<div class="grid grid-cols-7 gap-1 mb-2">
|
| 146 |
+
<div class="text-center text-sm font-medium text-gray-500">Пн</div>
|
| 147 |
+
<div class="text-center text-sm font-medium text-gray-500">Вт</div>
|
| 148 |
+
<div class="text-center text-sm font-medium text-gray-500">Ср</div>
|
| 149 |
+
<div class="text-center text-sm font-medium text-gray-500">Чт</div>
|
| 150 |
+
<div class="text-center text-sm font-medium text-gray-500">Пт</div>
|
| 151 |
+
<div class="text-center text-sm font-medium text-gray-500">Сб</div>
|
| 152 |
+
<div class="text-center text-sm font-medium text-gray-500">Вс</div>
|
| 153 |
+
</div>
|
| 154 |
+
<div id="calendar" class="grid grid-cols-7 gap-1 h-64 overflow-y-auto">
|
| 155 |
+
<!-- Calendar days will be generated by JavaScript -->
|
| 156 |
+
</div>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<!-- Repairs Tab -->
|
| 161 |
+
<div id="repairs" class="tab-content hidden">
|
| 162 |
+
<h2 class="text-2xl font-bold mb-6">Ремонтные работы</h2>
|
| 163 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 164 |
+
<p>Здесь будет информация о ремонтных работах.</p>
|
| 165 |
+
</div>
|
| 166 |
+
</div>
|
| 167 |
+
|
| 168 |
+
<!-- Maintenance Tab -->
|
| 169 |
+
<div id="maintenance" class="tab-content hidden">
|
| 170 |
+
<h2 class="text-2xl font-bold mb-6">Техническое обслуживание</h2>
|
| 171 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 172 |
+
<p>Здесь будет информация о техническом обслуживании.</p>
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
|
| 176 |
+
<!-- Reports Tab -->
|
| 177 |
+
<div id="reports" class="tab-content hidden">
|
| 178 |
+
<h2 class="text-2xl font-bold mb-6">Отчеты</h2>
|
| 179 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 180 |
+
<p>Здесь будут отчеты по работе системы.</p>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
|
| 184 |
+
<!-- Users Tab -->
|
| 185 |
+
<div id="users" class="tab-content hidden">
|
| 186 |
+
<h2 class="text-2xl font-bold mb-6">Пользователи</h2>
|
| 187 |
+
<div class="bg-white rounded-lg shadow p-6">
|
| 188 |
+
<p>Здесь будет спи��ок пользователей.</p>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
</div>
|
| 192 |
+
</div>
|
| 193 |
+
|
| 194 |
+
<!-- Add Equipment Modal -->
|
| 195 |
+
<div id="addEquipmentModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50">
|
| 196 |
+
<div class="bg-white rounded-lg shadow-lg w-full max-w-md p-6">
|
| 197 |
+
<div class="flex justify-between items-center mb-4">
|
| 198 |
+
<h3 class="text-lg font-semibold">Добавить оборудование</h3>
|
| 199 |
+
<button onclick="closeAddModal()" class="text-gray-500">×</button>
|
| 200 |
+
</div>
|
| 201 |
+
<form id="equipmentForm" class="space-y-4">
|
| 202 |
+
<input type="text" name="name" placeholder="Название" required class="w-full border rounded px-4 py-2">
|
| 203 |
+
<select name="type" required class="w-full border rounded px-4 py-2">
|
| 204 |
+
<option value="">Выберите тип</option>
|
| 205 |
+
<option>Станок</option>
|
| 206 |
+
<option>Конвейер</option>
|
| 207 |
+
<option>Компрессор</option>
|
| 208 |
+
<option>Генератор</option>
|
| 209 |
+
<option>Насос</option>
|
| 210 |
+
</select>
|
| 211 |
+
<input type="text" name="serial" placeholder="Серийный номер" required class="w-full border rounded px-4 py-2">
|
| 212 |
+
<input type="text" name="inventory" placeholder="Инвентарный номер" required class="w-full border rounded px-4 py-2">
|
| 213 |
+
<input type="date" name="commissionDate" required class="w-full border rounded px-4 py-2">
|
| 214 |
+
<input type="number" name="interval" placeholder="Интервал ТО (дни)" required class="w-full border rounded px-4 py-2">
|
| 215 |
+
<textarea name="description" rows="3" placeholder="Описание" class="w-full border rounded px-4 py-2"></textarea>
|
| 216 |
+
</form>
|
| 217 |
+
<div class="mt-4 flex justify-end space-x-2">
|
| 218 |
+
<button onclick="closeAddModal()" class="border px-4 py-2 rounded hover:bg-gray-100">Отмена</button>
|
| 219 |
+
<button onclick="saveEquipment()" class="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700">Сохранить</button>
|
| 220 |
+
</div>
|
| 221 |
+
</div>
|
| 222 |
+
</div>
|
| 223 |
+
|
| 224 |
+
<script>
|
| 225 |
+
// Mock data
|
| 226 |
+
let equipmentData = [
|
| 227 |
+
{id: 1, name: "Токарный станок", type: "Станок", serial: "SN-001", inventory: "INV-001", status: "active", lastMaintenance: "2023-05-15"},
|
| 228 |
+
{id: 2, name: "Конвейер А-12", type: "Конвейер", serial: "SN-002", inventory: "INV-002", status: "maintenance", lastMaintenance: "2023-04-10"}
|
| 229 |
+
];
|
| 230 |
+
|
| 231 |
+
const maintenanceEvents = [
|
| 232 |
+
{ equipmentId: 1, date: "2023-06-15", status: "planned" },
|
| 233 |
+
{ equipmentId: 2, date: "2023-06-10", status: "overdue" }
|
| 234 |
+
];
|
| 235 |
+
|
| 236 |
+
const calendar = document.getElementById("calendar");
|
| 237 |
+
|
| 238 |
+
function formatDate(dateStr) {
|
| 239 |
+
if (!dateStr) return "";
|
| 240 |
+
const d = new Date(dateStr);
|
| 241 |
+
return `${d.getDate()}.${d.getMonth()+1}.${d.getFullYear()}`;
|
| 242 |
+
}
|
| 243 |
+
|
| 244 |
+
function toggleSidebar() {
|
| 245 |
+
const sidebar = document.getElementById("sidebar");
|
| 246 |
+
const isCollapsed = sidebar.classList.contains("collapsed");
|
| 247 |
+
sidebar.classList.toggle("collapsed", !isCollapsed);
|
| 248 |
+
document.querySelector(".ml-64").classList.toggle("ml-16", !isCollapsed);
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
function showTab(tabId) {
|
| 252 |
+
document.querySelectorAll('.tab-content').forEach(el => el.classList.add('hidden'));
|
| 253 |
+
document.getElementById(tabId).classList.remove('hidden');
|
| 254 |
+
document.getElementById('page-title').innerText = tabId.charAt(0).toUpperCase() + tabId.slice(1);
|
| 255 |
+
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('bg-blue-700'));
|
| 256 |
+
event.target.classList.add('bg-blue-700');
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
function openAddModal() {
|
| 260 |
+
document.getElementById("addEquipmentModal").classList.remove("hidden");
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
function closeAddModal() {
|
| 264 |
+
document.getElementById("addEquipmentModal").classList.add("hidden");
|
| 265 |
+
document.getElementById("equipmentForm").reset();
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
function saveEquipment() {
|
| 269 |
+
const form = document.getElementById("equipmentForm");
|
| 270 |
+
const formData = new FormData(form);
|
| 271 |
+
const newEq = {
|
| 272 |
+
id: equipmentData.length ? Math.max(...equipmentData.map(e => e.id)) + 1 : 1,
|
| 273 |
+
name: formData.get("name"),
|
| 274 |
+
type: formData.get("type"),
|
| 275 |
+
serial: formData.get("serial"),
|
| 276 |
+
inventory: formData.get("inventory"),
|
| 277 |
+
commissionDate: formData.get("commissionDate"),
|
| 278 |
+
interval: formData.get("interval"),
|
| 279 |
+
description: formData.get("description"),
|
| 280 |
+
status: "active",
|
| 281 |
+
lastMaintenance: "",
|
| 282 |
+
};
|
| 283 |
+
equipmentData.push(newEq);
|
| 284 |
+
closeAddModal();
|
| 285 |
+
renderEquipment();
|
| 286 |
+
updateDashboardStats();
|
| 287 |
+
}
|
| 288 |
+
|
| 289 |
+
function deleteEquipment(id) {
|
| 290 |
+
equipmentData = equipmentData.filter(eq => eq.id !== id);
|
| 291 |
+
renderEquipment();
|
| 292 |
+
updateDashboardStats();
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
function renderEquipment() {
|
| 296 |
+
const tbody = document.getElementById("equipment-list");
|
| 297 |
+
const dashboardTbody = document.getElementById("dashboard-body");
|
| 298 |
+
tbody.innerHTML = '';
|
| 299 |
+
dashboardTbody.innerHTML = '';
|
| 300 |
+
|
| 301 |
+
equipmentData.forEach(eq => {
|
| 302 |
+
const row = document.createElement("tr");
|
| 303 |
+
row.innerHTML = `
|
| 304 |
+
<td class="px-6 py-4">${eq.id}</td>
|
| 305 |
+
<td class="px-6 py-4">${eq.name}</td>
|
| 306 |
+
<td class="px-6 py-4">${eq.type}</td>
|
| 307 |
+
<td class="px-6 py-4">
|
| 308 |
+
<span class="px-2 py-1 rounded-full text-xs font-semibold ${eq.status === 'active' ? 'bg-green-100 text-green-800' : eq.status === 'maintenance' ? 'bg-yellow-100 text-yellow-800' : 'bg-red-100 text-red-800'}">
|
| 309 |
+
${eq.status === 'active' ? 'Активно' : eq.status === 'maintenance' ? 'ТО' : 'Ремонт'}
|
| 310 |
+
</span>
|
| 311 |
+
</td>
|
| 312 |
+
<td class="px-6 py-4">${eq.inventory || '-'}</td>
|
| 313 |
+
<td class="px-6 py-4">
|
| 314 |
+
<button onclick="deleteEquipment(${eq.id})" class="text-red-600 hover:text-red-800">
|
| 315 |
+
<i class="fas fa-trash"></i>
|
| 316 |
+
</button>
|
| 317 |
+
</td>
|
| 318 |
+
`;
|
| 319 |
+
tbody.appendChild(row);
|
| 320 |
+
|
| 321 |
+
const dashRow = document.createElement("tr");
|
| 322 |
+
dashRow.innerHTML = `
|
| 323 |
+
<td class="px-6 py-4">${eq.id}</td>
|
| 324 |
+
<td class="px-6 py-4">${eq.name}</td>
|
| 325 |
+
<td class="px-6 py-4">
|
| 326 |
+
<span class="px-2 py-1 rounded-full text-xs font-semibold ${eq.status === 'active' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'}">
|
| 327 |
+
${eq.status === 'active' ? 'Активно' : 'ТО'}
|
| 328 |
+
</span>
|
| 329 |
+
</td>
|
| 330 |
+
<td class="px-6 py-4">${formatDate(eq.lastMaintenance)}</td>
|
| 331 |
+
`;
|
| 332 |
+
dashboardTbody.appendChild(dashRow);
|
| 333 |
+
});
|
| 334 |
+
}
|
| 335 |
+
|
| 336 |
+
function updateDashboardStats() {
|
| 337 |
+
document.getElementById("total-equipment").textContent = equipmentData.length;
|
| 338 |
+
document.getElementById("completed-maintenance").textContent = equipmentData.filter(e => e.lastMaintenance).length;
|
| 339 |
+
document.getElementById("overdue-maintenance").textContent = equipmentData.filter(e => new Date(e.nextMaintenance) < new Date()).length;
|
| 340 |
+
document.getElementById("current-repairs").textContent = equipmentData.filter(e => e.status === "repair").length;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
function generateCalendar() {
|
| 344 |
+
const today = new Date();
|
| 345 |
+
const year = today.getFullYear();
|
| 346 |
+
const month = today.getMonth();
|
| 347 |
+
const firstDay = new Date(year, month, 1).getDay();
|
| 348 |
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
| 349 |
+
|
| 350 |
+
for (let i = 0; i < 42; i++) {
|
| 351 |
+
const day = i - firstDay + 1;
|
| 352 |
+
const cell = document.createElement("div");
|
| 353 |
+
if (day > 0 && day <= daysInMonth) {
|
| 354 |
+
cell.textContent = day;
|
| 355 |
+
cell.className = "h-10 flex items-center justify-center border rounded cursor-pointer";
|
| 356 |
+
if (maintenanceEvents.some(ev => ev.date === `${year}-${String(month+1).padStart(2,'0')}-${String(day).padStart(2,'0')}`)) {
|
| 357 |
+
cell.style.backgroundColor = "#BFDBFE";
|
| 358 |
+
}
|
| 359 |
+
} else {
|
| 360 |
+
cell.textContent = "";
|
| 361 |
+
}
|
| 362 |
+
calendar.appendChild(cell);
|
| 363 |
+
}
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
function initApp() {
|
| 367 |
+
renderEquipment();
|
| 368 |
+
updateDashboardStats();
|
| 369 |
+
generateCalendar();
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
window.onload = initApp;
|
| 373 |
+
</script>
|
| 374 |
+
|
| 375 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Karmashek/ver2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 376 |
</html>
|
prompts.txt
ADDED
|
File without changes
|