mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-24 07:06:20 -07:00
Close socket from client on exit
This commit is contained in:
parent
3972bc1c1a
commit
0e0e83688c
1 changed files with 12 additions and 11 deletions
|
@ -13,12 +13,24 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
const socket = io.connect();
|
||||||
|
socket.on('preview', function(msg) {
|
||||||
|
console.log(msg);
|
||||||
|
$('img#preview').attr("src", "{{ url_for('preview_image') }}?q=" + new Date().getTime());
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on('loss', function(loss_string) {
|
||||||
|
console.log(loss_string);
|
||||||
|
$('div#loss').html(loss_string);
|
||||||
|
});
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
$.post("{{ url_for('save') }}");
|
$.post("{{ url_for('save') }}");
|
||||||
}
|
}
|
||||||
|
|
||||||
function exit() {
|
function exit() {
|
||||||
$.post("{{ url_for('exit') }}");
|
$.post("{{ url_for('exit') }}");
|
||||||
|
socket.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
|
@ -63,17 +75,6 @@
|
||||||
$('button#zoom_next').click(zoom_next);
|
$('button#zoom_next').click(zoom_next);
|
||||||
|
|
||||||
$('img#preview').click(update);
|
$('img#preview').click(update);
|
||||||
|
|
||||||
const socket = io.connect();
|
|
||||||
socket.on('preview', function(msg) {
|
|
||||||
console.log(msg);
|
|
||||||
$('img#preview').attr("src", "{{ url_for('preview_image') }}?q=" + new Date().getTime());
|
|
||||||
});
|
|
||||||
|
|
||||||
socket.on('loss', function(loss_string) {
|
|
||||||
console.log(loss_string);
|
|
||||||
$('div#loss').html(loss_string);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue