Skip to content

Commit

Permalink
Add detail to page titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
xuri committed Jan 19, 2019
1 parent 15c8a55 commit 9e06441
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 - 2018 Ri Xu All rights reserved.
Copyright (c) 2016 - 2019 Ri Xu All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
2 changes: 1 addition & 1 deletion aurora.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
servers = []
listen = "127.0.0.1:3000"
version = 2.2
version = 2.1

[openpage]
enabled = true
Expand Down
2 changes: 1 addition & 1 deletion statik/statik.go

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import (

// Define the default configuration and HTML header template.
const (
ConfigFileTemplate = "servers = []\r\nlisten = \"127.0.0.1:3000\"\r\nversion = 2.1\r\n\r\n[openpage]\r\nenabled = true\r\n\r\n[auth]\r\nenabled = false\r\npassword = \"password\"\r\nusername = \"admin\"\r\n\r\n[sample]\r\nstorage = \"{}\""
ConfigFileTemplate = "servers = []\r\nlisten = \"127.0.0.1:3000\"\r\nversion = 2.2\r\n\r\n[openpage]\r\nenabled = true\r\n\r\n[auth]\r\nenabled = false\r\npassword = \"password\"\r\nusername = \"admin\"\r\n\r\n[sample]\r\nstorage = \"{}\""
DefaultDelay = 0
DefaultPriority = 1024 // most urgent: 0, least urgent: 4294967295.
DefaultTTR = 60 // 1 minute
DefaultTubePauseSeconds = 3600
TplHead = `<head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]--><meta name="description" content="Beanstalkd Console"><meta name="keywords" content="Beanstalkd Console, beanstalk, console"><meta content="always" name="referrer"><meta name="language" content="en-US"><meta name="category" content="Tools"><meta name="summary" content="Beanstalkd Console"><meta name="apple-mobile-web-app-capable" content="yes"/><link rel="copyright" href="http://www.opensource.org/licenses/mit-license.php"/><link rel="icon" sizes="32x32" href="./images/aurora-32x32.ico"><link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon-180x180-precomposed.png"><link rel="apple-touch-icon" sizes="152x152" href="./images/apple-touch-icon-152x152-precomposed.png"><link rel="apple-touch-icon" sizes="144x144" href="./images/apple-touch-icon-144x144-precomposed.png"><link rel="apple-touch-icon" sizes="120x120" href="./images/apple-touch-icon-120x120-precomposed.png"><link rel="apple-touch-icon" sizes="114x114" href="./images/apple-touch-icon-114x114-precomposed.png"><link rel="apple-touch-icon" sizes="76x76" href="./images/apple-touch-icon-76x76-precomposed.png"><link rel="apple-touch-icon" sizes="72x72" href="./images/apple-touch-icon-72x72-precomposed.png"><link rel="apple-touch-icon" href="./images/apple-touch-icon-precomposed-57x57.png"><title>Beanstalkd Console</title><!-- Bootstrap core CSS --><link href="./assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"><link href="./css/customer.css" rel="stylesheet"><link href="./highlight/styles/magula.css" rel="stylesheet"><!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --><!--[if lt IE 9]><script src="./js/libs/html5shiv/3.7.0/html5shiv.js"></script><script src="./js/libs/respond.js/1.4.2/respond.min.js"></script><![endif]--></head>`
TplHeaderBegin = `<!DOCTYPE html><html lang="en-US"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]--><meta name="description" content="Beanstalkd Console"><meta name="keywords" content="Beanstalkd Console, beanstalkd, console"><meta content="always" name="referrer"><meta name="language" content="en-US"><meta name="category" content="Tools"><meta name="summary" content="Beanstalkd Console"><meta name="apple-mobile-web-app-capable" content="yes"/><link rel="copyright" href="http://www.opensource.org/licenses/mit-license.php"/><link rel="icon" sizes="32x32" href="./images/aurora-32x32.ico"><link rel="apple-touch-icon" sizes="180x180" href="./images/apple-touch-icon-180x180-precomposed.png"><link rel="apple-touch-icon" sizes="152x152" href="./images/apple-touch-icon-152x152-precomposed.png"><link rel="apple-touch-icon" sizes="144x144" href="./images/apple-touch-icon-144x144-precomposed.png"><link rel="apple-touch-icon" sizes="120x120" href="./images/apple-touch-icon-120x120-precomposed.png"><link rel="apple-touch-icon" sizes="114x114" href="./images/apple-touch-icon-114x114-precomposed.png"><link rel="apple-touch-icon" sizes="76x76" href="./images/apple-touch-icon-76x76-precomposed.png"><link rel="apple-touch-icon" sizes="72x72" href="./images/apple-touch-icon-72x72-precomposed.png"><link rel="apple-touch-icon" href="./images/apple-touch-icon-precomposed-57x57.png"><title>`
TplHeaderEnd = ` Beanstalkd Console</title><!-- Bootstrap core CSS --><link href="./assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"><link href="./css/customer.css" rel="stylesheet"><link href="./highlight/styles/magula.css" rel="stylesheet"><!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --><!--[if lt IE 9]><script src="./js/libs/html5shiv/3.7.0/html5shiv.js"></script><script src="./js/libs/respond.js/1.4.2/respond.min.js"></script><![endif]--></head><body>`
TplLinks = `<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> Links <span class="caret"></span></a><ul class="dropdown-menu"><li><a href="https://github.com/beanstalkd" target="_blank">Beanstalkd (GitHub)</a></li><li><a href="https://github.com/xuri/aurora" target="_blank">Aurora (GitHub)</a></li></ul></li>`
TplNoScript = `<noscript><div class="container"><div class="alert alert-danger" role="alert">Aurora Beanstalkd Console requires JavaScript supports, please refresh after enable browser JavaScript support.</div></div></noscript>`
TplNoScript = `<noscript><div class="container"><div class="alert alert-danger" role="alert">Aurora beanstalkd console requires JavaScript supports, please refresh after enable browser JavaScript support.</div></div></noscript>`
UpdateURL = `https://api.github.com/repos/xuri/aurora/tags`
Version = 2.2
)
Expand Down
6 changes: 3 additions & 3 deletions tplMain.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func tplMain(serverList string, currentServer string) string {
isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
}
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(`All servers -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(`</ul><ul class="nav navbar-nav navbar-right"><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Toolbox <span class="caret"></span></a><ul class="dropdown-menu"><li><a href="#filterServer" role="button" data-toggle="modal">Filter columns</a></li><li><a href="./sample?action=manageSamples" role="button">Manage samples</a></li><li><a href="./statistics?action=preference" role="button">Statistics preference</a></li><li class="divider"></li><li><a href="#settings" role="button" data-toggle="modal">Edit settings</a></li></ul></li>`)
Expand Down
6 changes: 3 additions & 3 deletions tplSampleJobsManage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func tplSampleJobsManage(sampleList string, currentServer string) string {
isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
}
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(`Manage samples -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(dropDownServer(currentServer))
Expand Down
7 changes: 4 additions & 3 deletions tplServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ func tplServer(content string, server string) string {
isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
}
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(server)
buf.WriteString(` -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(dropDownServer(server))
Expand Down
10 changes: 6 additions & 4 deletions tplStatistic.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ import (
// and tube.
func tplStatistic(server string, tube string) string {
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(`Statistics overview - `)
buf.WriteString(tube)
buf.WriteString(` -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(dropDownServer(""))
Expand All @@ -42,7 +44,7 @@ func tplStatistic(server string, tube string) string {
buf.WriteString(tplTubeFilter())
buf.WriteString(dropEditSettings())
buf.WriteString(`</div><script>function getParameterByName(name,url){if(!url){url=window.location.href}name=name.replace(/[\[\]]/g,"\\$&");var regex=new RegExp("[?&]"+name+"(=([^&#]*)|&|#|$)"),results=regex.exec(url);if(!results){return null}if(!results[2]){return""}return decodeURIComponent(results[2].replace(/\+/g," "))}var url="./tube?server="+getParameterByName("server");var contentType="";</script><script src='./assets/vendor/jquery/jquery.js'></script><script src="./js/jquery.color.js"></script><script src="./js/jquery.cookie.js"></script><script src="./js/jquery.regexp.js"></script><script src="./assets/vendor/bootstrap/js/bootstrap.min.js"></script>`)
buf.WriteString(`<script src="./js/libs/flot/jquery.flot.js"></script><script src="./js/libs/flot/jquery.flot.resize.js"></script><script src="./js/libs/flot/jquery.flot.tooltip.min.js"></script><script type="text/javascript">var options={series: {shadowSize:4,lines:{show:true},points:{show:true,radius:1}},colors:["#00C851","#ffbb33","#33b5e5","#ff4444"],grid:{hoverable:true},xaxis:{mode:"time",timeformat:"%y-%m-%d %H:%M:%S"},yaxis:{min:0,tickDecimals:0},tooltip:true,tooltipOpts:{content:"%x.1 %s jobs: %y.4"}};function getRandomData(){$.get("./statistics?action=reloader&server=`)
buf.WriteString(`<script src="./js/libs/flot/jquery.flot.js"></script><script src="./js/libs/flot/jquery.flot.resize.js"></script><script src="./js/libs/flot/jquery.flot.tooltip.min.js"></script><script type="text/javascript">var options={series: {shadowSize:4,lines:{show:true},points:{show:false,radius:1}},colors:["#00C851","#ffbb33","#33b5e5","#ff4444"],grid:{hoverable:true},xaxis:{mode:"time",timeformat:"%y-%m-%d %H:%M:%S"},yaxis:{min:0,tickDecimals:0},tooltip:true,tooltipOpts:{content:"%x.1 %s jobs: %y.4"}};function getRandomData(){$.get("./statistics?action=reloader&server=`)
buf.WriteString(server)
buf.WriteString(`&tube=`)
buf.WriteString(url.QueryEscape(tube))
Expand Down
6 changes: 3 additions & 3 deletions tplStatisticSetting.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import "bytes"
// tplStatisticSetting statistic preferences page.
func tplStatisticSetting(content string) string {
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(`Statistics preference -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(dropDownServer(""))
Expand Down
9 changes: 6 additions & 3 deletions tplTube.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ func tplTube(content string, server string, tube string) string {
isDisabledJobDataHighlight = `<script src="./highlight/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script>`
}
buf := bytes.Buffer{}
buf.WriteString(`<!DOCTYPE html><html lang="en-US">`)
buf.WriteString(TplHead)
buf.WriteString(`<body>`)
buf.WriteString(TplHeaderBegin)
buf.WriteString(tube)
buf.WriteString(` - `)
buf.WriteString(server)
buf.WriteString(` -`)
buf.WriteString(TplHeaderEnd)
buf.WriteString(TplNoScript)
buf.WriteString(`<div class="navbar navbar-fixed-top navbar-default" role="navigation"><div class="container"><div class="navbar-header"><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="/">Beanstalkd console</a></div><div class="collapse navbar-collapse"><ul class="nav navbar-nav">`)
buf.WriteString(dropDownServer(server))
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func parseFlags() {
os.Exit(0)
}
if *helpPtr {
fmt.Printf("aurora version: %.1f\r\nCopyright (c) 2016 - 2018 Ri Xu https://xuri.me All rights reserved.\r\n\r\nUsage: aurora [OPTIONS] [cmd [arg ...]]\n -c <filename> Use config file. (default: aurora.toml)\r\n -h \t\t Output this help and exit.\r\n -v \t\t Output version and exit.\r\n", Version)
fmt.Printf("aurora version: %.1f\r\nCopyright (c) 2016 - 2019 Ri Xu https://xuri.me All rights reserved.\r\n\r\nUsage: aurora [OPTIONS] [cmd [arg ...]]\n -c <filename> Use config file. (default: aurora.toml)\r\n -h \t\t Output this help and exit.\r\n -v \t\t Output version and exit.\r\n", Version)
os.Exit(0)
}
}
Expand Down

0 comments on commit 9e06441

Please sign in to comment.