Skip to content

Commit

Permalink
Remove dependency on debug.js
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Mar 22, 2020
1 parent 1d1ad3d commit 9a87f0d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 72 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.vscode
assets/js/debug.js
*.conf
*.json
*.sh
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ manifest.json
audi.*
credentials.json
token.json
assets/js/debug.js
evcc
__debug_bin
3 changes: 0 additions & 3 deletions assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ <h5 class="pb-2 pt-4 mx-auto text-center">Zähler</h5>
}
</script>

<!-- << if .Debug >> -->
<script src="js/debug.js"></script>
<!-- << end >> -->
<script src="js/app.js"></script>

</body>
Expand Down
13 changes: 8 additions & 5 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// axios setup
const loc = (typeof baseurl !== "undefined") ? baseurl : window.location;
const uri = loc.protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + "/api";

axios.defaults.baseURL = uri;
// axios setup with test fallback
const loc = window.location.href.indexOf("http://localhost/evcc/assets/") ? {
protocol: "http:",
hostname: "localhost",
port: "7070",
} : window.location;

axios.defaults.baseURL = loc.protocol + "//" + loc.hostname + (loc.port ? ":" + loc.port : "") + "/api";
axios.defaults.headers.post['Content-Type'] = 'application/json';

//
Expand Down
113 changes: 51 additions & 62 deletions server/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a87f0d

Please sign in to comment.