@model Watcher.ViewModels.EditServerViewModel

@{
    ViewData["Title"] = "Server bearbeiten";
}

<head>
    <link rel="stylesheet" href="~/css/main.css" />
    <link rel="stylesheet" href="~/css/server-edit.css" />
</head>

<h2 class="mb-4">Server bearbeiten</h2>

<form asp-action="EditServer" asp-controller="Server" method="post">
    @Html.AntiForgeryToken()
    <input type="hidden" asp-for="Id" />

    <div class="card mb-4 g-4">
        <div class="card-header">
            <h4 class="mb-0">Allgemeine Informationen</h4>
        </div>
        <div class="card-body">
            <div class="mb-3">
                <label asp-for="Name" class="form-label">Name</label>
                <input asp-for="Name" class="form-control" />
                <span asp-validation-for="Name" class="text-danger"></span>
            </div>

            <div class="mb-3">
                <label asp-for="IPAddress" class="form-label">IP-Adresse</label>
                <input asp-for="IPAddress" class="form-control" />
                <span asp-validation-for="IPAddress" class="text-danger"></span>
            </div>

            <div class="mb-4">
                <label asp-for="Type" class="form-label">Typ</label>
                <select asp-for="Type" class="form-select">
                    <option>VPS</option>
                    <option>VM</option>
                    <option>Standalone</option>
                </select>
            </div>
        </div>
    </div>

    <div class="card mb-4">
        <div class="card-header">
            <h4 class="mb-0">Grenzwerte festlegen</h4>
        </div>
        <div class="card-body">

            <fieldset class="mb-4">
                <legend class="h5 mb-3">CPU-Grenzwerte</legend>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="CPU_Load_Warning" class="form-label"><i class="bi bi-graph-up me-1"></i>Warnung bei Auslastung (%)</label>
                            <input asp-for="CPU_Load_Warning" class="form-control" placeholder="z.B. 80" />
                            <span asp-validation-for="CPU_Load_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="CPU_Load_Critical" class="form-label"><i class="bi bi-graph-up me-1"></i>Kritische Auslastung (%)</label>
                            <input asp-for="CPU_Load_Critical" class="form-control" placeholder="z.B. 95" />
                            <span asp-validation-for="CPU_Load_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="CPU_Temp_Warning" class="form-label"><i class="bi bi-thermometer-half me-1"></i>Warnung bei Temperatur (°C)</label>
                            <input asp-for="CPU_Temp_Warning" class="form-control" placeholder="z.B. 75" />
                            <span asp-validation-for="CPU_Temp_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="CPU_Temp_Critical" class="form-label"><i class="bi bi-thermometer-high me-1"></i>Kritische Temperatur (°C)</label>
                            <input asp-for="CPU_Temp_Critical" class="form-control" placeholder="z.B. 90" />
                            <span asp-validation-for="CPU_Temp_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
            </fieldset>

            <fieldset class="mb-4">
                <legend class="h5 mb-3">RAM-Grenzwerte</legend>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="RAM_Load_Warning" class="form-label"><i class="bi bi-graph-up me-1"></i>Warnung bei Auslastung (%)</label>
                            <input asp-for="RAM_Load_Warning" class="form-control" placeholder="z.B. 85" />
                            <span asp-validation-for="RAM_Load_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="RAM_Load_Critical" class="form-label"><i class="bi bi-graph-up me-1"></i>Kritische Auslastung (%)</label>
                            <input asp-for="RAM_Load_Critical" class="form-control" placeholder="z.B. 98" />
                            <span asp-validation-for="RAM_Load_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
            </fieldset>

            <fieldset class="mb-4">
                <legend class="h5 mb-3">Festplatten-Grenzwerte</legend>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="Disk_Usage_Warning" class="form-label"><i class="bi bi-disc-fill me-1"></i>Warnung bei Auslastung (%)</label>
                            <input asp-for="Disk_Usage_Warning" class="form-control" placeholder="z.B. 90" />
                            <span asp-validation-for="Disk_Usage_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="Disk_Usage_Critical" class="form-label"><i class="bi bi-disc-fill me-1"></i>Kritische Auslastung (%)</label>
                            <input asp-for="Disk_Usage_Critical" class="form-control" placeholder="z.B. 98" />
                            <span asp-validation-for="Disk_Usage_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="DISK_Temp_Warning" class="form-label"><i class="bi bi-thermometer-half me-1"></i>Warnung bei Temperatur (°C)</label>
                            <input asp-for="DISK_Temp_Warning" class="form-control" placeholder="z.B. 45" />
                            <span asp-validation-for="DISK_Temp_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="DISK_Temp_Critical" class="form-label"><i class="bi bi-thermometer-high me-1"></i>Kritische Temperatur (°C)</label>
                            <input asp-for="DISK_Temp_Critical" class="form-control" placeholder="z.B. 55" />
                            <span asp-validation-for="DISK_Temp_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
            </fieldset>

            <fieldset class="mb-4">
                <legend class="h5 mb-3">GPU-Grenzwerte</legend>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="GPU_Load_Warning" class="form-label"><i class="bi bi-graph-up me-1"></i>Warnung bei Auslastung (%)</label>
                            <input asp-for="GPU_Load_Warning" class="form-control" placeholder="z.B. 80" />
                            <span asp-validation-for="GPU_Load_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="GPU_Load_Critical" class="form-label"><i class="bi bi-graph-up me-1"></i>Kritische Auslastung (%)</label>
                            <input asp-for="GPU_Load_Critical" class="form-control" placeholder="z.B. 95" />
                            <span asp-validation-for="GPU_Load_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="GPU_Temp_Warning" class="form-label"><i class="bi bi-thermometer-half me-1"></i>Warnung bei Temperatur (°C)</label>
                            <input asp-for="GPU_Temp_Warning" class="form-control" placeholder="z.B. 70" />
                            <span asp-validation-for="GPU_Temp_Warning" class="text-danger small"></span>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="mb-3">
                            <label asp-for="GPU_Temp_Critical" class="form-label"><i class="bi bi-thermometer-high me-1"></i>Kritische Temperatur (°C)</label>
                            <input asp-for="GPU_Temp_Critical" class="form-control" placeholder="z.B. 85" />
                            <span asp-validation-for="GPU_Temp_Critical" class="text-danger small"></span>
                        </div>
                    </div>
                </div>
            </fieldset>
        </div>
    </div>

    <div class="d-flex justify-content-end gap-2">
        <button type="submit" class="btn btn-primary"><i class="bi bi-save me-1"></i>Speichern</button>
        <a asp-action="Overview" class="btn btn-danger"><i class="bi bi-x-circle me-1"></i>Abbrechen</a>
    </div>
</form>