Added Admin Overview

This commit is contained in:
Thorsten Sommer 2015-06-22 14:08:29 +02:00
parent 5cd7f237a3
commit ea2a790bad
21 changed files with 6411 additions and 6271 deletions

View File

@ -1,308 +1,341 @@
package Assets
var CSSLog string = `
body {
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
color: #333;
font-size: 14px;
line-height: 20px;
}
h1 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 38px;
line-height: 44px;
font-weight: 700;
}
h2 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 32px;
line-height: 36px;
font-weight: 700;
}
h3 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 24px;
line-height: 30px;
font-weight: 700;
}
h4 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 18px;
line-height: 24px;
font-weight: 700;
}
h5 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 14px;
line-height: 20px;
font-weight: 700;
}
h6 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 12px;
line-height: 18px;
font-weight: 700;
}
p {
margin-bottom: 5px;
}
.button {
display: inline-block;
padding: 4px 15px;
background-color: black;
color: white;
text-align: center;
text-decoration: none;
}
.button.changepagebutton {
margin-right: 3px;
margin-left: 3px;
background-color: #545454;
}
.button.changepagebutton.pagechangesubmit {
margin-right: 30px;
}
.button.optionbuttons {
margin: 6px;
background-color: #545454;
}
.button.optionbuttons.applyfilters {
margin-left: 0px;
}
.headercontainer {
height: 50px;
margin-top: -19px;
background-color: black;
color: white;
text-align: center;
}
.logcontainer {
margin-top: 0px;
}
.loglist {
margin-right: 3px;
margin-bottom: 3px;
margin-left: 3px;
padding-top: 0px;
padding-left: 0px;
list-style-type: none;
}
.logline {
margin: 3px 6px;
padding: 6px;
border: 1px solid #9e9e9e;
border-radius: 3px;
font-family:'Source Code Pro', sans-serif;
font-size: 10px;
font-weight: 900;
}
.logline.loga {
background-color: #ededed;
}
.logline.logb {
background-color: #cfcfcf;
}
.logline.logwarn {
color: #db7602;
}
.logline.logdebug {
color: #04f;
}
.logline.logerror {
color: #c00;
}
.logline.loginfo {
color: black;
}
.logline.logtalkative {
color: #a3a2a2;
}
.logline.logsecurity {
color: #db4500;
}
.logheadercontainer {
margin-top: 10px;
text-align: center;
}
.showposition {
margin-top: 10px;
font-size: 20px;
}
.controlcontainer {
margin-top: 10px;
}
.pagecontainer {
margin-top: 10px;
text-align: center;
list-style-type: none;
}
.icons {
position: absolute;
display: block;
width: 25px;
height: 25px;
margin-top: 15px;
margin-left: 254px;
padding-top: 0px;
font-family: Glyphicons, sans-serif;
color: black;
font-size: 25px;
font-weight: 400;
text-decoration: none;
}
.icons.oneback {
margin-top: 17px;
margin-left: 219px;
}
.icons.tofirst {
margin-top: 17px;
margin-left: 255px;
}
.icons.next {
margin-top: -38px;
margin-left: 668px;
}
.icons.tolast {
margin-top: -38px;
margin-left: 702px;
}
.formfield {
display: inline;
margin-right: 6px;
margin-left: 30px;
color: black;
font-weight: 400;
}
.formpages {
display: inline;
}
.currentpage {
display: inline-block;
width: 100px;
margin-top: 7px;
margin-right: 6px;
padding-top: 3px;
padding-bottom: 3px;
float: none;
clear: none;
color: black;
text-align: center;
}
.formpageswrapper {
display: inline;
}
.textcountpages {
display: inline;
margin-right: 6px;
color: black;
}
.logchangepagebutton {
height: 40px;
margin-left: 10px;
padding-top: 3px;
padding-bottom: 3px;
background-color: #a8a8a8;
color: black;
font-weight: 700;
}
.headercontrol {
text-align: center;
}
.headeroutput {
text-align: center;
}
.options {
background-color: #ededed;
}
.filters {
background-color: #ededed;
}
.labels {
display: block;
}
@media (max-width: 991px) {
.icons.oneback {
margin-left: 113px;
}
.icons.tofirst {
margin-left: 152px;
}
.icons.next {
margin-left: 563px;
}
.icons.tolast {
margin-left: 602px;
}
}
@media (max-width: 767px) {
.button.changepagebutton.pagechangesubmit {
margin-right: 0px;
}
.icons.oneback {
margin-left: 40px;
}
.icons.tofirst {
margin-left: 73px;
}
.icons.next {
margin-left: 483px;
}
.icons.tolast {
margin-left: 518px;
}
.formfield {
margin-left: 0px;
}
.newlineblock {
height: 10px;
}
}
@media (max-width: 479px) {
.button.changepagebutton.pagechangesubmit {
margin-right: 3px;
margin-bottom: 20px;
text-align: center;
}
.pagecontainer {
margin-top: 20px;
}
.icons.oneback {
margin-top: 113px;
margin-left: 25px;
}
.icons.tofirst {
margin-top: 113px;
margin-left: 62px;
}
.icons.next {
margin-top: 18px;
margin-left: 242px;
}
.icons.tolast {
margin-top: 18px;
margin-left: 278px;
}
.formfield {
margin-left: 0px;
}
.currentpage {
margin-top: 20px;
}
.newlineblock {
display: block;
height: 10px;
}
}
@font-face {
font-family: 'Glyphicons';
src: url('/binaryAssets/SourceCodePro-Black.eot') format('embedded-opentype'), url('/binaryAssets/SourceCodePro-Black.ttf') format('truetype'), url('/binaryAssets/SourceCodePro-Black.otf') format('opentype');
font-weight: 400;
font-style: normal;
}`
package Assets
var CSSAdmin string = `
body {
font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif;
color: #333;
font-size: 14px;
line-height: 20px;
}
h1 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 38px;
line-height: 44px;
font-weight: 700;
}
h2 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 32px;
line-height: 36px;
font-weight: 700;
}
h3 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 24px;
line-height: 30px;
font-weight: 700;
}
h4 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 18px;
line-height: 24px;
font-weight: 700;
}
h5 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 14px;
line-height: 20px;
font-weight: 700;
}
h6 {
margin-top: 10px;
margin-bottom: 10px;
font-size: 12px;
line-height: 18px;
font-weight: 700;
}
p {
margin-bottom: 5px;
}
.button {
display: inline-block;
padding: 4px 15px;
background-color: black;
color: white;
text-align: center;
text-decoration: none;
}
.button.changepagebutton {
margin-right: 3px;
margin-left: 3px;
background-color: #545454;
}
.button.changepagebutton.pagechangesubmit {
margin-right: 30px;
}
.button.optionbuttons {
margin: 6px;
background-color: #545454;
}
.button.optionbuttons.applyfilters {
margin-left: 0px;
}
.button.optionbuttons.currentoption {
background-color: #00aeff;
}
.button.adminbutton {
width: 222px;
height: 50px;
max-height: 50px;
max-width: 222px;
min-height: 50px;
min-width: 222px;
padding-top: 15px;
background-color: #cfcfcf;
color: black;
font-size: 20px;
font-weight: 700;
}
.button.adminbutton:hover {
background-color: #00aeff;
color: white;
}
.headercontainer {
height: 50px;
margin-top: -19px;
background-color: black;
color: white;
text-align: center;
}
.logcontainer {
margin-top: 0px;
}
.loglist {
margin-right: 3px;
margin-bottom: 3px;
margin-left: 3px;
padding-top: 0px;
padding-left: 0px;
list-style-type: none;
}
.logline {
margin: 3px 6px;
padding: 6px;
border: 1px solid #9e9e9e;
border-radius: 3px;
font-family:'Source Code Pro', sans-serif;
font-size: 10px;
font-weight: 900;
}
.logline.loga {
background-color: #ededed;
}
.logline.logb {
background-color: #cfcfcf;
}
.logline.logwarn {
color: #db7602;
}
.logline.logdebug {
color: #04f;
}
.logline.logerror {
color: #c00;
}
.logline.loginfo {
color: black;
}
.logline.logtalkative {
color: #a3a2a2;
}
.logline.logsecurity {
color: #db4500;
}
.logheadercontainer {
margin-top: 10px;
text-align: center;
}
.showposition {
margin-top: 10px;
font-size: 20px;
}
.controlcontainer {
margin-top: 10px;
}
.pagecontainer {
margin-top: 10px;
text-align: center;
list-style-type: none;
}
.icons {
position: absolute;
display: block;
width: 25px;
height: 25px;
margin-top: 15px;
margin-left: 254px;
padding-top: 0px;
font-family: Glyphicons, sans-serif;
color: black;
font-size: 25px;
font-weight: 400;
text-decoration: none;
}
.icons.oneback {
margin-top: 17px;
margin-left: 219px;
}
.icons.tofirst {
margin-top: 17px;
margin-left: 255px;
}
.icons.next {
margin-top: -38px;
margin-left: 668px;
}
.icons.tolast {
margin-top: -38px;
margin-left: 702px;
}
.formfield {
display: inline;
margin-right: 6px;
margin-left: 30px;
color: black;
font-weight: 400;
}
.formpages {
display: inline;
}
.currentpage {
display: inline-block;
width: 100px;
margin-top: 7px;
margin-right: 6px;
padding-top: 3px;
padding-bottom: 3px;
float: none;
clear: none;
color: black;
text-align: center;
}
.formpageswrapper {
display: inline;
}
.textcountpages {
display: inline;
margin-right: 6px;
color: black;
}
.logchangepagebutton {
height: 40px;
margin-left: 10px;
padding-top: 3px;
padding-bottom: 3px;
background-color: #a8a8a8;
color: black;
font-weight: 700;
}
.headercontrol {
text-align: center;
}
.headeroutput {
text-align: center;
}
.options {
background-color: #ededed;
}
.filters {
background-color: #ededed;
}
.labels {
display: block;
}
.adminsection {
margin-top: 30px;
}
.adminitem {
min-height: 50px;
background-color: #cfcfcf;
font-size: 20px;
font-weight: 700;
text-align: center;
}
.adminitemlog {
padding-top: 14px;
}
@media (max-width: 991px) {
.icons.oneback {
margin-left: 113px;
}
.icons.tofirst {
margin-left: 152px;
}
.icons.next {
margin-left: 563px;
}
.icons.tolast {
margin-left: 602px;
}
}
@media (max-width: 767px) {
.button.changepagebutton.pagechangesubmit {
margin-right: 0px;
}
.icons.oneback {
margin-left: 40px;
}
.icons.tofirst {
margin-left: 73px;
}
.icons.next {
margin-left: 483px;
}
.icons.tolast {
margin-left: 518px;
}
.formfield {
margin-left: 0px;
}
.newlineblock {
height: 10px;
}
}
@media (max-width: 479px) {
.button.changepagebutton.pagechangesubmit {
margin-right: 3px;
margin-bottom: 20px;
text-align: center;
}
.pagecontainer {
margin-top: 20px;
}
.icons.oneback {
margin-top: 113px;
margin-left: 25px;
}
.icons.tofirst {
margin-top: 113px;
margin-left: 62px;
}
.icons.next {
margin-top: 18px;
margin-left: 242px;
}
.icons.tolast {
margin-top: 18px;
margin-left: 278px;
}
.formfield {
margin-left: 0px;
}
.currentpage {
margin-top: 20px;
}
.newlineblock {
display: block;
height: 10px;
}
}
@font-face {
font-family: 'Glyphicons';
src: url('/binaryAssets/SourceCodePro-Black.eot') format('embedded-opentype'), url('/binaryAssets/SourceCodePro-Black.ttf') format('truetype'), url('/binaryAssets/SourceCodePro-Black.otf') format('opentype');
font-weight: 400;
font-style: normal;
}`

