techgarage-ir.MTWireGuard/UI/Pages/Components/CreateServerForm/CreateServerForm.cshtml
2023-06-28 18:01:39 +03:30

64 lines
3.5 KiB
Text

@using MTWireGuard.Models.Requests
@model CreateServerRequest
<div class="card mb-4">
<div class="card-header">Quick add server</div>
<div class="card-body">
<form asp-page="Servers" asp-page-handler="Create" method="POST">
<div class="mb-3 row">
<label for="WGSName" class="col-sm-3 col-form-label user-select-none">Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="WGSName" name="Name" placeholder="wireguard1" required>
</div>
</div>
<div class="mb-3 row">
<label for="WGSPort" class="col-sm-3 col-form-label user-select-none">Listening Port</label>
<div class="col-sm-9">
<input type="number" class="form-control" id="WGSPort" name="Port" placeholder="13231" min="1" max="65535">
</div>
</div>
<div class="mb-3 row">
<label for="WGSMTU" class="col-sm-3 col-form-label user-select-none">MTU</label>
<div class="col-sm-9">
<input type="number" class="form-control" id="WGSMTU" name="MTU" placeholder="1420" min="64" max="65535">
</div>
</div>
<div class="mb-3 row">
<label for="WGSPrivKey" class="col-sm-3 col-form-label user-select-none">Private Key</label>
<div class="col-sm-9">
<div class="input-group">
<input type="text" class="form-control" id="WGSPrivKey" name="PrivateKey" aria-label="Generate" aria-describedby="SKeygenBTN" autocomplete="off" required>
<button type="button" class="input-group-text" id="SKeygenBTN" style="cursor: pointer;" onclick="generateKeys(this)">
<svg class="icon icon-sm text-dark my-1">
<use xlink:href="vendors/coreui/icons/svg/free.svg#cil-reload"></use>
</svg>
</button>
</div>
</div>
</div>
<div class="mb-3 row">
<label for="WGSPubKey" class="col-sm-3 col-form-label user-select-none">Public Key</label>
<div class="col-sm-9">
<div class="input-group">
<input type="text" class="form-control" id="WGSPubKey" aria-label="Generate" aria-describedby="SUnlockBTN" autocomplete="off" disabled>
<button type="button" class="input-group-text" id="SUnlockBTN" style="cursor: pointer;" onclick="changeIcon(this)">
<svg class="icon icon-sm text-dark my-1">
<use xlink:href="vendors/coreui/icons/svg/free.svg#cil-lock-unlocked"></use>
</svg>
</button>
</div>
</div>
</div>
<div class="mb-5 row">
<label for="WGSEnabled" class="col-sm-3 form-check-label user-select-none">Enabled</label>
<div class="col-sm-9">
<input type="checkbox" class="form-check-input" id="WGSEnabled" asp-for="Enabled" checked>
</div>
</div>
<div class="col-12">
<button class="btn btn-primary" type="submit">Create</button>
<button class="btn btn-danger" type="reset">Clear</button>
</div>
@Html.AntiForgeryToken()
</form>
</div>
</div>