mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-21 15:45:01 +00:00
app/vmalert: load static js and css from proper paths if -http.pathPrefix
command-line flag is set
This is a follow-up for b104f67beb
This commit is contained in:
parent
926fccbb8d
commit
4b41a05ca7
4 changed files with 89 additions and 45 deletions
|
@ -1,7 +1,12 @@
|
||||||
|
{% import (
|
||||||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
|
||||||
|
) %}
|
||||||
|
|
||||||
{% func Footer() %}
|
{% func Footer() %}
|
||||||
|
{% code pathPrefix := httpserver.GetPathPrefix() %}
|
||||||
</main>
|
</main>
|
||||||
<script src="/static/js/jquery-3.6.0.min.js" type="text/javascript"></script>
|
<script src="{%s pathPrefix %}/static/js/jquery-3.6.0.min.js" type="text/javascript"></script>
|
||||||
<script src="/static/js/bootstrap.bundle.min.js" type="text/javascript"></script>
|
<script src="{%s pathPrefix %}/static/js/bootstrap.bundle.min.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function expandAll() {
|
function expandAll() {
|
||||||
$('.collapse').addClass('show');
|
$('.collapse').addClass('show');
|
||||||
|
|
|
@ -5,25 +5,44 @@
|
||||||
package tpl
|
package tpl
|
||||||
|
|
||||||
//line app/vmalert/tpl/footer.qtpl:1
|
//line app/vmalert/tpl/footer.qtpl:1
|
||||||
|
import (
|
||||||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
|
||||||
|
)
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:5
|
||||||
import (
|
import (
|
||||||
qtio422016 "io"
|
qtio422016 "io"
|
||||||
|
|
||||||
qt422016 "github.com/valyala/quicktemplate"
|
qt422016 "github.com/valyala/quicktemplate"
|
||||||
)
|
)
|
||||||
|
|
||||||
//line app/vmalert/tpl/footer.qtpl:1
|
//line app/vmalert/tpl/footer.qtpl:5
|
||||||
var (
|
var (
|
||||||
_ = qtio422016.Copy
|
_ = qtio422016.Copy
|
||||||
_ = qt422016.AcquireByteBuffer
|
_ = qt422016.AcquireByteBuffer
|
||||||
)
|
)
|
||||||
|
|
||||||
//line app/vmalert/tpl/footer.qtpl:1
|
//line app/vmalert/tpl/footer.qtpl:5
|
||||||
func StreamFooter(qw422016 *qt422016.Writer) {
|
func StreamFooter(qw422016 *qt422016.Writer) {
|
||||||
//line app/vmalert/tpl/footer.qtpl:1
|
//line app/vmalert/tpl/footer.qtpl:5
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:6
|
||||||
|
pathPrefix := httpserver.GetPathPrefix()
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:6
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
</main>
|
</main>
|
||||||
<script src="/static/js/jquery-3.6.0.min.js" type="text/javascript"></script>
|
<script src="`)
|
||||||
<script src="/static/js/bootstrap.bundle.min.js" type="text/javascript"></script>
|
//line app/vmalert/tpl/footer.qtpl:8
|
||||||
|
qw422016.E().S(pathPrefix)
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:8
|
||||||
|
qw422016.N().S(`/static/js/jquery-3.6.0.min.js" type="text/javascript"></script>
|
||||||
|
<script src="`)
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:9
|
||||||
|
qw422016.E().S(pathPrefix)
|
||||||
|
//line app/vmalert/tpl/footer.qtpl:9
|
||||||
|
qw422016.N().S(`/static/js/bootstrap.bundle.min.js" type="text/javascript"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function expandAll() {
|
function expandAll() {
|
||||||
$('.collapse').addClass('show');
|
$('.collapse').addClass('show');
|
||||||
|
@ -56,31 +75,31 @@ func StreamFooter(qw422016 *qt422016.Writer) {
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
func WriteFooter(qq422016 qtio422016.Writer) {
|
func WriteFooter(qq422016 qtio422016.Writer) {
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
StreamFooter(qw422016)
|
StreamFooter(qw422016)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
func Footer() string {
|
func Footer() string {
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
WriteFooter(qb422016)
|
WriteFooter(qb422016)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
return qs422016
|
return qs422016
|
||||||
//line app/vmalert/tpl/footer.qtpl:36
|
//line app/vmalert/tpl/footer.qtpl:41
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
|
{% import (
|
||||||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
|
||||||
|
) %}
|
||||||
|
|
||||||
{% func Header(title string, pages []NavItem) %}
|
{% func Header(title string, pages []NavItem) %}
|
||||||
|
{% code pathPrefix := httpserver.GetPathPrefix() %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>vmalert{% if title != "" %} - {%s title %}{% endif %}</title>
|
<title>vmalert{% if title != "" %} - {%s title %}{% endif %}</title>
|
||||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
|
<link href="{%s pathPrefix %}/static/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
<style>
|
<style>
|
||||||
body{
|
body{
|
||||||
min-height: 75rem;
|
min-height: 75rem;
|
||||||
|
|
|
@ -5,37 +5,52 @@
|
||||||
package tpl
|
package tpl
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:1
|
//line app/vmalert/tpl/header.qtpl:1
|
||||||
|
import (
|
||||||
|
"github.com/VictoriaMetrics/VictoriaMetrics/lib/httpserver"
|
||||||
|
)
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:5
|
||||||
import (
|
import (
|
||||||
qtio422016 "io"
|
qtio422016 "io"
|
||||||
|
|
||||||
qt422016 "github.com/valyala/quicktemplate"
|
qt422016 "github.com/valyala/quicktemplate"
|
||||||
)
|
)
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:1
|
//line app/vmalert/tpl/header.qtpl:5
|
||||||
var (
|
var (
|
||||||
_ = qtio422016.Copy
|
_ = qtio422016.Copy
|
||||||
_ = qt422016.AcquireByteBuffer
|
_ = qt422016.AcquireByteBuffer
|
||||||
)
|
)
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:1
|
//line app/vmalert/tpl/header.qtpl:5
|
||||||
func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) {
|
func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) {
|
||||||
//line app/vmalert/tpl/header.qtpl:1
|
//line app/vmalert/tpl/header.qtpl:5
|
||||||
|
qw422016.N().S(`
|
||||||
|
`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:6
|
||||||
|
pathPrefix := httpserver.GetPathPrefix()
|
||||||
|
|
||||||
|
//line app/vmalert/tpl/header.qtpl:6
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>vmalert`)
|
<title>vmalert`)
|
||||||
//line app/vmalert/tpl/header.qtpl:5
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
if title != "" {
|
if title != "" {
|
||||||
//line app/vmalert/tpl/header.qtpl:5
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
qw422016.N().S(` - `)
|
qw422016.N().S(` - `)
|
||||||
//line app/vmalert/tpl/header.qtpl:5
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
qw422016.E().S(title)
|
qw422016.E().S(title)
|
||||||
//line app/vmalert/tpl/header.qtpl:5
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
}
|
}
|
||||||
//line app/vmalert/tpl/header.qtpl:5
|
//line app/vmalert/tpl/header.qtpl:10
|
||||||
qw422016.N().S(`</title>
|
qw422016.N().S(`</title>
|
||||||
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
|
<link href="`)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:11
|
||||||
|
qw422016.E().S(pathPrefix)
|
||||||
|
//line app/vmalert/tpl/header.qtpl:11
|
||||||
|
qw422016.N().S(`/static/css/bootstrap.min.css" rel="stylesheet" />
|
||||||
<style>
|
<style>
|
||||||
body{
|
body{
|
||||||
min-height: 75rem;
|
min-height: 75rem;
|
||||||
|
@ -85,37 +100,37 @@ func StreamHeader(qw422016 *qt422016.Writer, title string, pages []NavItem) {
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:55
|
//line app/vmalert/tpl/header.qtpl:60
|
||||||
StreamPrintNavItems(qw422016, title, pages)
|
StreamPrintNavItems(qw422016, title, pages)
|
||||||
//line app/vmalert/tpl/header.qtpl:55
|
//line app/vmalert/tpl/header.qtpl:60
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<main class="px-2">
|
<main class="px-2">
|
||||||
`)
|
`)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
func WriteHeader(qq422016 qtio422016.Writer, title string, pages []NavItem) {
|
func WriteHeader(qq422016 qtio422016.Writer, title string, pages []NavItem) {
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
StreamHeader(qw422016, title, pages)
|
StreamHeader(qw422016, title, pages)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
qt422016.ReleaseWriter(qw422016)
|
qt422016.ReleaseWriter(qw422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
}
|
}
|
||||||
|
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
func Header(title string, pages []NavItem) string {
|
func Header(title string, pages []NavItem) string {
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
qb422016 := qt422016.AcquireByteBuffer()
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
WriteHeader(qb422016, title, pages)
|
WriteHeader(qb422016, title, pages)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
qs422016 := string(qb422016.B)
|
qs422016 := string(qb422016.B)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
qt422016.ReleaseByteBuffer(qb422016)
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
return qs422016
|
return qs422016
|
||||||
//line app/vmalert/tpl/header.qtpl:57
|
//line app/vmalert/tpl/header.qtpl:62
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue