Compare commits
1 Commits
89ffce20da
...
v0.1.11
| Author | SHA1 | Date | |
|---|---|---|---|
| 6354075a5c |
@@ -3,39 +3,10 @@ import urllib.request
|
|||||||
|
|
||||||
url = "http://localhost:5000/monitoring/service-discovery"
|
url = "http://localhost:5000/monitoring/service-discovery"
|
||||||
payload = {
|
payload = {
|
||||||
"Server_id": 2,
|
"ServerId": 1,
|
||||||
"Containers": [
|
"ContainerId": "aaaaaaaaaaaa",
|
||||||
{
|
"Name": "test-Name",
|
||||||
"id": "3e74abf5ce30",
|
"Image": "test-Image"
|
||||||
"image": "hello-world:latest",
|
|
||||||
"name": "serene_nightingale"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "83cd9d461690",
|
|
||||||
"image": "postgres:latest",
|
|
||||||
"name": "distracted_feistel"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "b296c2ed1213",
|
|
||||||
"image": "postgres:latest",
|
|
||||||
"name": "mystifying_jackson"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "69568181d576",
|
|
||||||
"image": "hello-world:latest",
|
|
||||||
"name": "romantic_driscoll"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "67c37a2b1791",
|
|
||||||
"image": "hello-world:latest",
|
|
||||||
"name": "asdf"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "8f39bae1e316",
|
|
||||||
"image": "hello-world:latest",
|
|
||||||
"name": "distracted_mirzakhani"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data = json.dumps(payload).encode("utf-8")
|
data = json.dumps(payload).encode("utf-8")
|
||||||
|
|||||||
117
Tests/test.json
117
Tests/test.json
@@ -1,117 +0,0 @@
|
|||||||
{
|
|
||||||
"server_id": 1,
|
|
||||||
"containers": [
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"cpu": {
|
|
||||||
"cpu_load": 0.0
|
|
||||||
},
|
|
||||||
"network": {
|
|
||||||
"net_in": null,
|
|
||||||
"net_out": null
|
|
||||||
},
|
|
||||||
"ram": {
|
|
||||||
"ram_load": 0.0
|
|
||||||
},
|
|
||||||
"container_id": "aaaaaaaa",
|
|
||||||
"status": {
|
|
||||||
"status": "exited"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -18,38 +18,17 @@ public class ContainerController : Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IActionResult> Overview()
|
public async Task<IActionResult> Overview()
|
||||||
{
|
{
|
||||||
var containers = await _context.Containers.ToListAsync();
|
var containers = await _context.Containers.ToListAsync();
|
||||||
var servers = await _context.Servers.ToListAsync();
|
var servers = await _context.Servers.ToListAsync();
|
||||||
|
|
||||||
var viewModel = new ContainerOverviewViewModel
|
var viewModel = new ContainerOverviewViewModel
|
||||||
{
|
|
||||||
Servers = servers,
|
|
||||||
Containers = containers
|
|
||||||
};
|
|
||||||
|
|
||||||
return View(viewModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IActionResult> RestartContainer(string container_id)
|
|
||||||
{
|
{
|
||||||
//Befehl an Agent schicken??
|
Servers = servers,
|
||||||
|
Containers = containers
|
||||||
throw new NotImplementedException();
|
};
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IActionResult> StopContainer(string container_id)
|
return View(viewModel);
|
||||||
{
|
}
|
||||||
//Befehl an Agent schicken??
|
|
||||||
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IActionResult> UpdateContainer(string container_id)
|
|
||||||
{
|
|
||||||
//Befehl an Agent schicken??
|
|
||||||
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Net;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
||||||
using Microsoft.Data.Sqlite;
|
using Microsoft.Data.Sqlite;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
@@ -82,16 +79,10 @@ public class MetricDto
|
|||||||
public double NET_Out { get; set; } // Bytes/s
|
public double NET_Out { get; set; } // Bytes/s
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DockerServiceDto
|
public class ServiceDto
|
||||||
{
|
{
|
||||||
public required int Server_id { get; set; } // Vom Watcher-Server zugewiesene ID des Hosts
|
public required int Server_id { get; set; } // Vom Watcher-Server zugewiesene ID des Hosts
|
||||||
public required JsonElement Containers { get; set; }
|
public required JsonContent Containers { get; set; }
|
||||||
}
|
|
||||||
|
|
||||||
public class DockerServiceMetricDto
|
|
||||||
{
|
|
||||||
public required int Server_id { get; set; } // Vom Watcher-Server zugewiesene ID des Hosts
|
|
||||||
public required JsonElement Containers { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ApiController]
|
[ApiController]
|
||||||
@@ -232,7 +223,7 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
// Endpoint, an dem Agents Ihre laufenden Services registrieren
|
// Endpoint, an dem Agents Ihre laufenden Services registrieren
|
||||||
[HttpPost("service-discovery")]
|
[HttpPost("service-discovery")]
|
||||||
public async Task<IActionResult> ServiceDetection([FromBody] DockerServiceDto dto)
|
public async Task<IActionResult> ServiceDetection([FromBody] ServiceDto dto)
|
||||||
{
|
{
|
||||||
// Gültigkeit des Payloads prüfen
|
// Gültigkeit des Payloads prüfen
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
@@ -246,9 +237,9 @@ public class MonitoringController : Controller
|
|||||||
return BadRequest(new { error = "Invalid Payload", details = errors });
|
return BadRequest(new { error = "Invalid Payload", details = errors });
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Container> newContainers =
|
// Json zu was brauchbarem machen
|
||||||
JsonSerializer.Deserialize<List<Container>>(dto.Containers.GetRawText())
|
string containersJson = await dto.Containers.ReadAsStringAsync();
|
||||||
?? new List<Container>();
|
List<Container> newContainers = JsonSerializer.Deserialize<List<Container>>(containersJson)?? new List<Container>();;
|
||||||
|
|
||||||
foreach (Container c in newContainers)
|
foreach (Container c in newContainers)
|
||||||
{
|
{
|
||||||
@@ -264,6 +255,9 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Container Objekte erstellen
|
||||||
|
//List<Container> newContainers = ParseServiceDiscoveryInput(dto.Server_id, containers);
|
||||||
|
|
||||||
// Liste aller Container, die bereits der übergebenen ServerId zugewiesen sind
|
// Liste aller Container, die bereits der übergebenen ServerId zugewiesen sind
|
||||||
List<Container> existingContainers = _context.Containers
|
List<Container> existingContainers = _context.Containers
|
||||||
.Where(c => c.ServerId == dto.Server_id)
|
.Where(c => c.ServerId == dto.Server_id)
|
||||||
@@ -316,48 +310,6 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Endpoint, an den der Agent die Metrics der registrierten Container schickt
|
|
||||||
public async Task<IActionResult> ServiceMetrics([FromBody] DockerServiceMetricDto dto)
|
|
||||||
{
|
|
||||||
// Gültigkeit des Payloads prüfen
|
|
||||||
if (!ModelState.IsValid)
|
|
||||||
{
|
|
||||||
var errors = ModelState.Values
|
|
||||||
.SelectMany(v => v.Errors)
|
|
||||||
.Select(e => e.ErrorMessage)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
_logger.LogError("Invalid ServiceDetection-Payload.");
|
|
||||||
return BadRequest(new { error = "Invalid Payload", details = errors });
|
|
||||||
}
|
|
||||||
|
|
||||||
// Liste der eingegangenen Metric
|
|
||||||
List<ContainerMetric> metrics = new List<ContainerMetric>();
|
|
||||||
|
|
||||||
// Json Parser -> Metric Objekt erstellen
|
|
||||||
|
|
||||||
|
|
||||||
// Metrics in die Datenbank eintragen
|
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (ContainerMetric cm in metrics)
|
|
||||||
{
|
|
||||||
_context.ContainerMetrics.Add(cm);
|
|
||||||
await _context.SaveChangesAsync();
|
|
||||||
_logger.LogInformation(cm.ContainerId + " Metric received");
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (SqliteException e)
|
|
||||||
{
|
|
||||||
_logger.LogError(e.Message);
|
|
||||||
return StatusCode(500);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Durchschnittliche Werte Berechnen
|
// Durchschnittliche Werte Berechnen
|
||||||
public async Task<IActionResult> CalculateMedian(string Metric, int HoursToMonitor, int ServerId)
|
public async Task<IActionResult> CalculateMedian(string Metric, int HoursToMonitor, int ServerId)
|
||||||
{
|
{
|
||||||
@@ -463,7 +415,7 @@ public class MonitoringController : Controller
|
|||||||
List<Container> containerList = new List<Container>();
|
List<Container> containerList = new List<Container>();
|
||||||
|
|
||||||
// JSON-Objekt auslesen und Container-Objekte erstellen
|
// JSON-Objekt auslesen und Container-Objekte erstellen
|
||||||
|
|
||||||
|
|
||||||
return containerList;
|
return containerList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ public class AppDbContext : DbContext
|
|||||||
|
|
||||||
public DbSet<Tag> Tags { get; set; }
|
public DbSet<Tag> Tags { get; set; }
|
||||||
|
|
||||||
public DbSet<ContainerMetric> ContainerMetrics { get; set; }
|
|
||||||
|
|
||||||
public DbSet<User> Users { get; set; }
|
public DbSet<User> Users { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
|
|||||||
@@ -1,355 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Watcher.Data;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20251029105954_container-changed")]
|
|
||||||
partial class containerchanged
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.6");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("ContainerId")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Image")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int?>("ImageId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsRunning")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ImageId");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Tag")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Images");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("ContainerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Level")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Message")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ContainerId");
|
|
||||||
|
|
||||||
b.HasIndex("ServerId");
|
|
||||||
|
|
||||||
b.ToTable("LogEvents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Metric", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_In")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_Out")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Metrics");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int>("CpuCores")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("CpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("DiskSpace")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("GpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IPAddress")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsOnline")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsVerified")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastSeen")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RamSize")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Type")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Servers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Tags");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IdentityProvider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastLogin")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("OIDC_Id")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Username")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Image", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("ImageId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Container", "Container")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ContainerId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Server", "Server")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ServerId");
|
|
||||||
|
|
||||||
b.Navigation("Container");
|
|
||||||
|
|
||||||
b.Navigation("Server");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Servers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
|
|
||||||
b.Navigation("Servers");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class containerchanged : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,355 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Watcher.Data;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20251029125404_ContainerMetrics-Added")]
|
|
||||||
partial class ContainerMetricsAdded
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.6");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("ContainerId")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Image")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int?>("ImageId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsRunning")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ImageId");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Tag")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Images");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("ContainerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Level")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Message")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ContainerId");
|
|
||||||
|
|
||||||
b.HasIndex("ServerId");
|
|
||||||
|
|
||||||
b.ToTable("LogEvents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Metric", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_In")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_Out")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Metrics");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int>("CpuCores")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("CpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("DiskSpace")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("GpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IPAddress")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsOnline")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsVerified")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastSeen")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RamSize")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Type")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Servers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Tags");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IdentityProvider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastLogin")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("OIDC_Id")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Username")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Image", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("ImageId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Container", "Container")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ContainerId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Server", "Server")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ServerId");
|
|
||||||
|
|
||||||
b.Navigation("Container");
|
|
||||||
|
|
||||||
b.Navigation("Server");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Servers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
|
|
||||||
b.Navigation("Servers");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class ContainerMetricsAdded : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,397 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Watcher.Data;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(AppDbContext))]
|
|
||||||
[Migration("20251030093420_ContainerMetricChange")]
|
|
||||||
partial class ContainerMetricChange
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder.HasAnnotation("ProductVersion", "8.0.6");
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("ContainerId")
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
|
||||||
|
|
||||||
b.Property<string>("Image")
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "image");
|
|
||||||
|
|
||||||
b.Property<int?>("ImageId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsRunning")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "name");
|
|
||||||
|
|
||||||
b.Property<int>("ServerId")
|
|
||||||
.HasColumnType("INTEGER")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "Server_id");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ImageId");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.ContainerMetric", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "cpu_load");
|
|
||||||
|
|
||||||
b.Property<int?>("ContainerId")
|
|
||||||
.HasColumnType("INTEGER")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "container_id");
|
|
||||||
|
|
||||||
b.Property<double>("NET_in")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "net_in");
|
|
||||||
|
|
||||||
b.Property<double>("NET_out")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "net_out");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "ram_load");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "server_id");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("ContainerMetrics");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Tag")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Images");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<int?>("ContainerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Level")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Message")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("ContainerId");
|
|
||||||
|
|
||||||
b.HasIndex("ServerId");
|
|
||||||
|
|
||||||
b.ToTable("LogEvents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Metric", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Vram_Usage")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_In")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("NET_Out")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Size")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Metrics");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int>("CpuCores")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("CpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("CreatedAt")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("DISK_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("DiskSpace")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("Disk_Usage_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("GPU_Temp_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<string>("GpuType")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IPAddress")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<bool>("IsOnline")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<bool>("IsVerified")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastSeen")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Critical")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load_Warning")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<double>("RamSize")
|
|
||||||
.HasColumnType("REAL");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Type")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("TagId");
|
|
||||||
|
|
||||||
b.ToTable("Servers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Tags");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("IdentityProvider")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<DateTime>("LastLogin")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("OIDC_Id")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.Property<string>("Username")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("Users");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Container", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Image", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("ImageId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Containers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.LogEvent", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Container", "Container")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ContainerId");
|
|
||||||
|
|
||||||
b.HasOne("Watcher.Models.Server", "Server")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ServerId");
|
|
||||||
|
|
||||||
b.Navigation("Container");
|
|
||||||
|
|
||||||
b.Navigation("Server");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Server", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("Watcher.Models.Tag", null)
|
|
||||||
.WithMany("Servers")
|
|
||||||
.HasForeignKey("TagId");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Tag", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Containers");
|
|
||||||
|
|
||||||
b.Navigation("Servers");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace Watcher.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class ContainerMetricChange : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "ContainerMetrics",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
|
||||||
.Annotation("Sqlite:Autoincrement", true),
|
|
||||||
Timestamp = table.Column<DateTime>(type: "TEXT", nullable: false),
|
|
||||||
ContainerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
||||||
ServerId = table.Column<int>(type: "INTEGER", nullable: true),
|
|
||||||
CPU_Load = table.Column<double>(type: "REAL", nullable: false),
|
|
||||||
RAM_Load = table.Column<double>(type: "REAL", nullable: false),
|
|
||||||
NET_in = table.Column<double>(type: "REAL", nullable: false),
|
|
||||||
NET_out = table.Column<double>(type: "REAL", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_ContainerMetrics", x => x.Id);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "ContainerMetrics");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,12 +24,10 @@ namespace Watcher.Migrations
|
|||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<string>("ContainerId")
|
b.Property<string>("ContainerId")
|
||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT");
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "id");
|
|
||||||
|
|
||||||
b.Property<string>("Image")
|
b.Property<string>("Image")
|
||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT");
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "image");
|
|
||||||
|
|
||||||
b.Property<int?>("ImageId")
|
b.Property<int?>("ImageId")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
@@ -38,12 +36,10 @@ namespace Watcher.Migrations
|
|||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.HasColumnType("TEXT")
|
.HasColumnType("TEXT");
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "name");
|
|
||||||
|
|
||||||
b.Property<int>("ServerId")
|
b.Property<int>("ServerId")
|
||||||
.HasColumnType("INTEGER")
|
.HasColumnType("INTEGER");
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "Server_id");
|
|
||||||
|
|
||||||
b.Property<int?>("TagId")
|
b.Property<int?>("TagId")
|
||||||
.HasColumnType("INTEGER");
|
.HasColumnType("INTEGER");
|
||||||
@@ -57,44 +53,6 @@ namespace Watcher.Migrations
|
|||||||
b.ToTable("Containers");
|
b.ToTable("Containers");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.ContainerMetric", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER");
|
|
||||||
|
|
||||||
b.Property<double>("CPU_Load")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "cpu_load");
|
|
||||||
|
|
||||||
b.Property<int?>("ContainerId")
|
|
||||||
.HasColumnType("INTEGER")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "container_id");
|
|
||||||
|
|
||||||
b.Property<double>("NET_in")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "net_in");
|
|
||||||
|
|
||||||
b.Property<double>("NET_out")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "net_out");
|
|
||||||
|
|
||||||
b.Property<double>("RAM_Load")
|
|
||||||
.HasColumnType("REAL")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "ram_load");
|
|
||||||
|
|
||||||
b.Property<int?>("ServerId")
|
|
||||||
.HasColumnType("INTEGER")
|
|
||||||
.HasAnnotation("Relational:JsonPropertyName", "server_id");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Timestamp")
|
|
||||||
.HasColumnType("TEXT");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("ContainerMetrics");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("Watcher.Models.Image", b =>
|
modelBuilder.Entity("Watcher.Models.Image", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
|
|||||||
@@ -1,23 +1,14 @@
|
|||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Watcher.Models;
|
namespace Watcher.Models;
|
||||||
|
|
||||||
public class Container
|
public class Container
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
[JsonPropertyName("Server_id")]
|
|
||||||
public int ServerId { get; set; }
|
public int ServerId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("id")]
|
|
||||||
public String? ContainerId { get; set; }
|
public String? ContainerId { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("image")]
|
|
||||||
public String? Image { get; set; }
|
public String? Image { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("name")]
|
|
||||||
public String? Name { get; set; }
|
public String? Name { get; set; }
|
||||||
|
|
||||||
// keine Variable, die vom Agent übergeben wird. Ein container ist immer Running, die Variable dient nur für die Übersicht
|
|
||||||
// auf dem Dashboard.
|
|
||||||
public Boolean IsRunning { get; set; } = true;
|
public Boolean IsRunning { get; set; } = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace Watcher.Models;
|
|
||||||
|
|
||||||
public class ContainerMetric
|
|
||||||
{
|
|
||||||
// Metric Metadata
|
|
||||||
public int Id { get; set; }
|
|
||||||
public DateTime Timestamp { get; set; }
|
|
||||||
|
|
||||||
// allgemeine Conainer Informationen
|
|
||||||
[JsonPropertyName("container_id")]
|
|
||||||
public int? ContainerId { get; set; }
|
|
||||||
|
|
||||||
[JsonPropertyName("server_id")]
|
|
||||||
public int? ServerId { get; set; }
|
|
||||||
|
|
||||||
// CPU-Daten
|
|
||||||
[JsonPropertyName("cpu_load")]
|
|
||||||
public double CPU_Load { get; set; } = 0.0; // %
|
|
||||||
|
|
||||||
// RAM-Daten
|
|
||||||
[JsonPropertyName("ram_load")]
|
|
||||||
public double RAM_Load { get; set; } = 0.0; // %
|
|
||||||
|
|
||||||
// Network-Daten
|
|
||||||
[JsonPropertyName("net_in")]
|
|
||||||
public double NET_in { get; set; } = 0.0; // Bit
|
|
||||||
|
|
||||||
[JsonPropertyName("net_out")]
|
|
||||||
public double NET_out { get; set; } = 0.0; // Bit
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -12,31 +12,20 @@
|
|||||||
<div >
|
<div >
|
||||||
<table class="ServiceList">
|
<table class="ServiceList">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Container-ID</th>
|
<th>Service</th>
|
||||||
<th>Name</th>
|
<th>HostServer</th>
|
||||||
<th>Image</th>
|
<th>Status</th>
|
||||||
<th>Host-ID</th>
|
<th>Deployment</th>
|
||||||
<th>Aktionen</th>
|
<th></th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
@foreach (Container container in Model.Containers)
|
@foreach (Container container in Model.Containers)
|
||||||
{
|
{
|
||||||
<tr class="ServiceRow">
|
<tr class="ServiceRow">
|
||||||
<td>@container.ContainerId</td>
|
|
||||||
<td>@container.Name</td>
|
<td>@container.Name</td>
|
||||||
<td>@container.Image</td>
|
<td><a class="ServiceEntry" href="/Server/Details/${containerId}">@container.ServerId</a></td>
|
||||||
<td><a class="ServiceEntry" href="/Server/Details/@container.ServerId">@container.ServerId</a></td>
|
<td>nicht automatisiert</td>
|
||||||
<td>
|
<td>Docker</td>
|
||||||
<a asp-action="#" asp-route-id="#" class="btn btn-outline-primary">
|
|
||||||
<i class="bi bi-pencil-square me-1"></i> Neustart
|
|
||||||
</a>
|
|
||||||
<a asp-action="#" asp-route-id="#" class="btn btn-outline-primary">
|
|
||||||
<i class="bi bi-pencil-square me-1"></i> Stop
|
|
||||||
</a>
|
|
||||||
<a asp-action="#" asp-route-id="#" class="btn btn-outline-primary">
|
|
||||||
<i class="bi bi-pencil-square me-1"></i> Update
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user