diff --git a/Admin/Assets/CSSAdmin.go b/Admin/Assets/CSSAdmin.go index a4884b9..abfc0ba 100644 --- a/Admin/Assets/CSSAdmin.go +++ b/Admin/Assets/CSSAdmin.go @@ -259,6 +259,14 @@ p { .adminitemlog { padding-top: 14px; } +.columns { + padding-right: 10px; + padding-left: 10px; + text-align: left; +} +.filterformcontainer { + text-align: center; +} @media (max-width: 991px) { .icons.oneback { margin-left: 113px; diff --git a/Admin/Scheme/LogEvent.go b/Admin/Scheme/LogEvent.go new file mode 100644 index 0000000..27c54e9 --- /dev/null +++ b/Admin/Scheme/LogEvent.go @@ -0,0 +1,8 @@ +package Scheme + +// Type for a log event +type LogEvent struct { + LogLine string + LogLevel string // logwarn || logdebug || logerror || loginfo || logtalkative || logsecurity + AB string // loga || logb +} diff --git a/Admin/Scheme/LoggingViewer.go b/Admin/Scheme/LoggingViewer.go new file mode 100644 index 0000000..576ca32 --- /dev/null +++ b/Admin/Scheme/LoggingViewer.go @@ -0,0 +1,73 @@ +package Scheme + +import ( + "html/template" +) + +// The type for the web logger viewer template +type LoggingViewer struct { + Title string + SetLiveView bool + CurrentLevel string + CurrentTimeRange string + CurrentCategory string + CurrentImpact string + CurrentSeverity string + CurrentMessageName string + CurrentSender string + CurrentPage string + MessageNames []MessageNames + Sender []Sender + Events []LogEvent +} + +// The type for the message names is necessary to be able to define a function on it. +type MessageNames string + +// The type for the senders is necessary to be able to define a function on it. +type Sender string + +// This function is used from the template to mark selected values. This is for the type MessageNames. +func (lv MessageNames) IsSelected(field MessageNames, currentValue string) string { + if string(field) == currentValue { + return ` selected` + } else { + return `` + } +} + +// This function is necessary to mark the HTML attribute as safe. Only then it is possible +// to change plain HTML code. +func (lv MessageNames) Safe(element string) template.HTMLAttr { + return template.HTMLAttr(element) +} + +// This function is used from the template to mark selected values. This is for the type Sender. +func (lv Sender) IsSelected(field Sender, currentValue string) string { + if string(field) == currentValue { + return ` selected` + } else { + return `` + } +} + +// This function is necessary to mark the HTML attribute as safe. Only then it is possible +// to change plain HTML code. +func (lv Sender) Safe(element string) template.HTMLAttr { + return template.HTMLAttr(element) +} + +// This function is used from the template to mark selected values. +func (lv LoggingViewer) IsSelected(field, currentValue string) string { + if field == currentValue { + return ` selected` + } else { + return `` + } +} + +// This function is necessary to mark the HTML attribute as safe. Only then it is possible +// to change plain HTML code. +func (lv LoggingViewer) Safe(element string) template.HTMLAttr { + return template.HTMLAttr(element) +} diff --git a/Admin/Scheme/Scheme.go b/Admin/Scheme/Scheme.go deleted file mode 100644 index 1a6b043..0000000 --- a/Admin/Scheme/Scheme.go +++ /dev/null @@ -1,25 +0,0 @@ -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 -} diff --git a/Admin/Templates/LoggingViewer.go b/Admin/Templates/LoggingViewer.go index 68a3f5f..a0cbda5 100644 --- a/Admin/Templates/LoggingViewer.go +++ b/Admin/Templates/LoggingViewer.go @@ -11,7 +11,7 @@ var LoggingViewer string = `
Thank you! Your submission has been received!
+Oops! Something went wrong while submitting the form :(