View File

@ -1,343 +1,361 @@
package Assets
var CSSNormalize string = `
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct "block" display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* Correct "inline-block" display not defined in IE 8/9.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* Prevent modern browsers from displaying "audio" without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address "[hidden]" styling not present in IE 8/9.
* Hide the "template" element in IE, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background: transparent;
}
/**
* Address "outline" inconsistency between Chrome and other browsers.
*/
a:focus {
outline: thin dotted;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* Address variable "h1" font-size and margin within "section" and "article"
* contexts in Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to "bolder" in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Correct font family set oddly in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* Improve readability of pre-formatted text in all browsers.
*/
pre {
white-space: pre-wrap;
}
/**
* Set consistent quote types.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent "sub" and "sup" affecting "line-height" in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
* Remove border when inside "a" element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct "color" not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0;
/* 1 */
padding: 0;
/* 2 */
}
/**
* 1. Correct font family not being inherited in all browsers.
* 2. Correct font size not being inherited in all browsers.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 2 */
margin: 0;
/* 3 */
}
/**
* Address Firefox 4+ setting "line-height" on "input" using "!important" in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/**
* Address inconsistent "text-transform" inheritance for "button" and "select".
* All other form control elements do not inherit "text-transform" values.
* Correct "button" style inheritance in Chrome, Safari 5+, and IE 8+.
* Correct "select" style inheritance in Firefox 4+ and Opera.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native "audio"
* and "video" controls.
* 2. Correct inability to style clickable "input" types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* "input" and others.
*/
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
/* 2 */
cursor: pointer;
/* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1. Address box sizing set to "content-box" in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* 1. Address "appearance" set to "searchfield" in Safari 5 and Chrome.
* 2. Address "box-sizing" set to "border-box" in Safari 5 and Chrome
* (include "-moz" to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield;
/* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1. Remove default vertical scrollbar in IE 8/9.
* 2. Improve readability and alignment in all browsers.
*/
textarea {
overflow: auto;
/* 1 */
vertical-align: top;
/* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}`
package Assets
var CSSNormalize string = `
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif;
/* 1 */
-ms-text-size-adjust: 100%;
/* 2 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct 'block' display not defined for any HTML5 element in IE 8/9.
* Correct 'block' display not defined for 'details' or 'summary' in IE 10/11
* and Firefox.
* Correct 'block' display not defined for 'main' in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct 'inline-block' display not defined in IE 8/9.
* 2. Normalize vertical alignment of 'progress' in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block;
/* 1 */
vertical-align: baseline;
/* 2 */
}
/**
* Prevent modern browsers from displaying 'audio' without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address '[hidden]' styling not present in IE 8/9/10.
* Hide the 'template' element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to 'bolder' in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable 'h1' font-size and margin within 'section' and 'article'
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent 'sub' and 'sup' affecting 'line-height' in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside 'a' element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd 'em'-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of 'select', unless a 'border' property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit;
/* 1 */
font: inherit;
/* 2 */
margin: 0;
/* 3 */
}
/**
* Address 'overflow' set to 'hidden' in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent 'text-transform' inheritance for 'button' and 'select'.
* All other form control elements do not inherit 'text-transform' values.
* Correct 'button' style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct 'select' style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native 'audio'
* and 'video' controls.
* 2. Correct inability to style clickable 'input' types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* 'input' and others.
*/
button,
html input[type="button"],
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button;
/* 2 */
cursor: pointer;
/* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting 'line-height' on 'input' using '!important' in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to 'content-box' in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* 'font-size' values of the 'input', it causes the cursor style of the
* decrement button to change from 'default' to 'text'.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address 'appearance' set to 'searchfield' in Safari and Chrome.
* 2. Address 'box-sizing' set to 'border-box' in Safari and Chrome
* (include '-moz' to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield;
/* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and 'textfield' appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct 'color' not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the 'font-weight' (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}`

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
package Assets
var JSModernizr string = `
/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-video-touch-shiv-cssclasses-teststyles-prefixes-cssclassprefix:w!mod!
*/
;window.Modernizr=function(a,b,c){function w(a){j.cssText=a}function x(a,b){return w(m.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},n.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c};for(var B in n)v(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" w-mod-"+(b?"":"no-")+a),e[a]=b}return e},w(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" w-mod-js w-mod-"+q.join(" w-mod-"):""),e}(this,this.document);
/**
* Webflow: Custom tests
*/
Modernizr.addTest('ios', /(ipod|iphone|ipad)/i.test(navigator.userAgent));`
package Assets
var JSModernizr string = `
/* Modernizr 2.7.1 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-video-touch-shiv-cssclasses-teststyles-prefixes-cssclassprefix:w!mod!
*/
;window.Modernizr=function(a,b,c){function w(a){j.cssText=a}function x(a,b){return w(m.join(a+";")+(b||""))}function y(a,b){return typeof a===b}function z(a,b){return!!~(""+a).indexOf(b)}function A(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:y(f,"function")?f.bind(d||b):f}return!1}var d="2.7.1",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n={},o={},p={},q=[],r=q.slice,s,t=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},u={}.hasOwnProperty,v;!y(u,"undefined")&&!y(u.call,"undefined")?v=function(a,b){return u.call(a,b)}:v=function(a,b){return b in a&&y(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=r.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(r.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(r.call(arguments)))};return e}),n.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:t(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},n.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c};for(var B in n)v(n,B)&&(s=B.toLowerCase(),e[s]=n[B](),q.push((e[s]?"":"no-")+s));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)v(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" w-mod-"+(b?"":"no-")+a),e[a]=b}return e},w(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e.testStyles=t,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" w-mod-js w-mod-"+q.join(" w-mod-"):""),e}(this,this.document);
/**
* Webflow: Custom tests
*/
Modernizr.addTest('ios', /(ipod|iphone|ipad)/i.test(navigator.userAgent));`

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,93 +1,93 @@
package Web
import (
"fmt"
"github.com/SommerEngineering/Ocean/Log/Web/Assets"
"github.com/SommerEngineering/Ocean/MimeTypes"
"github.com/SommerEngineering/Ocean/Shutdown"
"net/http"
)
// Handler for some CSS data for the web logger.
func HandlerCSSNormalize(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSNormalize)
}
// Handler for some CSS data for the web logger.
func HandlerCSSWebflow(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSWebflow)
}
// Handler for some CSS data for the web logger.
func HandlerCSSLog(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSLog)
}
// Handler for some JS for the web logger.
func HandlerJSModernizr(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSModernizr)
}
// Handler for some JS for the web logger.
func HandlerJSWebflow(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSWebflow)
}
// Handler for some JS for the web logger.
func HandlerJSjQuery(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSjQuery)
}
// Handler for some JS for the web logger.
func HandlerJSjQueryMap(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSjQueryMap)
}
package Admin
import (
"fmt"
"github.com/SommerEngineering/Ocean/Admin/Assets"
"github.com/SommerEngineering/Ocean/MimeTypes"
"github.com/SommerEngineering/Ocean/Shutdown"
"net/http"
)
// Handler for some CSS data for the web logger.
func HandlerCSSNormalize(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSNormalize)
}
// Handler for some CSS data for the web logger.
func HandlerCSSWebflow(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSWebflow)
}
// Handler for some CSS data for the web logger.
func HandlerCSSAdmin(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebCSS)
fmt.Fprint(response, Assets.CSSAdmin)
}
// Handler for some JS for the web logger.
func HandlerJSModernizr(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSModernizr)
}
// Handler for some JS for the web logger.
func HandlerJSWebflow(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSWebflow)
}
// Handler for some JS for the web logger.
func HandlerJSjQuery(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSjQuery)
}
// Handler for some JS for the web logger.
func HandlerJSjQueryMap(response http.ResponseWriter, request *http.Request) {
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebJavaScript)
fmt.Fprint(response, Assets.JSjQueryMap)
}

