witty/assets/index.html

115 lines
4.4 KiB
HTML
Raw Normal View History

2022-01-04 21:41:41 +01:00
<!doctype html>
2022-01-11 16:08:32 +01:00
<html lang="en">
2022-01-04 21:41:41 +01:00
<head>
2022-01-11 16:08:32 +01:00
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
2022-01-04 21:41:41 +01:00
<!-- automatically refresh the page every 30 seconds -->
2022-01-16 22:46:01 +01:00
<!-- <meta http-equiv="refresh" content="30"> -->
2022-01-11 16:08:32 +01:00
<title>Web Terminal</title>
2022-01-04 21:41:41 +01:00
2022-01-11 16:08:32 +01:00
<!-- Bootstrap core CSS -->
2022-01-16 22:46:01 +01:00
<script src="/assets/external/bootstrap.min.js"></script>
2022-01-11 21:22:24 +01:00
<link href="/assets/external/bootstrap.min.css" rel="stylesheet">
<link href="/assets/main.css" rel="stylesheet">
2022-01-16 22:47:47 +01:00
</head>
2022-01-17 01:20:38 +01:00
2022-01-04 21:41:41 +01:00
<body>
2022-01-11 17:23:21 +01:00
<header>
2022-01-11 21:22:24 +01:00
<nav class="navbar navbar-dark bg-dark shadow-sm navbar-xs">
2022-01-11 17:23:21 +01:00
<div class="container-fluid">
2022-01-13 23:58:41 +01:00
<a class="navbar-brand mx-auto" href="https://github.com/syssecfsu/witty" target="_blank">
2022-01-16 22:46:01 +01:00
<img src="/assets/logo.svg" style="margin-right: 0.5rem;" height="32" class="d-inline-block align-text-top">
2022-01-12 03:47:27 +01:00
WiTTY: Web-based interactive TTY
2022-01-12 18:57:45 +01:00
</a>
<a class="btn btn-primary btn-sm float-end" href="/new"
2022-01-16 22:46:01 +01:00
onClick="setTimeout(function(){window.location.reload()}, 2000);" target="_blank" role="button">
2022-01-12 18:57:45 +01:00
New Session
</a>
2022-01-11 16:08:32 +01:00
</div>
</nav>
</header>
<main>
2022-01-16 22:46:01 +01:00
<div class="container-fluid" style="margin-top:1em;">
<nav>
<div class="nav nav-tabs" id="nav-tab" role="tablist">
<button class="nav-link border bg-light" id="nav-home-tab" data-bs-toggle="tab" data-bs-target="#nav-home"
type="button" role="tab" aria-controls="nav-home" aria-selected="true">Live</button>
<button class="nav-link border active bg-light" id="nav-profile-tab" data-bs-toggle="tab"
data-bs-target="#nav-profile" type="button" role="tab" aria-controls="nav-profile"
aria-selected="false">Saved</button>
</div>
</nav>
<div class="tab-content bg-light" id="nav-tabContent">
<div class="tab-pane fade" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
<div class="card-deck row justify-content-center">
<!-- repeat this for each interactive session -->
{{range .players}}
<div class="card shadow-sm border-danger bg-white mb-3" style="width: 16rem; margin:1em;">
<div class="card-body">
<h5 class="card-title">Interactive session</h5>
<p class="card-text">From <em>{{.Ip}}</em>, running <strong>{{.Cmd}}</strong>, session ID:
<u>{{.Id}}</u>
</p>
<a class="btn btn-outline-success btn-sm float-end" href="/view/{{.Id}}" target="_blank"
role="button">View
Session</a>
</div>
</div>
{{end}}
2022-01-11 16:08:32 +01:00
</div>
</div>
2022-01-11 17:23:21 +01:00
2022-01-16 22:46:01 +01:00
<div class="tab-pane fade show active" id="nav-profile" role="tabpanel" aria-labelledby="nav-profile-tab">
<div class="card-deck row justify-content-center">
<!-- repeat this for each recorded session -->
{{range .records}}
<div class="card shadow-sm border-info bg-light mb-3" style="width: 16rem; margin:1em;">
<div class="card-body">
<h5 class="card-title">Recorded session</h5>
2022-01-17 01:20:38 +01:00
<p class="card-text">File name: <u>{{.Fname}}</u>, file size: <em>{{.Fsize}}KB</em>,
2022-01-16 22:46:01 +01:00
recorded at <strong>{{.Time}}</strong>, duration: <mark>{{.Duration}}s</mark>,
</p>
<div class="btn-toolbar float-end" role="toolbar" aria-label="records buttons">
<a class="btn btn-outline-success btn-sm m-1" href="/replay/{{.Fname}}" target="_blank" role="button">
<img src="/assets/play.svg" height="18px">
</a>
<a class="btn btn-outline-success btn-sm m-1" href="/records/{{.Fname}}" role="button" download>
<img src="/assets/download.svg" height="18px">
</a>
<button type="button" class="btn btn-outline-success btn-sm m-1" onclick="del_btn({{.Fname}})">
<img src="/assets/delete.svg" height="18px">
</button>
</div>
</div>
</div>
{{end}}
</div>
</div>
2022-01-11 16:08:32 +01:00
</div>
</div>
</main>
2022-01-16 22:46:01 +01:00
<script>
function del_btn(path) {
fetch("/delete/" + path)
setTimeout(function () {
window.location.reload()
}, 800);
}
</script>
2022-01-04 21:41:41 +01:00
</body>
</html>