mirror of
https://github.com/syssecfsu/witty.git
synced 2024-12-24 11:42:34 +01:00
replay UI is almost done
This commit is contained in:
parent
7a65c02495
commit
c144151c42
@ -1,7 +1,7 @@
|
|||||||
#terminal {
|
#terminal {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin: 10px 0 20px;
|
margin: 10px 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#terminal #terminal_view {
|
#terminal #terminal_view {
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
btn.innerHTML = btn.value
|
btn.innerHTML = btn.value
|
||||||
fetch("/record/{{.id}}")
|
fetch("/record/{{.id}}")
|
||||||
} else {
|
} else {
|
||||||
btn.value = "Record";
|
btn.value = "Record";
|
||||||
btn.innerHTML = btn.value
|
btn.innerHTML = btn.value
|
||||||
fetch("/stop/{{.id}}")
|
fetch("/stop/{{.id}}")
|
||||||
}
|
}
|
||||||
@ -58,12 +58,12 @@
|
|||||||
// print something to test output and scroll
|
// print something to test output and scroll
|
||||||
var str = [
|
var str = [
|
||||||
' ┌────────────────────────────────────────────────────────────────────────────┐\n',
|
' ┌────────────────────────────────────────────────────────────────────────────┐\n',
|
||||||
' │ Powered by \u001b[32;1mGo, Gin, websocket, pty, and xterm.js\x1b[0m │\n',
|
' │ \u001b[32;1mhttps://github.com/syssecfsu/witty\x1b[0m <- click it! │\n',
|
||||||
' └────────────────────────────────────────────────────────────────────────────┘\n',
|
' └────────────────────────────────────────────────────────────────────────────┘\n',
|
||||||
''
|
''
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
term.writeln(str);
|
term.writeln (str)
|
||||||
}
|
}
|
||||||
|
|
||||||
Init()
|
Init()
|
||||||
|
7
main.go
7
main.go
@ -131,6 +131,13 @@ func main() {
|
|||||||
term_conn.StopRecord(id)
|
term_conn.StopRecord(id)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// create a viewer of an interactive session
|
||||||
|
rt.GET("/replay/*id", func(c *gin.Context) {
|
||||||
|
id := c.Param("id")
|
||||||
|
log.Println("replay/ called with", id)
|
||||||
|
c.HTML(http.StatusOK, "replay.html", nil)
|
||||||
|
})
|
||||||
|
|
||||||
// handle static files
|
// handle static files
|
||||||
rt.Static("/assets", "./assets")
|
rt.Static("/assets", "./assets")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user