25
Admin/HandlerOverview.go Normal file
View File

@ -0,0 +1,25 @@
package Admin
import (
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"github.com/SommerEngineering/Ocean/MimeTypes"
"github.com/SommerEngineering/Ocean/Shutdown"
"net/http"
)
// Handler for accessing the admin's overview.
func HandlerOverview(response http.ResponseWriter, request *http.Request) {
// Case: The system goes down now.
if Shutdown.IsDown() {
http.NotFound(response, request)
return
}
// Write the MIME type and execute the template:
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebHTML)
if executeError := AdminTemplates.ExecuteTemplate(response, `Overview`, nil); executeError != nil {
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactCritical, LM.MessageNameEXECUTE, `Was not able to execute the admin's overview template.`, executeError.Error())
}
}

25
Admin/Init.go Normal file
View File

@ -0,0 +1,25 @@
package Admin
import (
"github.com/SommerEngineering/Ocean/Admin/Templates"
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"html/template"
)
// The init function for this package.
func init() {
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameINIT, `Init the admin area.`)
defer Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameINIT, `Init the admin area done.`)
// Create the cache of all admin templates:
AdminTemplates = template.New(`root`)
if _, err := AdminTemplates.Parse(Templates.LoggingViewer); err != nil {
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactUnknown, LM.MessageNamePARSE, `Was not able to parse the template for the web log viewer.`, err.Error())
}
if _, err := AdminTemplates.Parse(Templates.Overview); err != nil {
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactUnknown, LM.MessageNamePARSE, `Was not able to parse the template for the admin overview.`, err.Error())
}
}

