mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-24 19:52:56 +03:00
작업중 커밋
This commit is contained in:
parent
4be3a65691
commit
a3376d1974
10 changed files with 251 additions and 18 deletions
|
@ -128,6 +128,15 @@
|
|||
</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/wake_on_lan_hosts" class="nav-link {{if eq .baseData.Active "wake_on_lan_hosts" }}active{{end}}">
|
||||
<i class="nav-icon fas fa-solid fa-power-off"></i>
|
||||
|
||||
<p>
|
||||
Wake On Lan Hosts
|
||||
</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- /.sidebar-menu -->
|
||||
|
|
130
templates/wake_on_lan_hosts.html
Normal file
130
templates/wake_on_lan_hosts.html
Normal file
|
@ -0,0 +1,130 @@
|
|||
{{define "title"}}
|
||||
Wake On Lan Hosts
|
||||
{{end}}
|
||||
|
||||
{{define "top_css"}}
|
||||
{{end}}
|
||||
|
||||
{{define "username"}}
|
||||
{{ .username }}
|
||||
{{end}}
|
||||
|
||||
{{define "page_title"}}
|
||||
Wake On Lan Hosts
|
||||
{{end}}
|
||||
|
||||
{{define "page_content"}}
|
||||
<script>
|
||||
// https://jqueryvalidation.org/
|
||||
$(document).ready(function () {
|
||||
let $modal = $("#modal_new_wake_on_lan_host");
|
||||
|
||||
$modal.on('shown.bs.modal', function (e) {
|
||||
$("#client_name").val("");
|
||||
$("#client_email").val("");
|
||||
|
||||
});
|
||||
|
||||
$("#frm_new_client").validate({
|
||||
submitHandler: function() {
|
||||
|
||||
},
|
||||
rules: {
|
||||
client_name: {
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
messages: {
|
||||
client_name: {
|
||||
required: "Please enter a name"
|
||||
},
|
||||
},
|
||||
errorElement: 'span',
|
||||
errorPlacement: function (error, element) {
|
||||
error.addClass('invalid-feedback');
|
||||
element.closest('.form-group').append(error);
|
||||
},
|
||||
highlight: function (element, errorClass, validClass) {
|
||||
$(element).addClass('is-invalid');
|
||||
},
|
||||
unhighlight: function (element, errorClass, validClass) {
|
||||
$(element).removeClass('is-invalid');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<div class="modal fade" id="modal_new_wake_on_lan_host">
|
||||
<!-- MacAddress string `json:"MacAddress"`-->
|
||||
<!-- Name string `json:"Name"`-->
|
||||
<!-- LatestIPAddress string `json:"LatestIPAddress"`-->
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">New Wake On Lan Host</h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form name="frm_new_client" id="frm_new_client">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label for="modal_new_wake_on_lan_host_name" class="control-label">Name</label>
|
||||
<input type="text" class="form-control" id="modal_new_wake_on_lan_host_name" name="name">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="modal_new_wake_on_lan_host_name_mac_address" class="control-label">Mac Address</label>
|
||||
<input type="text" class="form-control" id="modal_new_wake_on_lan_host_name_mac_address" name="mac_address">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="content">
|
||||
<div class="container-fluid">
|
||||
{{ if .error }}
|
||||
<div class="alert alert-warning" role="alert">{{.error}}</div>
|
||||
{{ end}}
|
||||
<button style="margin-left: 0.5em;" type="button" class="btn btn-outline-primary btn-sm" data-toggle="modal"
|
||||
data-target="#modal_new_wake_on_lan_host"><i class="nav-icon fas fa-plus"></i> New
|
||||
Client</button>
|
||||
|
||||
|
||||
{{ range $hosts := .devices }}
|
||||
|
||||
<table class="table table-sm">
|
||||
<caption>List Devices </caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Host Name</th>
|
||||
<th scope="col">MAC Address</th>
|
||||
<th scope="col">Latest Ip Address</th>
|
||||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $idx, $host := $hosts }}
|
||||
<tr {{ if $host.Connected }} class="table-success" {{ end }}>
|
||||
<th scope="row">{{ $idx }}</th>
|
||||
<td>{{ $host.Name }}</td>
|
||||
<td>{{ $host.MacAddress }}</td>
|
||||
<td>{{ $host.LatestIPAddress }}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
{{define "bottom_js"}}
|
||||
{{end}}
|
Loading…
Add table
Add a link
Reference in a new issue