Skip to content

Commit 91a76e7

Browse files
committed
fix: autofit resolution if restarting container
1 parent b8f8d21 commit 91a76e7

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

image/etc/nginx/sites-enabled/default

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ server {
1313
try_files $uri @proxy2;
1414
}
1515

16+
location ~ ^/api {
17+
try_files $uri @proxy2;
18+
}
19+
1620
location = /redirect.html {
1721
try_files $uri @proxy2;
1822
}

image/usr/lib/noVNC/app/jquery-3.3.1.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

image/usr/lib/noVNC/vnc.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@ <h1 class="noVNC_logo" translate="no"><span>no</span><br />VNC</h1>
325325
<script src="core/util.js"></script>
326326
<script src="app/webutil.js"></script>
327327
<script src="app/ui.js"></script>
328+
<script src="app/jquery-3.3.1.min.js"></script>
329+
<script>
330+
$.getJSON("api/status", function(data) {
331+
console.log(data);
332+
if (data["default_resolution"]) {
333+
window.location.href = "/";
334+
}
335+
});
336+
</script>
328337
<!-- end scripts -->
329338

330339
</body>

image/usr/lib/web/lightop/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ def index():
9191
return HTML_INDEX
9292

9393

94+
@app.route('/api/status')
95+
def status():
96+
global FIRST
97+
return json.dumps({
98+
'default_resolution': FIRST
99+
})
100+
101+
94102
@app.route('/redirect.html')
95103
def redirectme():
96104
global FIRST

0 commit comments

Comments
 (0)