Compare commits

2 Commits

Author SHA1 Message Date
astankovmi f6269e457e OK
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 9s
2026-06-09 02:36:34 +03:00
astankovmi 71ae1df57a OK 2026-06-09 02:35:39 +03:00
122 changed files with 592 additions and 81107 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
+22 -85
View File
@@ -6,91 +6,28 @@ namespace DahuaIPCRename
{
public static Dictionary<string, string> listIPC = new Dictionary<string, string>
{
{"172.22.10.135","Этаж 2|Пом. 264"},
{"172.22.10.136","Этаж 2|Эвак.выход лев"},
{"172.22.10.137","Этаж 2|Ресепшн"},
{"172.22.10.138","Этаж 2|Пом. 269-1"},
{"172.22.10.139","Этаж 2|Пом. 268-2"},
{"172.22.10.140","Этаж 2|Пом. 271"},
{"172.22.10.141","Этаж 2|Пом. 269-3"},
{"172.22.10.142","Этаж 2|Пом. 272"},
{"172.22.10.143","Этаж 2|Пом. 228-1"},
{"172.22.10.144","Этаж 2|Пом. 269-2"},
{"172.22.10.145","Этаж 2|Пом. 228-2"},
{"172.22.10.146","Этаж 2|Пом. 255"},
{"172.22.10.147","Этаж 2|Пом. 229-3"},
{"172.22.10.148","Этаж 2|Эвак.выход прав"},
{"172.22.10.149","Этаж 2|Пом. 229-2"},
{"172.22.10.150","Этаж 2|Пом. 254"},
{"172.22.10.151","Этаж 2|Пом. 229-1"},
{"172.22.10.152","Этаж 2|Пом. 248-7"},
{"172.22.10.93","Этаж 3|Пом.319-столовая"},
{"172.22.10.94","Этаж 3|Пом.313-1"},
{"172.22.10.95","Этаж 3|Пом.321-1"},
{"172.22.10.96","Этаж 3|Коридор от лифт. холла"},
{"172.22.10.97","Этаж 3|Пом.321-2"},
{"172.22.10.98","Этаж 3|Коридор к лифт. холлу"},
{"172.22.10.99","Этаж 3|Пом.313-2"},
{"172.22.10.100","Этаж 3|Пом.323-2"},
{"172.22.10.101","Этаж 3|Пом.323-1"},
{"172.22.10.102","Этаж 3|Эвак. Выход"},
{"172.22.10.103","Этаж 3|Кроссовая"},
{"172.22.10.104","Этаж 3|Пом.304-1"},
{"172.22.10.105","Этаж 3|Пом.304-2"},
{"172.22.10.106","Этаж 3|Пом.312"},
{"172.22.10.107","Этаж 2|Пом.237"},
{"172.22.10.108","Этаж 5|Пом.519-2"},
{"172.22.10.109","Этаж 2|Пом.244-1"},
{"172.22.10.110","Этаж 2|Пом.244-2"},
{"172.22.10.111","Этаж 2|Пом.245(окно)"},
{"172.22.10.112","Этаж 2|Пом.245-2"},
{"172.22.10.113","Этаж 2|Пом.245-1"},
{"172.22.10.114","Этаж 1|Склад-2"},
{"172.22.10.115","Этаж 5|Пом.544"},
{"172.22.10.116","Этаж 1|Пом.ЦОД-1"},
{"172.22.10.117","Этаж 2|Пом.239-1"},
{"172.22.10.118","Этаж 1|Пом.ЦОД-2"},
{"172.22.10.119","Этаж 1|Пом.ИБП"},
{"172.22.10.120","Этаж 1|Склад-1"},
{"172.22.10.121","Этаж 2|Пом.239-2"},
{"172.22.10.122","Этаж 2|Пом. 247"},
{"172.22.10.123","Этаж 2|Пом. 248-4"},
{"172.22.10.124","Этаж 2|Пом. 248-5"},
{"172.22.10.125","Этаж 2|Пом. 248-2"},
{"172.22.10.126","Этаж 2|Пом. 248-6"},
{"172.22.10.127","Этаж 2|Пом. 248-3"},
{"172.22.10.128","Этаж 2|Пом. 237-1"},
{"172.22.10.129","Этаж 2|Пом. 268-1"},
{"172.22.10.130","Этаж 2|Пом. 237-2"},
{"172.22.10.131","Улица-2"},
{"172.22.10.132","Улица-3"},
{"172.22.10.133","Улица-1"},
{"172.22.10.134","Улица-4-PTZ"},
{"172.22.10.51","Этаж 5|Пом.545-2"},
{"172.22.10.52","Этаж 5|Пом.519-1"},
{"172.22.10.53","Этаж 5|Пом.511-1"},
{"172.22.10.54","Этаж 5|Пом.517-2"},
{"172.22.10.55","Этаж 5|Эвак. Выход-3"},
{"172.22.10.56","Этаж 5|Пом.545-коридор"},
{"172.22.10.57","Этаж 5|Ресепшн-1"},
{"172.22.10.58","Этаж 5|Пом.545-3"},
{"172.22.10.59","Этаж 5|Пом.521-3"},
{"172.22.10.60","Этаж 5|Пом.535 к лифтам"},
{"172.22.10.61","Этаж 5|Пом.515-2"},
{"172.22.10.62","Этаж 5|Пом.511-2"},
{"172.22.10.63","Этаж 5|Пом.517-1"},
{"172.22.10.64","Этаж 5|Пом.521-1"},
{"172.22.10.65","Этаж 5|Пом.535-коридор"},
{"172.22.10.66","Этаж 5|Пом.526-столовая"},
{"172.22.10.67","Этаж 5|Пом.545-4"},
{"172.22.10.68","Этаж 5|Пом.532-2"},
{"172.22.10.69","Этаж 5|Пом.515-1"},
{"172.22.10.70","Этаж 5|Пом.535-1"},
{"172.22.10.71","Этаж 5|Эвак. Выход-2"},
{"172.22.10.72","Этаж 5|Пом.545-1"},
{"172.22.10.73","Этаж 5|Ресепшн-2"},
{"172.22.10.74","Этаж 5|Пом.521-2"},
{"172.22.10.75","Этаж 2|ВРУ"}
{"172.16.54.18","Ворота 35"},
{"172.16.54.20","Ворота 36"},
{"172.16.54.21","Ворота 31"},
{"172.16.54.22","Ворота 32"},
{"172.16.54.23","Ворота 33"},
{"172.16.54.24","Ворота 34"},
{"172.16.54.28","Ворота 16"},
{"172.16.54.29","Ворота 26"},
{"172.16.54.30","Ворота 20"},
{"172.16.54.31","Ворота 22"},
{"172.16.54.32","Ворота 18"},
{"172.16.54.33","Ворота 21"},
{"172.16.54.34","Ворота 24"},
{"172.16.54.35","Ворота 27"},
{"172.16.54.36","Ворота 29"},
{"172.16.54.37","Ворота 25"},
{"172.16.54.38","Ворота 23"},
{"172.16.54.39","Ворота 15"},
{"172.16.54.40","Ворота 17"},
{"172.16.54.41","Ворота 37"},
{"172.16.54.42","Ворота 19"},
{"172.16.54.43","Ворота 28"}
};
static async Task Main(string[] args)
@@ -1,23 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Emgu.CV" Version="4.13.0.5924" />
<PackageReference Include="Emgu.CV.runtime.windows" Version="4.13.0.5924" />
<PackageReference Include="Microsoft.AspNetCore.SignalR" Version="1.2.11" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="10.0.9" />
<PackageReference Include="System.Drawing.Common" Version="10.0.9" />
</ItemGroup>
<ItemGroup>
<None Update="haarcascade_frontalface_default.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
-7
View File
@@ -1,7 +0,0 @@
using Microsoft.AspNetCore.SignalR;
namespace FaceRecognitionApp.Hubs;
public class FaceHub : Hub
{
}
-18
View File
@@ -1,18 +0,0 @@
namespace FaceRecognitionApp.Models;
public class Employee
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string? Department { get; set; }
public byte[] FaceDescriptor { get; set; } = Array.Empty<byte>();
public byte[]? Photo { get; set; }
}
public class DetectedFace
{
public byte[] ImageData { get; set; } = Array.Empty<byte>();
public bool IsRecognized { get; set; }
public Employee? MatchedEmployee { get; set; }
public double Confidence { get; set; }
}
-58
View File
@@ -1,58 +0,0 @@
using FaceRecognitionApp.Hubs;
using FaceRecognitionApp.Services;
using Microsoft.AspNetCore.SignalR;
var builder = WebApplication.CreateBuilder(args);
// Регистрация сервисов
builder.Services.AddSingleton<DatabaseService>();
builder.Services.AddSingleton<FaceRecognitionService>();
builder.Services.AddSignalR();
var app = builder.Build();
// 1. Включаем поиск файлов по умолчанию (index.html, default.html и т.д.)
app.UseDefaultFiles();
// 2. Включаем раздачу статических файлов (css, js, картинки)
app.UseStaticFiles();
// 3. Подключаем SignalR хаб
app.MapHub<FaceHub>("/faceHub");
// Инициализация камеры и распознавания
var db = app.Services.GetRequiredService<DatabaseService>();
var faceService = app.Services.GetRequiredService<FaceRecognitionService>();
// URL камеры (замените на свой или используйте тестовый видеофайл)
var cameraUrl = Environment.GetEnvironmentVariable("CAMERA_URL") ?? "rtsp://admin:4NUDZhJ7@172.22.10.101:554/cam/realmonitor?channel=1&subtype=1";
try
{
Console.WriteLine($"Connecting to camera: {cameraUrl}...");
var camera = new CameraService(cameraUrl, faceService, async (face) => {
var hub = app.Services.GetRequiredService<IHubContext<FaceHub>>();
await hub.Clients.All.SendAsync("NewFace", new
{
image = Convert.ToBase64String(face.ImageData),
isRecognized = face.IsRecognized,
name = face.MatchedEmployee?.Name ?? "Unknown"
});
});
camera.Start();
Console.WriteLine("✅ Camera service started.");
// Корректное завершение работы камеры при остановке приложения
app.Lifetime.ApplicationStopping.Register(() => {
Console.WriteLine("Shutting down camera...");
camera.Dispose();
});
}
catch (Exception ex)
{
Console.WriteLine($"⚠️ Camera Error: {ex.Message}");
Console.WriteLine("Application will run without camera monitoring.");
}
Console.WriteLine("🚀 Application is ready. Open http://localhost:5290 in your browser.");
app.Run();
@@ -1,29 +0,0 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:43065",
"sslPort": 0
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:5290",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
@@ -1,144 +0,0 @@
using Emgu.CV;
using FaceRecognitionApp.Models;
namespace FaceRecognitionApp.Services;
public class CameraService : IDisposable
{
private VideoCapture? _capture;
private readonly FaceRecognitionService _recognition;
private readonly Action<DetectedFace> _onDetected;
private CancellationTokenSource? _cts;
private Task? _task;
private DateTime _lastTime = DateTime.MinValue;
private bool _isDisposed = false;
public CameraService(string url, FaceRecognitionService recognition, Action<DetectedFace> onDetected)
{
_recognition = recognition;
_onDetected = onDetected;
Console.WriteLine($"Initializing camera with URL: {url}");
_capture = new VideoCapture(url);
// Даем камере время на инициализацию потока
Thread.Sleep(1000);
if (!_capture.IsOpened)
throw new Exception("Camera failed to open. Check URL and network connection.");
Console.WriteLine("Camera hardware initialized.");
}
public void Start()
{
if (_isDisposed) return;
_cts = new CancellationTokenSource();
_task = Task.Run(() => Loop(_cts.Token));
Console.WriteLine("Camera processing loop started.");
}
private async Task Loop(CancellationToken token)
{
Console.WriteLine("🎥 Frame processing loop active...");
while (!token.IsCancellationRequested)
{
try
{
using var frame = new Mat();
// Читаем кадр с таймаутом
if (_capture!.Read(frame))
{
if (!frame.IsEmpty && frame.Width > 0 && frame.Height > 0)
{
var face = _recognition.ProcessFrame(frame);
if (face != null)
{
// Лимит частоты отправок (не чаще раза в 2 секунды)
if ((DateTime.Now - _lastTime).TotalMilliseconds > 2000)
{
_lastTime = DateTime.Now;
_onDetected(face);
string status = face.IsRecognized
? $"✅ Recognized: {face.MatchedEmployee?.Name}"
: "❌ Unknown face";
Console.WriteLine($"{DateTime.Now:HH:mm:ss} - {status}");
}
}
}
}
else
{
// Если Read вернул false, возможно потеря связи
Console.WriteLine("⚠️ Failed to read frame, retrying...");
await Task.Delay(500, token);
}
// Небольшая задержка, чтобы не грузить процессор на 100%
await Task.Delay(50, token);
}
catch (OperationCanceledException)
{
// Это нормальная ситуация при остановке
break;
}
catch (Exception ex)
{
Console.WriteLine($"⚠️ Error in camera loop: {ex.Message}");
await Task.Delay(1000, token);
}
}
Console.WriteLine("🛑 Camera loop finished.");
}
public void Stop()
{
if (_cts == null) return;
Console.WriteLine("Stopping camera service...");
_cts.Cancel();
try
{
// Ждем завершения задачи, но не бесконечно
if (_task != null)
{
_task.Wait(TimeSpan.FromSeconds(5));
}
}
catch (AggregateException ex)
{
// Игнорируем ошибки отмены задачи
foreach (var inner in ex.InnerExceptions)
{
if (!(inner is TaskCanceledException || inner is OperationCanceledException))
{
Console.WriteLine($"Unexpected error during stop: {inner.Message}");
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Error stopping task: {ex.Message}");
}
}
public void Dispose()
{
if (_isDisposed) return;
Stop();
_capture?.Dispose();
_cts?.Dispose();
_isDisposed = true;
Console.WriteLine("Camera resources released.");
}
}
@@ -1,65 +0,0 @@
using Microsoft.Data.Sqlite;
using FaceRecognitionApp.Models;
namespace FaceRecognitionApp.Services;
public class DatabaseService
{
private readonly string _connectionString = "Data Source=faces.db";
public DatabaseService()
{
InitializeDatabase();
}
private void InitializeDatabase()
{
using var connection = new SqliteConnection(_connectionString);
connection.Open();
var cmd = connection.CreateCommand();
cmd.CommandText = @"
CREATE TABLE IF NOT EXISTS Employees (
Id INTEGER PRIMARY KEY AUTOINCREMENT,
Name TEXT NOT NULL,
Department TEXT,
FaceDescriptor BLOB,
Photo BLOB
)";
cmd.ExecuteNonQuery();
}
public void AddEmployee(string name, string? dept, byte[] descriptor, byte[] photo)
{
using var connection = new SqliteConnection(_connectionString);
connection.Open();
var cmd = connection.CreateCommand();
cmd.CommandText = "INSERT INTO Employees (Name, Department, FaceDescriptor, Photo) VALUES (@n, @d, @desc, @p)";
cmd.Parameters.AddWithValue("@n", name);
cmd.Parameters.AddWithValue("@d", (object?)dept ?? DBNull.Value);
cmd.Parameters.AddWithValue("@desc", descriptor);
cmd.Parameters.AddWithValue("@p", photo);
cmd.ExecuteNonQuery();
}
public List<Employee> GetAllEmployees()
{
var list = new List<Employee>();
using var connection = new SqliteConnection(_connectionString);
connection.Open();
var cmd = connection.CreateCommand();
cmd.CommandText = "SELECT * FROM Employees";
using var reader = cmd.ExecuteReader();
while (reader.Read())
{
list.Add(new Employee
{
Id = reader.GetInt32(0),
Name = reader.GetString(1),
Department = reader.IsDBNull(2) ? null : reader.GetString(2),
FaceDescriptor = (byte[])reader[3],
Photo = reader.IsDBNull(4) ? null : (byte[])reader[4]
});
}
return list;
}
}
@@ -1,234 +0,0 @@
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Face;
using Emgu.CV.Structure;
using Emgu.CV.Util;
using FaceRecognitionApp.Models;
using System.Drawing;
using System.Runtime.InteropServices;
namespace FaceRecognitionApp.Services;
public class FaceRecognitionService : IDisposable
{
private readonly LBPHFaceRecognizer _recognizer;
private readonly CascadeClassifier _cascade;
private readonly DatabaseService _db;
private List<Employee> _employees = new();
private bool _isTrained = false;
// Коэффициент уменьшения кадра для ускорения поиска
private const double ResizeScale = 0.5;
private const int OriginalMinSize = 30;
private readonly Size _scaledMinSize;
public FaceRecognitionService(DatabaseService db)
{
_db = db;
var cascadePath = Path.Combine(AppContext.BaseDirectory, "haarcascade_frontalface_default.xml");
if (!File.Exists(cascadePath))
throw new FileNotFoundException($"Cascade file missing at: {cascadePath}");
_cascade = new CascadeClassifier(cascadePath);
_recognizer = new LBPHFaceRecognizer(1, 8, 8, 8, 80.0);
// Вычисляем минимальный размер лица для уменьшенного кадра
int scaledMin = (int)(OriginalMinSize * ResizeScale);
_scaledMinSize = new Size(Math.Max(scaledMin, 10), Math.Max(scaledMin, 10));
TrainModel();
}
private void TrainModel()
{
_employees = _db.GetAllEmployees();
if (!_employees.Any()) return;
using var images = new VectorOfMat();
using var labels = new VectorOfInt();
foreach (var emp in _employees)
{
if (emp.Photo == null || emp.Photo.Length == 0) continue;
try
{
using var ms = new MemoryStream(emp.Photo);
using var bmp = new Bitmap(ms);
using var mat = BitmapToMat(bmp);
using var gray = new Mat();
CvInvoke.CvtColor(mat, gray, ColorConversion.Bgr2Gray);
// Ищем лицо на фото сотрудника для обрезки
var rects = _cascade.DetectMultiScale(gray, 1.1, 5, new Size(30, 30));
if (rects.Length > 0)
{
using var faceMat = new Mat(gray, rects[0]);
using var resized = new Mat();
CvInvoke.Resize(faceMat, resized, new Size(100, 100));
images.Push(resized);
labels.Push(new int[] { emp.Id });
}
}
catch (Exception ex)
{
Console.WriteLine($"Training error for {emp.Name}: {ex.Message}");
}
}
if (images.Size > 0)
{
_recognizer.Train(images, labels);
_isTrained = true;
Console.WriteLine($"✅ Trained on {images.Size} faces.");
}
else
{
Console.WriteLine("⚠️ No valid faces found for training.");
}
}
public DetectedFace? ProcessFrame(Mat frame)
{
if (frame == null || frame.IsEmpty) return null;
// === УСКОРЕНИЕ: Уменьшаем кадр для поиска лиц ===
using var smallFrame = new Mat();
CvInvoke.Resize(frame, smallFrame, new Size(), ResizeScale, ResizeScale, Inter.Linear);
using var gray = new Mat();
CvInvoke.CvtColor(smallFrame, gray, ColorConversion.Bgr2Gray);
// Ищем лица на уменьшенном кадре
var rects = _cascade.DetectMultiScale(gray, 1.1, 5, _scaledMinSize);
if (rects.Length == 0)
return null;
var smallRect = rects[0];
// === ВОССТАНОВЛЕНИЕ координат к оригинальному размеру ===
int invScale = (int)(1.0 / ResizeScale);
var originalRect = new Rectangle(
smallRect.X * invScale,
smallRect.Y * invScale,
smallRect.Width * invScale,
smallRect.Height * invScale
);
// Проверка границ по оригинальному кадру
if (originalRect.X < 0 || originalRect.Y < 0 ||
originalRect.Right > frame.Width || originalRect.Bottom > frame.Height)
return null;
// Вырезаем лицо из ОРИГИНАЛЬНОГО кадра (лучшее качество для распознавания)
using var faceMat = new Mat(frame, originalRect);
using var faceGray = new Mat();
CvInvoke.CvtColor(faceMat, faceGray, ColorConversion.Bgr2Gray);
using var resized = new Mat();
CvInvoke.Resize(faceGray, resized, new Size(100, 100));
var result = new DetectedFace();
if (_isTrained)
{
try
{
var prediction = _recognizer.Predict(resized);
int label = prediction.Label;
double confidence = prediction.Distance;
if (label != -1 && confidence < 80)
{
result.IsRecognized = true;
result.MatchedEmployee = _employees.FirstOrDefault(e => e.Id == label);
result.Confidence = confidence;
}
}
catch (Exception ex)
{
Console.WriteLine($"Prediction error: {ex.Message}");
}
}
// Конвертация в JPEG для веб-интерфейса
using var ms = new MemoryStream();
using var bmp = MatToBitmap(resized);
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
result.ImageData = ms.ToArray();
return result;
}
/// <summary>
/// Безопасная конвертация Bitmap → Mat через промежуточный буфер
/// </summary>
private static Mat BitmapToMat(Bitmap bitmap)
{
var mat = new Mat(bitmap.Height, bitmap.Width, DepthType.Cv8U, 3);
var data = bitmap.LockBits(
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
System.Drawing.Imaging.ImageLockMode.ReadOnly,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
try
{
int length = Math.Abs(data.Stride) * bitmap.Height;
byte[] buffer = new byte[length];
Marshal.Copy(data.Scan0, buffer, 0, length);
Marshal.Copy(buffer, 0, mat.DataPointer, length);
}
finally
{
bitmap.UnlockBits(data);
}
return mat;
}
/// <summary>
/// Безопасная конвертация Mat → Bitmap через промежуточный буфер
/// </summary>
private static Bitmap MatToBitmap(Mat mat)
{
var colorMat = new Mat();
if (mat.NumberOfChannels == 1)
CvInvoke.CvtColor(mat, colorMat, ColorConversion.Gray2Bgr);
else
mat.CopyTo(colorMat);
var bmp = new Bitmap(colorMat.Width, colorMat.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
var data = bmp.LockBits(
new Rectangle(0, 0, bmp.Width, bmp.Height),
System.Drawing.Imaging.ImageLockMode.WriteOnly,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
try
{
int length = Math.Abs(data.Stride) * colorMat.Height;
byte[] buffer = new byte[length];
Marshal.Copy(colorMat.DataPointer, buffer, 0, length);
Marshal.Copy(buffer, 0, data.Scan0, length);
}
finally
{
bmp.UnlockBits(data);
colorMat.Dispose();
}
return bmp;
}
public void Dispose()
{
_cascade?.Dispose();
_recognizer?.Dispose();
}
}
@@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
-12
View File
@@ -1,12 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Camera": {
"Url": "rtsp://admin:4NUDZhJ7@172.22.10.101:554/cam/realmonitor?channel=1&subtype=0"
}
}
Binary file not shown.
File diff suppressed because it is too large Load Diff
-73
View File
@@ -1,73 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Face Recognition</title>
<style>
body {
font-family: sans-serif;
background: #222;
color: #fff;
text-align: center;
}
#gallery {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px;
margin-top: 20px;
}
.card {
background: #333;
padding: 10px;
border-radius: 8px;
width: 200px;
}
img {
width: 100%;
border: 3px solid red;
border-radius: 4px;
}
.known img {
border-color: green;
}
.name {
margin-top: 5px;
font-weight: bold;
}
.time {
font-size: 0.8em;
color: #aaa;
}
</style>
</head>
<body>
<h1>Live Face Detection</h1>
<div id="gallery"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/microsoft-signalr/8.0.0/signalr.min.js"></script>
<script>
const connection = new signalR.HubConnectionBuilder().withUrl("/faceHub").build();
connection.on("NewFace", (data) => {
const div = document.createElement('div');
div.className = data.isRecognized ? 'card known' : 'card';
div.innerHTML = `
<img src="data:image/jpeg;base64,${data.image}" />
<div class="name">${data.isRecognized ? data.name : 'Unknown'}</div>
<div class="time">${new Date().toLocaleTimeString()}</div>
`;
const gallery = document.getElementById('gallery');
gallery.insertBefore(div, gallery.firstChild);
if (gallery.children.length > 20) gallery.lastChild.remove();
});
connection.start().catch(console.error);
</script>
</body>
</html>
@@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.10" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="10.0.8" />
</ItemGroup>
<ItemGroup>
+3 -3
View File
@@ -2,14 +2,14 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.10" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.5" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
</ItemGroup>
</Project>
+1 -2
View File
@@ -9,8 +9,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.OpenApi" Version="3.8.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.7" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
</ItemGroup>
+5 -5
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<ApplicationIcon>LCS_logo.ico</ApplicationIcon>
@@ -13,10 +13,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.10" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
<PackageReference Include="Selenium.WebDriver" Version="4.46.0" />
<PackageReference Include="Telegram.Bot" Version="22.10.1.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.4" />
<PackageReference Include="Selenium.WebDriver" Version="4.21.0" />
<PackageReference Include="Telegram.Bot" Version="19.0.0" />
</ItemGroup>
</Project>
+4 -8
View File
@@ -11,7 +11,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.10" newVersion="10.0.0.10" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.5" newVersion="10.0.0.5" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -19,7 +19,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.10" newVersion="10.0.0.10" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.5" newVersion="10.0.0.5" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -27,20 +27,16 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Channels" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.10" newVersion="10.0.0.10" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.5" newVersion="10.0.0.5" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.10" newVersion="10.0.0.10" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.5" newVersion="10.0.0.5" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.10" newVersion="10.0.0.10" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
+15 -18
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\Selenium.WebDriver.4.46.0\build\Selenium.WebDriver.props" Condition="Exists('..\packages\Selenium.WebDriver.4.46.0\build\Selenium.WebDriver.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -68,26 +67,20 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.10\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Selenium.WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=1c2bd1631853048f, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.4.46.0\lib\net462\Selenium.WebDriver.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=10.0.0.10, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.10.0.10\lib\net462\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Pipelines, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.10.0.10\lib\net462\System.IO.Pipelines.dll</HintPath>
<Reference Include="System.IO.Pipelines, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.10.0.5\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
@@ -99,14 +92,14 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.10.0.10\lib\net462\System.Text.Encodings.Web.dll</HintPath>
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.10.0.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.10.0.10\lib\net462\System.Text.Json.dll</HintPath>
<Reference Include="System.Text.Json, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.10.0.5\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Channels, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Channels.10.0.10\lib\net462\System.Threading.Channels.dll</HintPath>
<Reference Include="System.Threading.Channels, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Channels.10.0.5\lib\net462\System.Threading.Channels.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
@@ -121,6 +114,9 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WebDriver, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.4.41.0\lib\net462\WebDriver.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
@@ -176,12 +172,13 @@
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets" Condition="Exists('..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их. Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.4.41.0\build\Selenium.WebDriver.targets'))" />
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets'))" />
<Error Condition="!Exists('..\packages\Selenium.WebDriver.4.46.0\build\Selenium.WebDriver.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Selenium.WebDriver.4.46.0\build\Selenium.WebDriver.props'))" />
</Target>
<Import Project="..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.2\build\net471\System.ValueTuple.targets')" />
</Project>
+6 -7
View File
@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.10" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.5" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net48" />
<package id="Selenium.WebDriver" version="4.46.0" targetFramework="net48" />
<package id="Selenium.WebDriver" version="4.41.0" targetFramework="net48" />
<package id="System.Buffers" version="4.6.1" targetFramework="net48" />
<package id="System.Collections.Immutable" version="10.0.10" targetFramework="net48" />
<package id="System.IO.Pipelines" version="10.0.10" targetFramework="net48" />
<package id="System.IO.Pipelines" version="10.0.5" targetFramework="net48" />
<package id="System.Memory" version="4.6.3" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="10.0.10" targetFramework="net48" />
<package id="System.Text.Json" version="10.0.10" targetFramework="net48" />
<package id="System.Threading.Channels" version="10.0.10" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="10.0.5" targetFramework="net48" />
<package id="System.Text.Json" version="10.0.5" targetFramework="net48" />
<package id="System.Threading.Channels" version="10.0.5" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
<package id="System.ValueTuple" version="4.6.2" targetFramework="net48" />
</packages>
+10 -10
View File
@@ -63,22 +63,22 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.10\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.10.0.5\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Pipelines, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.10.0.10\lib\net462\System.IO.Pipelines.dll</HintPath>
<Reference Include="System.IO.Pipelines, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Pipelines.10.0.5\lib\net462\System.IO.Pipelines.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Json, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.Json.10.0.10\lib\net462\System.Net.Http.Json.dll</HintPath>
<Reference Include="System.Net.Http.Json, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.Json.10.0.5\lib\net462\System.Net.Http.Json.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
@@ -87,11 +87,11 @@
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.10.0.10\lib\net462\System.Text.Encodings.Web.dll</HintPath>
<Reference Include="System.Text.Encodings.Web, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.10.0.5\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=10.0.0.10, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.10.0.10\lib\net462\System.Text.Json.dll</HintPath>
<Reference Include="System.Text.Json, Version=10.0.0.5, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.10.0.5\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
+5 -5
View File
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.10" targetFramework="net48" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="10.0.5" targetFramework="net48" />
<package id="System.Buffers" version="4.6.1" targetFramework="net48" />
<package id="System.IO.Pipelines" version="10.0.10" targetFramework="net48" />
<package id="System.IO.Pipelines" version="10.0.5" targetFramework="net48" />
<package id="System.Memory" version="4.6.3" targetFramework="net48" />
<package id="System.Net.Http.Json" version="10.0.10" targetFramework="net48" />
<package id="System.Net.Http.Json" version="10.0.5" targetFramework="net48" />
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="10.0.10" targetFramework="net48" />
<package id="System.Text.Json" version="10.0.10" targetFramework="net48" />
<package id="System.Text.Encodings.Web" version="10.0.5" targetFramework="net48" />
<package id="System.Text.Json" version="10.0.5" targetFramework="net48" />
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net48" />
<package id="System.ValueTuple" version="4.6.2" targetFramework="net48" />
</packages>
+3 -2
View File
@@ -5,7 +5,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<link rel="stylesheet" href="~/bootstrap/css/bootstrap.css" />
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="app.css" />
<link rel="stylesheet" href="Ministreliy.styles.css" />
<link rel="icon" type="image/png" href="favicon.png" />
@@ -14,8 +15,8 @@
<body>
<Routes @rendermode="InteractiveServer" />
<script src="~/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="_framework/blazor.web.js"></script>
<script src="/bootstrap/js/bootstrap.bundle.js"></script>
</body>
</html>
+5 -54
View File
@@ -1,72 +1,23 @@
@page "/database"
@using Ministreliy.Models
@using Newtonsoft.Json
@using System.Text
@inject IJSRuntime JS
@inject NavigationManager NavManager
<PageTitle>База данных</PageTitle>
<div>
<div class="row justify-content-between">
<div class="col-10">
<ul class="nav nav-tabs">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="database">Сводные данные</a>
</li>
<li class="nav-item">
<a class="nav-link" href="database/type">Типы устройств</a>
</li>
<li class="nav-item">
<a class="nav-link" href="database/device">Устройства</a>
</li>
</ul>
</div>
<div class="col-2">
@* <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addtype">
Добавить тип
</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#deltype">
Удалить тип
</button> *@
</div>
</div>
<div class="row">
</div>
</div>
@if (listDeviceTypes.Count == 0 || listDeviceItems.Count == 0)
{
<p>@messageStatus</p>
}
</ul>
@code {
public static List<DeviceType>? listDeviceTypes = new();
public static List<DeviceItem>? listDeviceItems = new();
public static HttpClient httpClient = new();
private int currentCount = 0;
string? messageStatus = "Получаю данные...";
protected override async Task OnInitializedAsync()
private void IncrementCount()
{
httpClient.BaseAddress = new Uri("http://localhost:5262/api/");
var devicetype = await httpClient.GetAsync("Device/GetTypes");
var deviceitem = await httpClient.GetAsync("Device/GetDevices");
listDeviceTypes = JsonConvert.DeserializeObject<List<DeviceType>>(await devicetype.Content.ReadAsStringAsync());
listDeviceItems = JsonConvert.DeserializeObject<List<DeviceItem>>(await deviceitem.Content.ReadAsStringAsync());
messageStatus = string.Empty;
if (listDeviceTypes.Count == 0)
{
messageStatus += $"нет типов устройств\r\n";
}
if (listDeviceItems.Count == 0)
{
messageStatus += $"нет устройств\r\n";
}
DataStore.ListDeviceTypesStore = listDeviceTypes;
DataStore.ListDeviceItemsStore = listDeviceItems;
currentCount++;
}
}
@@ -1,201 +0,0 @@
@page "/database/device"
@using Ministreliy.Models
@using System.Text.Json
@using Newtonsoft.Json
@using System.Text
@inject IJSRuntime JS
@inject NavigationManager NavManager
<PageTitle>База данных</PageTitle>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="database">Сводные данные</a>
</li>
<li class="nav-item">
<a class="nav-link" href="database/type">Типы устройств</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="database/device">Устройства</a>
</li>
</ul>
<div class="modal fade modal1" id="addtype" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="addtypeLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="addtypeLabel">Заголовок</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="typeID" class="form-label">id типа</label>
<input type="number" class="form-control" id="typeID" @bind="id_type" />
</div>
<div class="mb-3">
<label for="typeName" class="form-label">Имя типа</label>
<textarea class="form-control" id="typeName" rows="3" @bind="name_type"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" @onclick="SaveType">Сохранить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
@if (listDT.Count == 0 || listDT == null)
{
<p>@msg</p>
}
else
{
@* <ul class="nav nav-tabs">
<li class="nav-item" role="presentation">
<a class="nav-link" aria-current="page" href="database">Сводные данные</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active"
id="addtype-tab"
data-bs-toggle="tab"
data-bs-target="#addtype"
role="tab"
aria-controls="addtype"
aria-selected="true"
href="database/addtype">Добавить Тип</a>
</li>
</ul> *@
<br>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addtype">
Добавить тип
</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#deltype">
Удалить тип
</button>
<div class="card-body p-0">
<div class="tab-content" id="myTabContent">
<!-- Панель 1: Главная -->
<div class="tab-pane fade show active" id="addtype" role="tabpanel" aria-labelledby="addtype-tab">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Название</th>
</tr>
</thead>
<tbody>
@foreach (var item in listDT)
{
<tr>
<th scope="row">@item.Id</th>
<td>@item.Name</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade modal2" id="deltype" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="deltypeLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="deltypeLabel">Заголовок</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<select class="form-select" @bind="selected_type" aria-label="Вибрать тип">
@foreach (var item in listDT)
{
<option value="@item.Id">@item.Name</option>
}
</select>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" @onclick="DelType">Удалить</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Закрыть</button>
</div>
</div>
</div>
</div>
}
@code {
//HttpClient http = new();
private DeviceType dt;
private List<DeviceType> listDT = new();
private string msg = "-= ПОЛУЧАЮ ДАННЫЕ =-", name_type = "";
private int id_type = 1, selected_type = 0;
protected override async Task OnInitializedAsync()
{
HttpClient http = new();
await Task.Delay(1000);
http.BaseAddress = new Uri("http://localhost:5262/api/");
var t = await http.GetAsync("Device/GetTypes");
if (t.StatusCode == System.Net.HttpStatusCode.NoContent)
{
msg = "-= ДАННЫХ НЕТ =-";
}
else
{
listDT = JsonConvert.DeserializeObject<List<DeviceType>>(await t.Content.ReadAsStringAsync());
//id_type = listDT.Count + 1;
var a = listDT.Select(listDT => listDT.Id).ToList();
id_type = Enumerable.Range(1, int.MaxValue).FirstOrDefault(i => !a.Contains(i));
}
}
private async Task SaveType()
{
HttpClient http = new();
dt = new();
dt.Id = id_type;
dt.Name = name_type;
http.BaseAddress = new Uri("http://localhost:5262/api/");
using StringContent content = new StringContent(
JsonConvert.SerializeObject(dt),
Encoding.UTF8,
"application/json"
);
var r = await http.PostAsync("Device/AddType", content);
if (r.IsSuccessStatusCode)
{
await JS.InvokeVoidAsync("eval", $"var myModal = bootstrap.Modal.getInstance(document.querySelector('.modal1')); myModal.hide();");
await Task.Delay(150);
id_type = listDT.Count+1;
NavManager.NavigateTo(NavManager.Uri, forceLoad: true);
}
}
private async Task DelType()
{
HttpClient http = new();
http.BaseAddress = new Uri("http://localhost:5262/api/");
var r = await http.DeleteAsync($"Device/DelType?id={selected_type}");
if (r.IsSuccessStatusCode)
{
await JS.InvokeVoidAsync("eval", $"var myModal = bootstrap.Modal.getInstance(document.querySelector('.modal2')); myModal.hide();");
await Task.Delay(250);
id_type = listDT.Count + 1;
NavManager.NavigateTo(NavManager.Uri, forceLoad: true);
}
}
}
+78 -80
View File
@@ -3,69 +3,19 @@
@using System.Text.Json
@using Newtonsoft.Json
@using System.Text
@inject IJSRuntime JS
@inject NavigationManager NavManager
<PageTitle>База данных</PageTitle>
<div class="row justify-content-between">
<div class="col-10">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="database">Сводные данные</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="database/type">Типы устройств</a>
</li>
<li class="nav-item">
<a class="nav-link" href="database/device">Устройства</a>
</li>
</ul>
</div>
<div class="col-2">
<button type="button" class="btn btn-primary" @onclick="OpenModal">
Добавить тип
</button>
<button type="button" class="btn btn-primary" @onclick="DelModal">
Удалить тип
</button>
</div>
</div>
@if (listDT.Count == 0)
{
<p>@msg</p>
}
else
{
<div class="card-body p-0">
<div class="tab-content" id="myTabContent">
<!-- Панель 1: Главная -->
<div class="tab-pane fade show active" id="addtype" role="tabpanel" aria-labelledby="addtype-tab">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Название</th>
</tr>
</thead>
<tbody>
@foreach (var item in Database.listDeviceTypes)
{
<tr>
<th scope="row">@item.Id</th>
<td>@item.Name</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
}
<div class="modal fade modal1" id="addtype" tabindex="-1" aria-labelledby="addtypeLabel" aria-hidden="true">
<div class="modal fade modal1" id="addtype" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="addtypeLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="addtypeLabel">Заголовок</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="typeID" class="form-label">id типа</label>
@@ -83,7 +33,64 @@ else
</div>
</div>
</div>
<div class="modal fade modal2" id="deltype" tabindex="-1" aria-labelledby="deltypeLabel" aria-hidden="true">
@if (listDT.Count == 0 || listDT == null)
{
<p>@msg</p>
}
else
{
<ul class="nav nav-tabs">
<li class="nav-item" role="presentation">
<a class="nav-link" aria-current="page" href="database">Сводные данные</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active"
id="addtype-tab"
data-bs-toggle="tab"
data-bs-target="#addtype"
role="tab"
aria-controls="addtype"
aria-selected="true"
href="database/addtype">Добавить Тип</a>
</li>
</ul>
<div class="card-body p-0">
<div class="tab-content" id="myTabContent">
<!-- Панель 1: Главная -->
<div class="tab-pane fade show active" id="addtype" role="tabpanel" aria-labelledby="addtype-tab">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">Название</th>
</tr>
</thead>
<tbody>
@foreach (var item in listDT)
{
<tr>
<th scope="row">@item.Id</th>
<td>@item.Name</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#deltype">
Удалить тип
</button>
<div class="modal fade modal2" id="deltype" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="deltypeLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@@ -106,43 +113,37 @@ else
</div>
</div>
</div>
</div>
<script>
// Функции для работы с модальными окнами
window.openModal = function (modalId) {
const modalElement = document.getElementById(modalId);
if (modalElement) {
const modal = new bootstrap.Modal(modalElement);
modal.show();
} else {
console.error('Модальное окно с id "' + modalId + '" не найдено');
}
};
</script>
</div>
}
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addtype">
Добавить тип
</button>
@code {
//HttpClient http = new();
private DeviceType dt;
private List<DeviceType> listDT;
private List<DeviceType> listDT = new();
private string msg = "-= ПОЛУЧАЮ ДАННЫЕ =-", name_type = "";
private int id_type = 1, selected_type = 0;
protected override async Task OnInitializedAsync()
{
listDT = Database.listDeviceTypes;
if (listDT.Count == 0)
HttpClient http = new();
await Task.Delay(1000);
http.BaseAddress = new Uri("http://localhost:5262/api/");
var t = await http.GetAsync("Device/GetTypes");
if (t.StatusCode == System.Net.HttpStatusCode.NoContent)
{
msg = "-= ДАННЫХ НЕТ =-";
}
else
{
listDT = JsonConvert.DeserializeObject<List<DeviceType>>(await t.Content.ReadAsStringAsync());
//id_type = listDT.Count + 1;
var a = listDT.Select(listDT => listDT.Id).ToList();
//id_type = Enumerable.Range(1, int.MaxValue).FirstOrDefault(i => !a.Contains(i));
id_type = Enumerable.Range(1, int.MaxValue).FirstOrDefault(i => !a.Contains(i));
}
}
@@ -163,7 +164,7 @@ else
{
await JS.InvokeVoidAsync("eval", $"var myModal = bootstrap.Modal.getInstance(document.querySelector('.modal1')); myModal.hide();");
await Task.Delay(150);
id_type = listDT.Count + 1;
id_type = listDT.Count+1;
NavManager.NavigateTo(NavManager.Uri, forceLoad: true);
}
}
@@ -180,9 +181,6 @@ else
NavManager.NavigateTo(NavManager.Uri, forceLoad: true);
}
}
private async Task OpenModal() => await JS.InvokeVoidAsync("openModal", "addtype");
private async Task DelModal() => await JS.InvokeVoidAsync("openModal", "deltype");
}
@@ -0,0 +1,63 @@
@page "/weather"
<PageTitle>Weather</PageTitle>
<h1>Weather</h1>
<p>This component demonstrates showing data.</p>
@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th>Temp. (C)</th>
<th>Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
}
@code {
private WeatherForecast[]? forecasts;
protected override async Task OnInitializedAsync()
{
// Simulate asynchronous loading to demonstrate a loading indicator
await Task.Delay(500);
var startDate = DateOnly.FromDateTime(DateTime.Now);
var summaries = new[] { "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" };
forecasts = Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = startDate.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = summaries[Random.Shared.Next(summaries.Length)]
}).ToArray();
}
private class WeatherForecast
{
public DateOnly Date { get; set; }
public int TemperatureC { get; set; }
public string? Summary { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
}
-2
View File
@@ -7,8 +7,6 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap5" Version="2.2.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
</ItemGroup>
-8
View File
@@ -1,8 +0,0 @@
namespace Ministreliy.Models
{
public class DataStore
{
public static List<DeviceType>? ListDeviceTypesStore;
public static List<DeviceItem>? ListDeviceItemsStore;
}
}
-25
View File
@@ -1,25 +0,0 @@
namespace Ministreliy.Models
{
public class DeviceItem
{
public int Id { get; set; }
public string Ip { get; set; }
public string Mac { get; set; }
public string? Description { get; set; }
public string? Name { get; set; }
public string? Location { get; set; }
public List<DeviceItem> Devises { get; set; }
public DeviceType DeviceType { get; set; }
public int ConnectedToSwitchId { get; set; }
public int ConnectedToPortOnSwitch { get; set; }
}
//Unknown = 0,
//SwitchCore = 1,
//SwitchAccess = 2,
//Camera = 3,
//Server = 4,
//WorkStation = 5,
//PDU_AVR = 6,
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-601
View File
@@ -1,601 +0,0 @@
/*!
* Bootstrap Reboot v5.3.8 (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
line-height: inherit;
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type=search]::-webkit-search-cancel-button {
cursor: pointer;
filter: grayscale(1);
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-598
View File
@@ -1,598 +0,0 @@
/*!
* Bootstrap Reboot v5.3.8 (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
line-height: inherit;
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type=search]::-webkit-search-cancel-button {
cursor: pointer;
filter: grayscale(1);
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+4 -11
View File
@@ -12,18 +12,11 @@ internal class Program
args[2] = "admin";
args[3] = "4NUDZhJ7";
#endif
string? server = null, login, password;
if (args.Length != 4)
{
login = args[1];
password = args[2];
}
else
{
string server, login, password;
if (args.Length != 4) return;
server = args[1];
login = args[2];
password = args[3];
}
switch (args[0])
@@ -142,8 +135,8 @@ internal class Program
$"SNMP.WriteCommon=private";
var response2 = await httpClient.GetAsync(requestUrl2);
var r2 = await response2.Content.ReadAsStringAsync();
if (r2.StartsWith("OK")) Console.WriteLine($"{host} - OK");
else Console.WriteLine($"{host} - !!!BAD!!!");
if (r2.StartsWith("OK")) Console.WriteLine("0");
else Console.WriteLine("1");
}
else Console.WriteLine("1");
}
+255 -60
View File
@@ -1,60 +1,255 @@
172.22.10.93
172.22.10.94
172.22.10.95
172.22.10.96
172.22.10.97
172.22.10.98
172.22.10.99
172.22.10.100
172.22.10.101
172.22.10.102
172.22.10.103
172.22.10.104
172.22.10.105
172.22.10.106
172.22.10.107
172.22.10.108
172.22.10.109
172.22.10.110
172.22.10.111
172.22.10.112
172.22.10.113
172.22.10.114
172.22.10.115
172.22.10.116
172.22.10.117
172.22.10.118
172.22.10.119
172.22.10.120
172.22.10.121
172.22.10.122
172.22.10.123
172.22.10.124
172.22.10.125
172.22.10.126
172.22.10.127
172.22.10.128
172.22.10.129
172.22.10.130
172.22.10.131
172.22.10.132
172.22.10.133
172.22.10.134
172.22.10.135
172.22.10.136
172.22.10.137
172.22.10.138
172.22.10.139
172.22.10.140
172.22.10.141
172.22.10.142
172.22.10.143
172.22.10.144
172.22.10.145
172.22.10.146
172.22.10.147
172.22.10.148
172.22.10.149
172.22.10.150
172.22.10.151
172.22.10.152
172.16.54.1
172.16.54.2
172.16.54.3
172.16.54.4
172.16.54.5
172.16.54.6
172.16.54.7
172.16.54.8
172.16.54.9
172.16.54.10
172.16.54.11
172.16.54.12
172.16.54.13
172.16.54.14
172.16.54.15
172.16.54.16
172.16.54.17
172.16.54.18
172.16.54.19
172.16.54.20
172.16.54.21
172.16.54.22
172.16.54.23
172.16.54.24
172.16.54.25
172.16.54.26
172.16.54.27
172.16.54.28
172.16.54.29
172.16.54.30
172.16.54.31
172.16.54.32
172.16.54.33
172.16.54.34
172.16.54.35
172.16.54.36
172.16.54.37
172.16.54.38
172.16.54.39
172.16.54.40
172.16.54.41
172.16.54.42
172.16.54.43
172.16.54.44
172.16.54.45
172.16.54.46
172.16.54.47
172.16.54.48
172.16.54.49
172.16.54.50
172.16.54.51
172.16.53.52
172.16.53.53
172.16.53.54
172.16.53.55
172.16.53.56
172.16.53.57
172.16.53.58
172.16.53.59
172.16.53.60
172.16.53.61
172.16.53.62
172.16.53.63
172.16.53.64
172.16.53.65
172.16.53.66
172.16.53.67
172.16.53.68
172.16.53.69
172.16.53.70
172.16.53.71
172.16.53.72
172.16.53.73
172.16.53.74
172.16.53.75
172.16.53.76
172.16.53.77
172.16.53.78
172.16.53.79
172.16.53.80
172.16.53.81
172.16.53.82
172.16.53.83
172.16.53.84
172.16.53.85
172.16.53.86
172.16.53.87
172.16.53.88
172.16.53.89
172.16.53.90
172.16.53.91
172.16.53.92
172.16.53.93
172.16.53.94
172.16.53.95
172.16.53.96
172.16.53.97
172.16.53.98
172.16.53.99
172.16.53.100
172.16.53.101
172.16.53.102
172.16.53.103
172.16.53.104
172.16.53.105
172.16.53.106
172.16.53.107
172.16.53.108
172.16.53.109
172.16.53.110
172.16.53.111
172.16.53.112
172.16.53.113
172.16.53.114
172.16.53.115
172.16.53.116
172.16.53.117
172.16.53.118
172.16.53.119
172.16.53.120
172.16.53.121
172.16.53.122
172.16.53.123
172.16.53.124
172.16.53.125
172.16.53.126
172.16.53.127
172.16.53.128
172.16.53.129
172.16.53.130
172.16.53.131
172.16.53.132
172.16.53.133
172.16.53.134
172.16.53.135
172.16.53.136
172.16.53.137
172.16.53.138
172.16.53.139
172.16.53.140
172.16.53.141
172.16.53.142
172.16.53.143
172.16.53.144
172.16.53.145
172.16.53.146
172.16.53.147
172.16.53.148
172.16.53.149
172.16.53.150
172.16.53.151
172.16.53.152
172.16.53.153
172.16.53.154
172.16.53.155
172.16.53.156
172.16.53.157
172.16.53.158
172.16.53.159
172.16.53.160
172.16.53.161
172.16.53.162
172.16.53.163
172.16.53.164
172.16.53.165
172.16.53.166
172.16.53.167
172.16.53.168
172.16.53.169
172.16.53.170
172.16.53.171
172.16.53.172
172.16.53.173
172.16.53.174
172.16.53.175
172.16.53.176
172.16.53.177
172.16.53.178
172.16.53.179
172.16.53.180
172.16.53.181
172.16.53.182
172.16.53.183
172.16.53.184
172.16.53.185
172.16.53.186
172.16.53.187
172.16.53.188
172.16.53.189
172.16.53.190
172.16.53.191
172.16.53.192
172.16.53.193
172.16.53.194
172.16.53.195
172.16.53.196
172.16.53.197
172.16.53.198
172.16.53.199
172.16.53.200
172.16.53.201
172.16.53.202
172.16.53.203
172.16.53.204
172.16.53.205
172.16.53.206
172.16.53.207
172.16.53.208
172.16.53.209
172.16.53.210
172.16.53.211
172.16.53.212
172.16.53.213
172.16.53.214
172.16.53.215
172.16.53.216
172.16.53.217
172.16.53.218
172.16.53.219
172.16.53.220
172.16.53.221
172.16.53.222
172.16.53.223
172.16.53.224
172.16.53.225
172.16.53.226
172.16.53.227
172.16.53.228
172.16.53.229
172.16.53.230
172.16.53.231
172.16.53.232
172.16.53.233
172.16.53.234
172.16.53.235
172.16.53.236
172.16.53.237
172.16.53.238
172.16.53.239
172.16.53.240
172.16.53.241
172.16.53.242
172.16.53.243
172.16.53.244
172.16.53.245
172.16.53.246
172.16.53.247
172.16.53.248
172.16.53.249
172.16.53.250
172.16.53.251
172.16.53.252
172.16.53.253
172.16.53.254
172.16.53.255
1 172.22.10.93 172.16.54.1
2 172.22.10.94 172.16.54.2
3 172.22.10.95 172.16.54.3
4 172.22.10.96 172.16.54.4
5 172.22.10.97 172.16.54.5
6 172.22.10.98 172.16.54.6
7 172.22.10.99 172.16.54.7
8 172.22.10.100 172.16.54.8
9 172.22.10.101 172.16.54.9
10 172.22.10.102 172.16.54.10
11 172.22.10.103 172.16.54.11
12 172.22.10.104 172.16.54.12
13 172.22.10.105 172.16.54.13
14 172.22.10.106 172.16.54.14
15 172.22.10.107 172.16.54.15
16 172.22.10.108 172.16.54.16
17 172.22.10.109 172.16.54.17
18 172.22.10.110 172.16.54.18
19 172.22.10.111 172.16.54.19
20 172.22.10.112 172.16.54.20
21 172.22.10.113 172.16.54.21
22 172.22.10.114 172.16.54.22
23 172.22.10.115 172.16.54.23
24 172.22.10.116 172.16.54.24
25 172.22.10.117 172.16.54.25
26 172.22.10.118 172.16.54.26
27 172.22.10.119 172.16.54.27
28 172.22.10.120 172.16.54.28
29 172.22.10.121 172.16.54.29
30 172.22.10.122 172.16.54.30
31 172.22.10.123 172.16.54.31
32 172.22.10.124 172.16.54.32
33 172.22.10.125 172.16.54.33
34 172.22.10.126 172.16.54.34
35 172.22.10.127 172.16.54.35
36 172.22.10.128 172.16.54.36
37 172.22.10.129 172.16.54.37
38 172.22.10.130 172.16.54.38
39 172.22.10.131 172.16.54.39
40 172.22.10.132 172.16.54.40
41 172.22.10.133 172.16.54.41
42 172.22.10.134 172.16.54.42
43 172.22.10.135 172.16.54.43
44 172.22.10.136 172.16.54.44
45 172.22.10.137 172.16.54.45
46 172.22.10.138 172.16.54.46
47 172.22.10.139 172.16.54.47
48 172.22.10.140 172.16.54.48
49 172.22.10.141 172.16.54.49
50 172.22.10.142 172.16.54.50
51 172.22.10.143 172.16.54.51
52 172.22.10.144 172.16.53.52
53 172.22.10.145 172.16.53.53
54 172.22.10.146 172.16.53.54
55 172.22.10.147 172.16.53.55
56 172.22.10.148 172.16.53.56
57 172.22.10.149 172.16.53.57
58 172.22.10.150 172.16.53.58
59 172.22.10.151 172.16.53.59
60 172.22.10.152 172.16.53.60
61 172.16.53.61
62 172.16.53.62
63 172.16.53.63
64 172.16.53.64
65 172.16.53.65
66 172.16.53.66
67 172.16.53.67
68 172.16.53.68
69 172.16.53.69
70 172.16.53.70
71 172.16.53.71
72 172.16.53.72
73 172.16.53.73
74 172.16.53.74
75 172.16.53.75
76 172.16.53.76
77 172.16.53.77
78 172.16.53.78
79 172.16.53.79
80 172.16.53.80
81 172.16.53.81
82 172.16.53.82
83 172.16.53.83
84 172.16.53.84
85 172.16.53.85
86 172.16.53.86
87 172.16.53.87
88 172.16.53.88
89 172.16.53.89
90 172.16.53.90
91 172.16.53.91
92 172.16.53.92
93 172.16.53.93
94 172.16.53.94
95 172.16.53.95
96 172.16.53.96
97 172.16.53.97
98 172.16.53.98
99 172.16.53.99
100 172.16.53.100
101 172.16.53.101
102 172.16.53.102
103 172.16.53.103
104 172.16.53.104
105 172.16.53.105
106 172.16.53.106
107 172.16.53.107
108 172.16.53.108
109 172.16.53.109
110 172.16.53.110
111 172.16.53.111
112 172.16.53.112
113 172.16.53.113
114 172.16.53.114
115 172.16.53.115
116 172.16.53.116
117 172.16.53.117
118 172.16.53.118
119 172.16.53.119
120 172.16.53.120
121 172.16.53.121
122 172.16.53.122
123 172.16.53.123
124 172.16.53.124
125 172.16.53.125
126 172.16.53.126
127 172.16.53.127
128 172.16.53.128
129 172.16.53.129
130 172.16.53.130
131 172.16.53.131
132 172.16.53.132
133 172.16.53.133
134 172.16.53.134
135 172.16.53.135
136 172.16.53.136
137 172.16.53.137
138 172.16.53.138
139 172.16.53.139
140 172.16.53.140
141 172.16.53.141
142 172.16.53.142
143 172.16.53.143
144 172.16.53.144
145 172.16.53.145
146 172.16.53.146
147 172.16.53.147
148 172.16.53.148
149 172.16.53.149
150 172.16.53.150
151 172.16.53.151
152 172.16.53.152
153 172.16.53.153
154 172.16.53.154
155 172.16.53.155
156 172.16.53.156
157 172.16.53.157
158 172.16.53.158
159 172.16.53.159
160 172.16.53.160
161 172.16.53.161
162 172.16.53.162
163 172.16.53.163
164 172.16.53.164
165 172.16.53.165
166 172.16.53.166
167 172.16.53.167
168 172.16.53.168
169 172.16.53.169
170 172.16.53.170
171 172.16.53.171
172 172.16.53.172
173 172.16.53.173
174 172.16.53.174
175 172.16.53.175
176 172.16.53.176
177 172.16.53.177
178 172.16.53.178
179 172.16.53.179
180 172.16.53.180
181 172.16.53.181
182 172.16.53.182
183 172.16.53.183
184 172.16.53.184
185 172.16.53.185
186 172.16.53.186
187 172.16.53.187
188 172.16.53.188
189 172.16.53.189
190 172.16.53.190
191 172.16.53.191
192 172.16.53.192
193 172.16.53.193
194 172.16.53.194
195 172.16.53.195
196 172.16.53.196
197 172.16.53.197
198 172.16.53.198
199 172.16.53.199
200 172.16.53.200
201 172.16.53.201
202 172.16.53.202
203 172.16.53.203
204 172.16.53.204
205 172.16.53.205
206 172.16.53.206
207 172.16.53.207
208 172.16.53.208
209 172.16.53.209
210 172.16.53.210
211 172.16.53.211
212 172.16.53.212
213 172.16.53.213
214 172.16.53.214
215 172.16.53.215
216 172.16.53.216
217 172.16.53.217
218 172.16.53.218
219 172.16.53.219
220 172.16.53.220
221 172.16.53.221
222 172.16.53.222
223 172.16.53.223
224 172.16.53.224
225 172.16.53.225
226 172.16.53.226
227 172.16.53.227
228 172.16.53.228
229 172.16.53.229
230 172.16.53.230
231 172.16.53.231
232 172.16.53.232
233 172.16.53.233
234 172.16.53.234
235 172.16.53.235
236 172.16.53.236
237 172.16.53.237
238 172.16.53.238
239 172.16.53.239
240 172.16.53.240
241 172.16.53.241
242 172.16.53.242
243 172.16.53.243
244 172.16.53.244
245 172.16.53.245
246 172.16.53.246
247 172.16.53.247
248 172.16.53.248
249 172.16.53.249
250 172.16.53.250
251 172.16.53.251
252 172.16.53.252
253 172.16.53.253
254 172.16.53.254
255 172.16.53.255
+37 -35
View File
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Http.HttpResults;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Strela.Models;
using Strela.Services;
@@ -8,21 +10,31 @@ namespace Strela.Controllers;
[Route("api/[controller]")]
public class DeviceController : ControllerBase
{
private readonly ILogger<DeviceController> _logger;
private readonly ILogger<UserController> _logger;
public DeviceController(ILogger<DeviceController> logger)
public DeviceController(ILogger<UserController> logger)
{
_logger = logger;
}
//=========================== GET =================================//
#region GET
[HttpGet("GetTypes")]
[ProducesResponseType<List<DeviceType>>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetList()
{
using (var db = new SQLiteService())
{
var tps = db.DeviceTypes.ToList();
if (tps.Count != 0)
return Ok(tps);
else return NoContent();
}
}
[HttpGet("GetDeviceById")]
[HttpGet("GetDevice")]
[ProducesResponseType<DeviceItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(Guid id) // Получить устройство по id
public IActionResult GetById(int id)
{
using (var db = new SQLiteService())
{
@@ -33,25 +45,9 @@ public class DeviceController : ControllerBase
}
}
[HttpGet("GetDevices")]
[ProducesResponseType<DeviceItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetAll() // Получить все устройства
{
using (var db = new SQLiteService())
{
var d = db.Devices.ToList();
//if (d.Count != 0)
return Ok(d);
//else return NoContent();
}
}
#endregion
//========================= POST ====================================//
#region POST
[HttpPost("AddDevice")]
public IActionResult AddDevice(DeviceItem d) // Добавить одно устройство
public IActionResult AddDevice(DeviceItem d)
{
using (var db = new SQLiteService())
{
@@ -61,22 +57,28 @@ public class DeviceController : ControllerBase
}
}
#endregion
//========================= DELETE ====================================//
#region DELETE
[HttpDelete("DelDevice")]
public IActionResult DelDevice(Guid id) //Удалить устройство по id
[HttpPost("AddType")]
public IActionResult AddType(DeviceType d)
{
using (var db = new SQLiteService())
{
var deldev = db.Devices.Where(u => u.Id == id).FirstOrDefault();
db.Devices.Remove(deldev);
db.DeviceTypes.Add(d);//.Where(u => u.Name == name).FirstOrDefault();
db.SaveChanges();
return Created();
}
}
//========================= DELETE ====================================//
[HttpDelete("DelType")]
public IActionResult DelType(int id)
{
using (var db = new SQLiteService())
{
var deldev = db.DeviceTypes.Where(u => u.Id == id).FirstOrDefault();
db.DeviceTypes.Remove(deldev);
db.SaveChanges();
return Ok();
}
}
#endregion
}
-82
View File
@@ -1,82 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Strela.Models;
using Strela.Services;
namespace Strela.Controllers;
[ApiController]
[Route("api/[controller]")]
public class ObjectController : ControllerBase
{
private readonly ILogger<ObjectController> _logger;
public ObjectController(ILogger<ObjectController> logger)
{
_logger = logger;
}
//=========================== GET =================================//
[HttpGet("GetObject")]
public IActionResult GetList()
{
using (var db = new SQLiteService())
{
var oi = db.ObjectItems.ToList();
return Ok(oi);
}
}
[HttpGet("GetObjectById")]
[ProducesResponseType<ObjectItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(Guid id)
{
using (var db = new SQLiteService())
{
var o = db.ObjectItems.Where(o => o.Id == id).FirstOrDefault();
if (o != null)
return Ok(o);
else return NoContent();
}
}
[HttpGet("GetObjectByName")]
[ProducesResponseType<ObjectItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetByName(string name)
{
using (var db = new SQLiteService())
{
var o = db.ObjectItems.Where(ob => ob.NameObject == name).FirstOrDefault();
if (o != null)
return Ok(o);
else return NoContent();
}
}
//========================= POST ====================================//
[HttpPost("AddObject")]
public IActionResult AddObject(ObjectItem o)
{
using (var db = new SQLiteService())
{
db.ObjectItems.Add(o);
db.SaveChanges();
return Created();
}
}
//========================= DELETE ====================================//
[HttpDelete("DelObject")]
public IActionResult DelObject(Guid id)
{
using (var db = new SQLiteService())
{
var delobj = db.ObjectItems.Where(o => o.Id == id).FirstOrDefault();
db.ObjectItems.Remove(delobj);
db.SaveChanges();
return Ok();
}
}
}
-76
View File
@@ -1,76 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Strela.Models;
using Strela.Services;
namespace Strela.Controllers;
[ApiController]
[Route("api/[controller]")]
public class TypeController : ControllerBase
{
private readonly ILogger<TypeController> _logger;
public TypeController(ILogger<TypeController> logger)
{
_logger = logger;
}
//=========================== GET =================================//
#region GET
[HttpGet("GetTypes")]
public IActionResult GetList()// Получить лист типов устройств
{
using (var db = new SQLiteService())
{
var tps = db.DeviceTypes.ToList();
return Ok(tps);
}
}
[HttpGet("GetTypeById")]
[ProducesResponseType<DeviceItem>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
public IActionResult GetById(Guid id) // Получить устройство по id
{
using (var db = new SQLiteService())
{
var d = db.DeviceTypes.Where(d => d.Id == id).FirstOrDefault();
if (d != null)
return Ok(d);
else return NoContent();
}
}
#endregion
//========================= POST ====================================//
#region POST
[HttpPost("AddType")]
public IActionResult AddType(DeviceType d) //Добавить один тип устройства
{
using (var db = new SQLiteService())
{
db.DeviceTypes.Add(d);//.Where(u => u.Name == name).FirstOrDefault();
db.SaveChanges();
return Created();
}
}
#endregion
//========================= DELETE ====================================//
#region DELETE
[HttpDelete("DelType")]
public IActionResult DelType(Guid id) //Удалить тип устройства по id
{
using (var db = new SQLiteService())
{
var deldevtype = db.DeviceTypes.Where(u => u.Id == id).FirstOrDefault();
db.DeviceTypes.Remove(deldevtype);
db.SaveChanges();
return Ok();
}
}
#endregion
}
+10 -7
View File
@@ -2,18 +2,21 @@
{
public class DeviceItem
{
public Guid Id { get; set; }
public string? Ip { get; set; }
public string? Mac { get; set; }
public int Id { get; set; }
public string Ip { get; set; }
public string Mac { get; set; }
public string? Description { get; set; }
public string? Name { get; set; }
public string? Location { get; set; }
public List<Guid>? ListDevices { get; set; }
public Guid? DeviceType { get; set; }
public Guid? DeviceObject { get; set; }
public Guid? ConnectedToSwitchId { get; set; }
public List<DeviceItem> Devises { get; set; }
public DeviceType DeviceType { get; set; }
public int ConnectedToSwitchId { get; set; }
public int ConnectedToPortOnSwitch { get; set; }
//public DeviceItem(int type, string ip, string mac, string location)
//{
//}
}
//Unknown = 0,
+1 -2
View File
@@ -2,8 +2,7 @@
{
public class DeviceType
{
public Guid Id { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public string? Description { get; set; }
}
}
-9
View File
@@ -1,9 +0,0 @@
namespace Strela.Models
{
public class ObjectItem
{
public Guid Id { get; set; }
public string NameObject { get; set; } = "Unknown";
public string? DescriptionObject { get; set; } = null;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3 -4
View File
@@ -3,19 +3,18 @@ using Strela.Models;
namespace Strela.Services
{
public class SQLiteService : DbContext
public class SQLiteService: DbContext
{
public SQLiteService() => Database.EnsureCreated();
public virtual DbSet<User> Users { get; set; }
public virtual DbSet<DeviceItem> Devices { get; set; }
public virtual DbSet<DeviceType> DeviceTypes { get; set; }
public virtual DbSet<ObjectItem> ObjectItems { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql("Host=172.22.10.39;Port=5432;Database=strela;Username=postgres;Password=4NUDZhJ7");
//optionsBuilder.UseSqlite("Data Source=Services/DataBase.db");
//optionsBuilder.UseNpgsql("Host=172.24.12.201;Port=5432;Database=Notifications;Username=postgres;Password=4NUDZhJ7");
optionsBuilder.UseSqlite("Data Source=Services/DataBase.db");
}
//protected override void OnModelCreating(ModelBuilder modelBuilder)
+11 -15
View File
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>a4a5f63c-2231-4614-977a-c009c38846a3</UserSecretsId>
@@ -9,26 +9,22 @@
</PropertyGroup>
<ItemGroup>
<Compile Remove="Models\OTD\**" />
<Content Remove="Models\OTD\**" />
<EmbeddedResource Remove="Models\OTD\**" />
<None Remove="Models\OTD\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.10" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.10">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="9.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="10.0.3" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.16.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="10.2.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\lsSoft.ServiceDefaults\lsSoft.ServiceDefaults.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Models\OTD\" />
</ItemGroup>
</Project>
+2 -4
View File
@@ -1,11 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Error",
"Microsoft.AspNetCore": "Error",
"Microsoft.AspNetCore.Hosting.Diagnostics": "Information"
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"Urls": "http://0.0.0.0:5050",
"AllowedHosts": "*"
}
-13
View File
@@ -1,13 +0,0 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "10.0.10",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
}
-25
View File
@@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.32916.344
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Visor", "Visor\Visor.csproj", "{A1073A31-9C1C-4B5F-8752-F4397F84E210}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1073A31-9C1C-4B5F-8752-F4397F84E210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1073A31-9C1C-4B5F-8752-F4397F84E210}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1073A31-9C1C-4B5F-8752-F4397F84E210}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1073A31-9C1C-4B5F-8752-F4397F84E210}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C59BEA9D-058E-406A-BE53-A3BC184DCF72}
EndGlobalSection
EndGlobal
-8
View File
@@ -1,8 +0,0 @@
{
"servers": {
"blazorise-docs": {
"type": "http",
"url": "https://mcp.blazorise.com/mcp"
}
}
}
-47
View File
@@ -1,47 +0,0 @@
<Blazorise.ThemeProvider Theme="@theme">
<Router AppAssembly="typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" DefaultLayout="typeof(Visor.Layouts.MainLayout)" />
</Found>
<NotFound>
<p>Sorry, there's nothing at this address.</p>
</NotFound>
</Router>
<MessageProvider />
<PageProgressProvider />
</Blazorise.ThemeProvider>
@code {
private Theme theme = new()
{
BarOptions = new()
{
HorizontalHeight = "72px"
},
ColorOptions = new()
{
Primary = "#0288D1",
Secondary = "#A65529",
Success = "#23C02E",
Info = "#9BD8FE",
Warning = "#F8B86C",
Danger = "#F95741",
Light = "#F0F0F0",
Dark = "#535353",
},
BackgroundOptions = new()
{
Primary = "#0288D1",
Secondary = "#A65529",
Success = "#23C02E",
Info = "#9BD8FE",
Warning = "#F8B86C",
Danger = "#F95741",
Light = "#F0F0F0",
Dark = "#535353",
},
InputOptions = new()
{
CheckColor = "#0288D1",
}
};
}
@@ -1,4 +0,0 @@
@using System.Reflection
<Bar Padding="Padding.Is1" Background="Background.Default">
<Heading TextAlignment="TextAlignment.Center" Width="Width.Is100" TextColor="TextColor.White" Size="HeadingSize.Is6">@($"{Assembly.GetExecutingAssembly().GetName().Name} v{Assembly.GetExecutingAssembly().GetName().Version}")</Heading>
</Bar>
@@ -1,49 +0,0 @@
<Bar Breakpoint="Breakpoint.Desktop" NavigationBreakpoint="Breakpoint.Tablet" ThemeContrast="ThemeContrast.Dark"
Mode="BarMode.VerticalInline" CollapseMode="BarCollapseMode.Small">
<BarToggler />
<BarBrand>
<BarItem>
<BarLink To="">
<BarIcon IconName="customIcon" />
Visor
</BarLink>
</BarItem>
</BarBrand>
<BarMenu>
<BarStart>
<BarItem>
<BarLink To="/">
<BarIcon IconName="IconName.Dashboard" />
Дашборд
</BarLink>
</BarItem>
</BarStart>
<BarEnd>
<BarItem>
<BarDropdown @bind-Visible="pagesBarVisible">
<BarDropdownToggle>
<BarIcon IconName="IconName.Edit" />
Настройка
</BarDropdownToggle>
<BarDropdownMenu>
<BarDropdownItem To="/setting/add_objects">Добавить объект</BarDropdownItem>
</BarDropdownMenu>
<BarDropdownMenu>
<BarDropdownItem To="/simple-datagrid">Simple DataGrid</BarDropdownItem>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
<BarItem>
<BarLink To="/setting/wizard">
<BarIcon IconName="IconName.CaretSquareRight" />
Wizard
</BarLink>
</BarItem>
</BarEnd>
</BarMenu>
</Bar>
@code {
private bool pagesBarVisible = false;
RenderFragment customIcon = @<img src="/brand-logo.png" style="width:32px; height: 32px" />;
}
@@ -1,26 +0,0 @@
<div>
@foreach ( var color in ThemeColors.Items.Values )
{
<div @key="color.Key">
@foreach ( var shade in color.Shades.Values )
{
var temp = shade.Value;
<div @key="shade.Key" class="demo-theme-color-item" style="background: @temp" @onclick="@(()=>OnThemeColorSelect(temp))"></div>
}
</div>
}
</div>
@code{
[Parameter]
public string? Value { get; set; }
[Parameter]
public EventCallback<string> ValueChanged { get; set; }
Task OnThemeColorSelect( string value )
{
Value = value;
return ValueChanged.InvokeAsync(value);
}
}
@@ -1,16 +0,0 @@
.demo-theme-color-item {
display: table-cell;
width: 36px;
height: 36px;
vertical-align: top;
text-align: center;
color: white;
cursor: pointer;
}
.demo-theme-color-item .material-icons {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
}
-163
View File
@@ -1,163 +0,0 @@
@using Blazorise.Localization
<Bar @bind-Visible="@topbarVisible" Breakpoint="Breakpoint.Desktop" Background="Background.Primary" ThemeContrast="ThemeContrast.Light">
<BarBrand>
<BarItem>
<BarLink To="">
<BarIcon Margin="Margin.Is2.FromEnd" IconName="IconName.Dashboard" />
Visor
</BarLink>
</BarItem>
</BarBrand>
<BarToggler />
<BarMenu>
<BarStart>
<BarItem>
<BarLink To="/">Home</BarLink>
</BarItem>
<BarItem>
<BarLink To="https://blazorise.com/docs/">Documentation</BarLink>
</BarItem>
<BarItem>
<BarDropdown>
<BarDropdownToggle>More</BarDropdownToggle>
<BarDropdownMenu>
<BarDropdownItem To="https://blazorise.com/docs/start/">
Quick-Start Guide
</BarDropdownItem>
<BarDropdownDivider />
<BarDropdownItem To="https://blazorise.com/docs/usage/">
Usage
</BarDropdownItem>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
<BarItem>
<BarDropdown>
<BarDropdownToggle>Layout</BarDropdownToggle>
<BarDropdownMenu>
<BarDropdownItem Clicked="@(()=>OnLayoutTypeChecked("fixed-header"))">
@if ( LayoutType == "fixed-header" )
{
<Icon Name="IconName.CheckCircle" TextColor="TextColor.Success" />
}
Fixed Header
</BarDropdownItem>
<BarDropdownItem Clicked="@(()=>OnLayoutTypeChecked("fixed-header-footer-only"))">
@if ( LayoutType == "fixed-header-footer-only" )
{
<Icon Name="IconName.CheckCircle" TextColor="TextColor.Success" />
}
Fixed Header and Footer only
</BarDropdownItem>
<BarDropdownItem Clicked="@(()=>OnLayoutTypeChecked("sider-with-header-on-top"))">
@if ( LayoutType == "sider-with-header-on-top" )
{
<Icon Name="IconName.CheckCircle" TextColor="TextColor.Success" />
}
Sider with Header on top
</BarDropdownItem>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
</BarStart>
<BarEnd>
<BarItem>
<BarDropdown RightAligned>
<BarDropdownToggle><Icon Name="IconName.Language" /></BarDropdownToggle>
<BarDropdownMenu>
@foreach ( var cultureInfo in LocalizationService!.AvailableCultures )
{
<BarDropdownItem @key="@cultureInfo.Name" Clicked="@(()=>SelectCulture(cultureInfo.Name))">
@if ( cultureInfo.IsNeutralCulture )
{
@cultureInfo.EnglishName
}
else
{
@cultureInfo.Parent.EnglishName
}
</BarDropdownItem>
}
</BarDropdownMenu>
</BarDropdown>
</BarItem>
<BarItem>
<BarDropdown RightAligned>
<BarDropdownToggle><Icon Name="IconName.Tint" /> Theme</BarDropdownToggle>
<BarDropdownMenu Style="padding: 15px; min-width:550px;">
<Row>
<Column Margin="Margin.Is2.FromBottom">
<Field>
<Switch TValue="bool" Value="@(Theme?.Enabled == true)" ValueChanged="@ThemeEnabledChanged">Theme enabled</Switch>
</Field>
</Column>
</Row>
<Row>
<Column Margin="Margin.Is2.FromBottom">
<Field>
<Check TValue="bool" Value="@(Theme?.IsGradient == true)" ValueChanged="@ThemeGradientChanged">Gradient colors</Check>
</Field>
<Field>
<Check TValue="bool" Value="@(Theme?.IsRounded == true)" ValueChanged="@ThemeRoundedChanged">Rounded elements</Check>
</Field>
</Column>
</Row>
<Row>
<Column>
<Container Fluid>
<ThemeColorSelector Value="@(Theme?.ColorOptions?.Primary)" ValueChanged="@ThemeColorChanged"></ThemeColorSelector>
</Container>
</Column>
</Row>
</BarDropdownMenu>
</BarDropdown>
</BarItem>
<BarItem>
<BarLink To="https://github.com/Megabit/Blazorise">GitHub</BarLink>
</BarItem>
</BarEnd>
</BarMenu>
</Bar>
@code {
protected override async Task OnInitializedAsync()
{
await SelectCulture( "en-US" );
await base.OnInitializedAsync();
}
Task SelectCulture( string name )
{
LocalizationService!.ChangeLanguage( name );
return Task.CompletedTask;
}
private bool topbarVisible = false;
Task OnLayoutTypeChecked( string layoutType )
{
LayoutType = layoutType;
return LayoutTypeChanged.InvokeAsync( layoutType );
}
[Parameter] public EventCallback<bool> ThemeEnabledChanged { get; set; }
[Parameter] public EventCallback<bool> ThemeGradientChanged { get; set; }
[Parameter] public EventCallback<bool> ThemeRoundedChanged { get; set; }
[Parameter] public EventCallback<string> ThemeColorChanged { get; set; }
[Parameter] public string? LayoutType { get; set; }
[Parameter] public EventCallback<string> LayoutTypeChanged { get; set; }
[Inject] protected ITextLocalizerService? LocalizationService { get; set; }
[CascadingParameter] protected Theme? Theme { get; set; }
}
@@ -1,68 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace Visor.Components.TodoApp
{
public abstract class BaseTodoItems : ComponentBase
{
protected Validations? validations;
protected string? description;
protected Filter filter = Filter.All;
protected List<Todo> todos = new()
{
new() { Description = "Buy milk" },
new() { Description = "Call John regarding the meeting" },
new() { Description = "Walk a dog" },
};
protected IEnumerable<Todo> Todos
{
get
{
var query = from t in todos select t;
if (filter == Filter.Active)
query = from q in query where !q.Completed select q;
if (filter == Filter.Completed)
query = from q in query where q.Completed select q;
return query;
}
}
protected void SetFilter(Filter filter)
{
this.filter = filter;
}
protected void OnCheckAll(bool isChecked)
{
todos.ForEach(x => x.Completed = isChecked);
}
protected async Task OnAddTodo()
{
if (await validations!.ValidateAll())
{
todos.Add(new() { Description = description });
description = null;
await validations.ClearAll();
}
}
protected void OnClearCompleted()
{
todos.RemoveAll(x => x.Completed);
filter = Filter.All;
}
protected Task OnTodoStatusChanged(bool isChecked)
{
return InvokeAsync(StateHasChanged);
}
}
}
-9
View File
@@ -1,9 +0,0 @@
namespace Visor.Components.TodoApp
{
public enum Filter
{
All,
Active,
Completed,
}
}
-9
View File
@@ -1,9 +0,0 @@
namespace Visor.Components.TodoApp
{
public class Todo
{
public bool Completed { get; set; }
public string? Description { get; set; }
}
}
@@ -1,25 +0,0 @@
@if (Todo is not null)
{
<ListGroupItem>
<Field Horizontal Padding="Padding.IsAuto.OnAll">
<FieldBody ColumnSize="ColumnSize.Is1">
<Check TValue="bool" Value="@Todo.Completed" ValueChanged="@OnCheckedChanged"></Check>
</FieldBody>
<FieldBody ColumnSize="ColumnSize.Is11">
@Todo.Description
</FieldBody>
</Field>
</ListGroupItem>
}
@code {
Task OnCheckedChanged(bool isChecked)
{
Todo!.Completed = isChecked;
return StatusChanged?.Invoke(isChecked) ?? Task.CompletedTask;
}
[Parameter] public Todo? Todo { get; set; }
[Parameter] public Func<bool, Task>? StatusChanged { get; set; }
}
@@ -1,57 +0,0 @@
@inherits BaseTodoItems
<Container Fluid>
<Row>
<Column>
<Card>
<CardHeader Padding="Padding.Is1.FromBottom">
<CardTitle Size="HeadingSize.Is4">Todo List</CardTitle>
</CardHeader>
<CardBody Padding="Padding.Is0.FromBottom">
<Fields>
<Column ColumnSize="ColumnSize.Is1">
<Check TValue="bool" Value="@Todos.All(x=>x.Completed)" ValueChanged="@OnCheckAll">All</Check>
</Column>
<Column ColumnSize="ColumnSize.Is11">
<Addons>
<Addon AddonType="AddonType.Body">
<Validations @ref="validations" Mode="ValidationMode.Manual">
<Validation Validator="@ValidationRule.IsNotEmpty">
<TextInput @bind-Value="@description" Placeholder="What needs to be done?"></TextInput>
</Validation>
</Validations>
</Addon>
<Addon AddonType="AddonType.End">
<Button Color="Color.Primary" Clicked="@OnAddTodo">
<Icon Name="IconName.Add" />Add
</Button>
</Addon>
</Addons>
</Column>
</Fields>
</CardBody>
<CardBody Padding="Padding.Is0.OnY">
<ListGroup Flush>
@foreach ( var todo in Todos )
{
<TodoItem Todo="@todo" StatusChanged="@OnTodoStatusChanged" />
}
</ListGroup>
</CardBody>
<CardFooter Padding="Padding.Is3.FromBottom">
<Field Horizontal>
<FieldBody ColumnSize="ColumnSize.Is10">
<Buttons Role="ButtonsRole.Addons">
<Button Color="Color.Info" Clicked="@(() => SetFilter( Filter.All ))" Active="@(filter == Filter.All)">All</Button>
<Button Color="Color.Info" Clicked="@(() => SetFilter( Filter.Active ))" Active="@(filter == Filter.Active)">Active</Button>
<Button Color="Color.Info" Clicked="@(() => SetFilter( Filter.Completed ))" Active="@(filter == Filter.Completed)">Completed</Button>
</Buttons>
</FieldBody>
<FieldBody ColumnSize="ColumnSize.Is2">
<Button Color="Color.Warning" Float="Float.End" Clicked="@OnClearCompleted" Display="@(todos.Any(x=>x.Completed) ? Display.Always : Display.None)">Clear Completed</Button>
</FieldBody>
</Field>
</CardFooter>
</Card>
</Column>
</Row>
</Container>
-2
View File
@@ -1,2 +0,0 @@
global using Blazorise;
global using Blazorise.DataGrid;
-18
View File
@@ -1,18 +0,0 @@
@using Visor.Components.Layout
@inherits LayoutComponentBase
<Layout Sider>
<LayoutSider>
<LayoutSiderContent>
<SideMenu />
</LayoutSiderContent>
</LayoutSider>
<Layout>
<LayoutContent Padding="Padding.Is4.OnX.Is4.FromTop">
@Body
</LayoutContent>
</Layout>
</Layout>
-89
View File
@@ -1,89 +0,0 @@
using Blazorise;
using Blazorise.Localization;
using Microsoft.AspNetCore.Components;
namespace Visor.Layouts
{
public partial class MainLayout
{
[Inject] protected ITextLocalizerService? LocalizationService { get; set; }
[CascadingParameter] protected Theme? Theme { get; set; }
protected string layoutType = "fixed-header";
protected override async Task OnInitializedAsync()
{
await SelectCulture("en-US");
await base.OnInitializedAsync();
}
private Task SelectCulture(string name)
{
LocalizationService!.ChangeLanguage(name);
return Task.CompletedTask;
}
Task OnThemeEnabledChanged(bool value)
{
if (Theme is null)
return Task.CompletedTask;
Theme.Enabled = value;
return InvokeAsync(Theme.ThemeHasChanged);
}
Task OnThemeGradientChanged(bool value)
{
if (Theme is null)
return Task.CompletedTask;
Theme.IsGradient = value;
return InvokeAsync(Theme.ThemeHasChanged);
}
Task OnThemeRoundedChanged(bool value)
{
if (Theme is null)
return Task.CompletedTask;
Theme.IsRounded = value;
return InvokeAsync(Theme.ThemeHasChanged);
}
Task OnThemeColorChanged(string value)
{
if (Theme is null)
return Task.CompletedTask;
Theme.ColorOptions ??= new();
Theme.BackgroundOptions ??= new();
Theme.TextColorOptions ??= new();
Theme.ColorOptions.Primary = value;
Theme.BackgroundOptions.Primary = value;
Theme.TextColorOptions.Primary = value;
Theme.InputOptions ??= new();
Theme.InputOptions.CheckColor = value;
Theme.InputOptions.SliderColor = value;
Theme.SpinKitOptions ??= new();
Theme.SpinKitOptions.Color = value;
return InvokeAsync(Theme.ThemeHasChanged);
}
}
}
-38
View File
@@ -1,38 +0,0 @@
namespace Visor.Models
{
public class AllPubData
{
public static List<ObjectItems> ListObjectItems { get; set; } = new();
public static List<DeviceItems> ListDeviceItems { get; set; } = new();
public static List<DeviceTypeItems> ListDeviceTypeItems { get; set; } = new();
public static HttpClient http { get; set; } = new()
{
BaseAddress = new Uri("http://172.22.10.31:5050/")
};
public static Task GetAll() => _GetAllData();
public static Task GetObjects() => _GetObject();
public static Task GetType() => _GetType();
public static Task GetDevice() => _GetDevice();
private static async Task _GetAllData()
{
var o = await _GetObject();
var t = await _GetType();
var d = await _GetDevice();
}
private static async Task<List<ObjectItems>> _GetObject()
{
return ListObjectItems = await http.GetFromJsonAsync<List<ObjectItems>>("api/Object/GetObject");
}
private static async Task<List<DeviceItems>> _GetDevice()
{
return ListDeviceItems = http.GetFromJsonAsync<List<DeviceItems>>("api/Device/GetDevices").Result.Take(100).ToList();
}
private static async Task<List<DeviceTypeItems>> _GetType()
{
return ListDeviceTypeItems = await http.GetFromJsonAsync<List<DeviceTypeItems>>("api/Type/GetTypes");
}
}
}
-27
View File
@@ -1,27 +0,0 @@
namespace Visor.Models
{
public class DeviceItems
{
public Guid Id { get; set; }
public string? Ip { get; set; }
public string? Mac { get; set; }
public string? Description { get; set; }
public string? Name { get; set; }
public string? Location { get; set; }
public List<Guid>? ListDevices { get; set; }
public Guid? DeviceType { get; set; }
public Guid? DeviceObject { get; set; }
public Guid? ConnectedToSwitchId { get; set; }
public int ConnectedToPortOnSwitch { get; set; }
}
//Unknown = 0,
//SwitchCore = 1,
//SwitchAccess = 2,
//Camera = 3,
//Server = 4,
//WorkStation = 5,
//PDU_AVR = 6,
}
-9
View File
@@ -1,9 +0,0 @@
namespace Visor.Models
{
public class DeviceTypeItems
{
public Guid Id { get; set; }
public string Name { get; set; }
public string? Description { get; set; } = null;
}
}
-12
View File
@@ -1,12 +0,0 @@
using System.ComponentModel.DataAnnotations;
namespace Visor.Models
{
public class ObjectItems
{
[Key]
public Guid Id { get; set; }
public string NameObject { get; set; } = "Unknown";
public string DescriptionObject { get; set; } = string.Empty;
}
}
-61
View File
@@ -1,61 +0,0 @@
@page "/"
@using Visor.Models
@inject IVersionProvider VersionProvider
@inject NavigationManager Navigation
<Heading Size="HeadingSize.Is1" Margin="Margin.Is3.FromBottom">ДАШБОРД</Heading>
@if (_list_obj is null)
{
<p>Получаю данные...</p>
}
else
{
<CardDeck>
@foreach (var obj in _list_obj)
{
<Card>
@* <CardImage Source="/img/gallery/2.jpg" Alt="Card image cap 3"></CardImage> *@
<CardBody>
<CardTitle TextAlignment="TextAlignment.Center" Size="HeadingSize.Is3">@obj.NameObject (@obj.DescriptionObject)</CardTitle>
<CardText>
<Divider />
<b>Всего устройств: @_list_dev.Where(d => d.DeviceObject == obj.Id).Count()</b><br />
@foreach (var tp in _list_type)
{
<div> ☞ @tp.Name : @_list_dev.Where(d => d.DeviceObject == obj.Id && d.DeviceType == tp.Id).Count() <br /></div>
}
@* ˫ Коммутаторы: @_list_dev.Where(d => d.DeviceObject == obj.Id && d.DeviceType == _list_type.First(t => t.Name.Contains("Switch")).Id).Count()<br />
˫ Камеры: @_list_dev.Where(d => d.DeviceObject == obj.Id && d.DeviceType == _list_type.First(t => t.Name.Contains("Camera")).Id).Count() *@
</CardText>
<Button Color="Color.Primary" Clicked="@(() => GoToObj(obj.Id))">Перейти к объекту</Button>
</CardBody>
</Card>
}
</CardDeck>
}
@code
{
List<ObjectItems> _list_obj;
List<DeviceItems> _list_dev;
List<DeviceTypeItems> _list_type;
protected override async Task OnInitializedAsync()
{
await AllPubData.GetAll();
_list_obj = AllPubData.ListObjectItems;
_list_type = AllPubData.ListDeviceTypeItems;
_list_dev = AllPubData.ListDeviceItems;
}
void GoToObj(Guid id)
{
Navigation.NavigateTo($"/object/{id}");
}
}

Some files were not shown because too many files have changed in this diff Show More