Skip to content

Commit

Permalink
update iframe.html
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelylain committed Dec 5, 2024
1 parent 0b067d5 commit 82ea776
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/ingress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ async def _handle(self, request, token, path):
f' HttpOnly; Path={API_BASE}/{cfg.name}/')
raise resp
cfg = get_cfg_by_cookie(request, self._config, token)
if not cfg or cfg.mode == 'hassio':
if not cfg or cfg.mode not in ('ingress', 'subapp'):
# cookie invalid, try redirect to entry
for cfg in ([cfg] if cfg else self._config.values()):
if cfg.name == token:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ingress/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"documentation": "https://github.com/lovelylain/hass_ingress",
"iot_class": "local_push",
"issue_tracker": "https://github.com/lovelylain/hass_ingress/issues",
"version": "1.2.0"
"version": "1.2.1"
}
15 changes: 13 additions & 2 deletions custom_components/ingress/www/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@
<html>
<head>
<meta charset="UTF-8" />
<style>
body {
margin: 0;
height: 100vh;
overflow: hidden;
}
iframe {
border: 0;
height: 100%;
width: 100%;
}
</style>
</head>
<body>
<iframe frameborder="0" style="width: 100%; height: 100%" allow="fullscreen"></iframe>
<iframe allow="fullscreen"></iframe>
<script>
(() => {
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -16,7 +28,6 @@
}
url = `/api/ingress/${url}${url.indexOf("/") === -1 ? "/" : ""}`;
const iframe = document.getElementsByTagName("iframe")[0];
iframe.style.height = document.documentElement.clientHeight - 10 + "px";
iframe.src = url;
const interval = +urlParams.get("refresh");
if (interval >= 5) {
Expand Down

0 comments on commit 82ea776

Please sign in to comment.