Skip to content

Commit

Permalink
fix(web-templates): use CleanedBasePath for static content (#2079)
Browse files Browse the repository at this point in the history
* fix(web-templates): use CleanedBasePath for static content

When setting '--atlantis-url' this static content 404s.

For example, we can see this when comparig:
- /lock --> works seamless with a custom `--atlantis-url`
- /jobs --> doesn't work when using a custom `--atlantis-url`

* fix(web-templates): regenerate bindata_assetfs
  • Loading branch information
jvrplmlmn authored Feb 28, 2022
1 parent de9cd51 commit 51d434d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
52 changes: 26 additions & 26 deletions server/controllers/templates/web_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="/static/css/xterm.css">
<link rel="stylesheet" href="/static/css/normalize.css">
<link rel="stylesheet" href="/static/css/skeleton.css">
<link rel="stylesheet" href="/static/css/custom.css">
<link rel="icon" type="image/png" href="/static/images/atlantis-icon.png">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<style>
#terminal {
position: fixed;
Expand All @@ -391,7 +391,7 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<body>
<section class="header">
<a title="atlantis" href="/"><img class="hero" src="/static/images/atlantis-icon_512.png"/></a>
<a title="atlantis" href="/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="title-heading"><strong></strong></p>
</section>
Expand All @@ -404,10 +404,10 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
<footer>
</footer>
<script src="/static/js/jquery-3.5.1.min.js"></script>
<script src="/static/js/xterm-4.9.0.js"></script>
<script src="/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="/static/js/xterm-addon-fit-0.4.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script>
var term = new Terminal({scrollback: 15000});
Expand Down Expand Up @@ -445,11 +445,11 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par
<title>atlantis</title>
<meta name="description" content>
<meta name="author" content>
<link rel="stylesheet" href="/static/css/xterm.css">
<link rel="stylesheet" href="/static/css/normalize.css">
<link rel="stylesheet" href="/static/css/skeleton.css">
<link rel="stylesheet" href="/static/css/custom.css">
<link rel="icon" type="image/png" href="/static/images/atlantis-icon.png">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/xterm.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<style>
#terminal {
width: 100%;
Expand All @@ -461,7 +461,7 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="/"><img class="hero" src="/static/images/atlantis-icon_512.png"/></a>
<a title="atlantis" href="/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="title-heading"><strong></strong></p>
</section>
Expand All @@ -474,10 +474,10 @@ var ProjectJobsErrorTemplate = template.Must(template.New("blank.html.tmpl").Par
<footer>
</footer>
<script src="/static/js/jquery-3.5.1.min.js"></script>
<script src="/static/js/xterm-4.9.0.js"></script>
<script src="/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="/static/js/xterm-addon-fit-0.4.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-4.9.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-attach-0.6.0.js"></script>
<script src="{{ .CleanedBasePath }}/static/js/xterm-addon-fit-0.4.0.js"></script>
<script>
var term = new Terminal();
Expand Down Expand Up @@ -518,9 +518,9 @@ var GithubAppSetupTemplate = template.Must(template.New("github-app.html.tmpl").
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/static/css/normalize.css">
<link rel="stylesheet" href="/static/css/skeleton.css">
<link rel="stylesheet" href="/static/css/custom.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/normalize.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/skeleton.css">
<link rel="stylesheet" href="{{ .CleanedBasePath }}/static/css/custom.css">
<style>
form {
Expand Down Expand Up @@ -555,13 +555,13 @@ var GithubAppSetupTemplate = template.Must(template.New("github-app.html.tmpl").
width: 80%;
}
</style>
<link rel="icon" type="image/png" href="/static/images/atlantis-icon.png">
<script src="/static/js/jquery-3.5.1.min.js"></script>
<link rel="icon" type="image/png" href="{{ .CleanedBasePath }}/static/images/atlantis-icon.png">
<script src="{{ .CleanedBasePath }}/static/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<div class="container">
<section class="header">
<a title="atlantis" href="/"><img class="hero" src="/static/images/atlantis-icon_512.png"/></a>
<a title="atlantis" href="/"><img class="hero" src="{{ .CleanedBasePath }}/static/images/atlantis-icon_512.png"/></a>
<p class="title-heading">atlantis</p>
<p class="js-discard-success"><strong>
Expand Down
20 changes: 10 additions & 10 deletions server/static/bindata_assetfs.go

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

0 comments on commit 51d434d

Please sign in to comment.