View File

@ -1,6 +1,6 @@
package Scheme
const (
A string = `loga` // Web log line, kind A (different color for each line)
B string = `logb` // Web log line, kind B (different color for each line)
)
package Scheme
const (
A string = `loga` // Web log line, kind A (different color for each line)
B string = `logb` // Web log line, kind B (different color for each line)
)

View File

@ -1,25 +1,25 @@
package Scheme
// The type for the web logger viewer template
type Viewer struct {
Title string
SetLiveView bool
CurrentLevel string
CurrentTimeRange string
CurrentCategory string
CurrentImpact string
CurrentSeverity string
CurrentMessageName string
CurrentSender string
CurrentPage string
MessageNames []string
Sender []string
Events []LogEvent
}
// Type for a log event
type LogEvent struct {
LogLine string
LogLevel string // logwarn || logdebug || logerror || loginfo || logtalkative || logsecurity
AB string // loga || logb
}
package Scheme
// The type for the web logger viewer template
type Viewer struct {
Title string
SetLiveView bool
CurrentLevel string
CurrentTimeRange string
CurrentCategory string
CurrentImpact string
CurrentSeverity string
CurrentMessageName string
CurrentSender string
CurrentPage string
MessageNames []string
Sender []string
Events []LogEvent
}
// Type for a log event
type LogEvent struct {
LogLine string
LogLevel string // logwarn || logdebug || logerror || loginfo || logtalkative || logsecurity
AB string // loga || logb
}

