Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply location fix only when using Ingress #267

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions grocy/rootfs/patches/fix_braindamage.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
diff --git a/views/layout/default.blade.php b/views/layout/default.blade.php
index fceaaa0..bfc76e6 100644
index 4eb3fb8d..d4e5e007 100644
--- a/views/layout/default.blade.php
+++ b/views/layout/default.blade.php
@@ -87,7 +87,7 @@
Grocy.Components = { };
@@ -88,7 +88,10 @@
Grocy.Version = '{{ $version }}';
Grocy.Mode = '{{ GROCY_MODE }}';
- Grocy.CurrentUrlRelative = "/" + window.location.href.split('?')[0].replace(Grocy.BaseUrl, "");
Grocy.BaseUrl = '{{ $U('/') }}';
Grocy.CurrentUrlRelative = "/" + window.location.href.split('?')[0].replace(Grocy.BaseUrl, "");
+ if(Grocy.BaseUrl.indexOf('http') != 0 || Grocy.BaseUrl.indexOf('hassio_ingress') >= 0) {
+ Grocy.BaseUrl = window.location.origin + '{{ $U('/') }}';
+ Grocy.CurrentUrlRelative = "/" + window.location.pathname.replace(Grocy.BaseUrl, "");
+ };
+ Grocy.CurrentUrlRelative = "/" + window.location.pathname.replace(Grocy.BaseUrl, "");
Grocy.ActiveNav = '@yield('activeNav', '')';
Grocy.Culture = '{{ GROCY_LOCALE }}';
Grocy.Currency = '{{ GROCY_CURRENCY }}';
Grocy.Currency = '{{ GROCY_CURRENCY }}';