View File

@ -1,7 +1,7 @@
package Templates
// The template for the web log viewer:
var Viewer string = `
var LoggingViewer string = `
{{define "WebLog"}}
<!DOCTYPE html>
<!-- This site was created in Webflow. http://www.webflow.com-->
@ -15,14 +15,14 @@ var Viewer string = `
{{end}}
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Webflow">
<link rel="stylesheet" type="text/css" href="/log/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/log/css/webflow.css">
<link rel="stylesheet" type="text/css" href="/log/css/log.css">
<script type="text/javascript" src="/log/js/modernizr.js"></script>
<link rel="stylesheet" type="text/css" href="/admin/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/admin/css/webflow.css">
<link rel="stylesheet" type="text/css" href="/admin/css/admin.css">
<script type="text/javascript" src="/admin/js/modernizr.js"></script>
</head>
<body>
<div class="headercontainer">
<h1>Logbook</h1>
<h1>Logging Viewer</h1>
</div>
<div class="controlsection">
<div class="w-row">
@ -131,8 +131,8 @@ var Viewer string = `
</div>
<div class="w-hidden-main w-hidden-medium newlineblock"></div><a class="button changepagebutton" href="#">+1</a><a class="button changepagebutton" href="#">Last</a>
</div>
<script type="text/javascript" src="/log/js/jquery.min.js"></script>
<script type="text/javascript" src="/log/js/webflow.js"></script>
<script type="text/javascript" src="/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/admin/js/webflow.js"></script>
</body>
</html>
{{end}}`

View File

@ -0,0 +1,36 @@
package Templates
var Overview = `
{{define "Overview"}}
<!DOCTYPE html>
<!-- This site was created in Webflow. http://www.webflow.com-->
<!-- Last Published: Mon Jun 22 2015 10:36:36 GMT+0000 (UTC) -->
<html data-wf-site="547b44aa3e9ac2216ec5d048" data-wf-page="5587d2abbf862f2179c4373b">
<head>
<meta charset="utf-8">
<title>Overview</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Webflow">
<link rel="stylesheet" type="text/css" href="/admin/css/normalize.css">
<link rel="stylesheet" type="text/css" href="/admin/css/webflow.css">
<link rel="stylesheet" type="text/css" href="/admin/css/admin.css">
<script type="text/javascript" src="/admin/js/modernizr.js"></script>
</head>
<body>
<div class="w-section headercontainer">
<h1>Administration</h1>
</div>
<div class="w-container adminsection">
<div class="w-row">
<div class="w-col w-col-4"><a class="button adminbutton" href="/log">Logging Viewer</a>
</div>
<div class="w-col w-col-4"></div>
<div class="w-col w-col-4"></div>
</div>
</div>
<script type="text/javascript" src="/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="/admin/js/webflow.js"></script>
</body>
</html>
{{end}}
`

11
Admin/Variables.go Normal file
View File

@ -0,0 +1,11 @@
package Admin
import (
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"html/template"
)
var (
AdminTemplates *template.Template = nil // The admin templates
senderName LM.Sender = `System::Admin` // This is the name for logging event from this package
)

View File

@ -1,10 +1,11 @@
package Web
import (
"github.com/SommerEngineering/Ocean/Admin"
"github.com/SommerEngineering/Ocean/Admin/Scheme"
"github.com/SommerEngineering/Ocean/Log"
"github.com/SommerEngineering/Ocean/Log/DeviceDatabase"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"github.com/SommerEngineering/Ocean/Log/Web/Scheme"
"github.com/SommerEngineering/Ocean/MimeTypes"
"github.com/SommerEngineering/Ocean/Shutdown"
"net/http"
@ -26,7 +27,7 @@ func HandlerWebLog(response http.ResponseWriter, request *http.Request) {
// Setup the data for the HTML template:
data := Scheme.Viewer{}
data.Title = `Web Log Viewer`
data.Title = `Logging Viewer`
data.Sender = DeviceDatabase.ReadSenderNames()
data.MessageNames = DeviceDatabase.ReadMessageNames()
@ -99,7 +100,7 @@ func HandlerWebLog(response http.ResponseWriter, request *http.Request) {
// Write the MIME type and execute the template:
MimeTypes.Write2HTTP(response, MimeTypes.TypeWebHTML)
if executeError := templates.ExecuteTemplate(response, `WebLog`, data); executeError != nil {
if executeError := Admin.AdminTemplates.ExecuteTemplate(response, `WebLog`, data); executeError != nil {
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactCritical, LM.MessageNameEXECUTE, `Was not able to execute the web log viewer template.`, executeError.Error())
}
}

View File

@ -3,8 +3,6 @@ package Web
import (
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
WebTemp "github.com/SommerEngineering/Ocean/Log/Web/Templates"
"html/template"
)
// The init function for this package.
@ -12,10 +10,4 @@ func init() {
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameINIT, `Init the web log.`)
defer Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameINIT, `Init the web log done.`)
// Create the cache of all web logging templates:
templates = template.New(`root`)
if _, err := templates.Parse(WebTemp.Viewer); err != nil {
Log.LogFull(senderName, LM.CategorySYSTEM, LM.LevelERROR, LM.SeverityCritical, LM.ImpactUnknown, LM.MessageNamePARSE, `Was not able to parse the template for the web log viewer.`, err.Error())
}
}

View File

@ -2,8 +2,8 @@ package Web
import (
"fmt"
"github.com/SommerEngineering/Ocean/Admin/Scheme"
"github.com/SommerEngineering/Ocean/Log/DeviceDatabase"
"github.com/SommerEngineering/Ocean/Log/Web/Scheme"
"strings"
)

View File

@ -2,8 +2,8 @@ package Web
import (
"fmt"
"github.com/SommerEngineering/Ocean/Admin/Scheme"
"github.com/SommerEngineering/Ocean/Log/DeviceDatabase"
"github.com/SommerEngineering/Ocean/Log/Web/Scheme"
"strings"
)

View File

@ -2,10 +2,8 @@ package Web
import (
LM "github.com/SommerEngineering/Ocean/Log/Meta"
"html/template"
)
var (
templates *template.Template = nil // The web logging templates
senderName LM.Sender = `System::WebLog` // This is the name for logging event from this package
senderName LM.Sender = `System::WebLog` // This is the name for logging event from this package
)

View File

@ -1,6 +1,7 @@
package System
import (
"github.com/SommerEngineering/Ocean/Admin"
"github.com/SommerEngineering/Ocean/BinaryAssets"
"github.com/SommerEngineering/Ocean/ConfigurationDB"
"github.com/SommerEngineering/Ocean/Handlers"
@ -51,17 +52,20 @@ func InitHandlers() {
// Handler for binary assets, used for the admin pages:
Handlers.AddAdminHandler(`/binaryAssets/`, BinaryAssets.HandlerBinaryAssets)
// Handler for the admin's overview:
Handlers.AddAdminHandler(`/`, Admin.HandlerOverview)
// Handler for the web logging:
Handlers.AddAdminHandler(`/log`, Web.HandlerWebLog)
// Handler for the web logging's CSS and JS:
Handlers.AddAdminHandler(`/log/css/normalize.css`, Web.HandlerCSSNormalize)
Handlers.AddAdminHandler(`/log/css/webflow.css`, Web.HandlerCSSWebflow)
Handlers.AddAdminHandler(`/log/css/log.css`, Web.HandlerCSSLog)
Handlers.AddAdminHandler(`/log/js/modernizr.js`, Web.HandlerJSModernizr)
Handlers.AddAdminHandler(`/log/js/jquery.min.js`, Web.HandlerJSjQuery)
Handlers.AddAdminHandler(`/log/js/jquery.min.map`, Web.HandlerJSjQueryMap)
Handlers.AddAdminHandler(`/log/js/webflow.js`, Web.HandlerJSWebflow)
Handlers.AddAdminHandler(`/admin/css/normalize.css`, Admin.HandlerCSSNormalize)
Handlers.AddAdminHandler(`/admin/css/webflow.css`, Admin.HandlerCSSWebflow)
Handlers.AddAdminHandler(`/admin/css/admin.css`, Admin.HandlerCSSAdmin)
Handlers.AddAdminHandler(`/admin/js/modernizr.js`, Admin.HandlerJSModernizr)
Handlers.AddAdminHandler(`/admin/js/jquery.min.js`, Admin.HandlerJSjQuery)
Handlers.AddAdminHandler(`/admin/js/jquery.min.map`, Admin.HandlerJSjQueryMap)
Handlers.AddAdminHandler(`/admin/js/webflow.js`, Admin.HandlerJSWebflow)
// Are the static files mapped to the public?
if ConfigurationDB.Read(`MapStaticFiles2Root`) == "true" {