Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
60e30da7e5 | ||
|
|
b05ae1c2d2 | ||
|
|
3b309500c3 | ||
|
|
bf2fbcb395 | ||
|
|
fb90a0b299 |
No files matched your search
+1
-1
@@ -186,7 +186,7 @@
|
|||||||
same "printed page" as the copyright notice for easier
|
same "printed page" as the copyright notice for easier
|
||||||
identification within third-party archives.
|
identification within third-party archives.
|
||||||
|
|
||||||
Copyright [yyyy] [name of copyright owner]
|
Copyright 2020 TwinProduction
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
+9
-5
@@ -9,10 +9,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
const (
|
||||||
Metrics bool `yaml:"metrics"`
|
DefaultConfigurationFilePath = "config/config.yaml"
|
||||||
Services []*core.Service `yaml:"services"`
|
)
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrNoServiceInConfig = errors.New("configuration file should contain at least 1 service")
|
ErrNoServiceInConfig = errors.New("configuration file should contain at least 1 service")
|
||||||
@@ -21,6 +20,11 @@ var (
|
|||||||
config *Config
|
config *Config
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
Metrics bool `yaml:"metrics"`
|
||||||
|
Services []*core.Service `yaml:"services"`
|
||||||
|
}
|
||||||
|
|
||||||
func Get() *Config {
|
func Get() *Config {
|
||||||
if config == nil {
|
if config == nil {
|
||||||
panic(ErrConfigNotLoaded)
|
panic(ErrConfigNotLoaded)
|
||||||
@@ -43,7 +47,7 @@ func Load(configFile string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LoadDefaultConfiguration() error {
|
func LoadDefaultConfiguration() error {
|
||||||
err := Load("config/config.yaml")
|
err := Load(DefaultConfigurationFilePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err == ErrConfigFileNotFound {
|
if err == ErrConfigFileNotFound {
|
||||||
return Load("config/config.yml")
|
return Load("config/config.yml")
|
||||||
|
|||||||
+2
-1
@@ -18,6 +18,7 @@ const (
|
|||||||
|
|
||||||
func sanitizeAndResolve(list []string, result *Result) []string {
|
func sanitizeAndResolve(list []string, result *Result) []string {
|
||||||
var sanitizedList []string
|
var sanitizedList []string
|
||||||
|
body := strings.TrimSpace(string(result.Body))
|
||||||
for _, element := range list {
|
for _, element := range list {
|
||||||
element = strings.TrimSpace(element)
|
element = strings.TrimSpace(element)
|
||||||
switch strings.ToUpper(element) {
|
switch strings.ToUpper(element) {
|
||||||
@@ -28,7 +29,7 @@ func sanitizeAndResolve(list []string, result *Result) []string {
|
|||||||
case ResponseTimePlaceHolder:
|
case ResponseTimePlaceHolder:
|
||||||
element = strconv.Itoa(int(result.Duration.Milliseconds()))
|
element = strconv.Itoa(int(result.Duration.Milliseconds()))
|
||||||
case BodyPlaceHolder:
|
case BodyPlaceHolder:
|
||||||
element = string(result.Body)
|
element = body
|
||||||
default:
|
default:
|
||||||
// if starts with BodyPlaceHolder, then evaluate json path
|
// if starts with BodyPlaceHolder, then evaluate json path
|
||||||
if strings.HasPrefix(element, BodyPlaceHolder) {
|
if strings.HasPrefix(element, BodyPlaceHolder) {
|
||||||
|
|||||||
+1
-4
@@ -11,9 +11,6 @@
|
|||||||
html {
|
html {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
body {
|
|
||||||
min-height: 100%;
|
|
||||||
}
|
|
||||||
#results div.container:first-child {
|
#results div.container:first-child {
|
||||||
border-top-left-radius: 3px;
|
border-top-left-radius: 3px;
|
||||||
border-top-right-radius: 3px;
|
border-top-right-radius: 3px;
|
||||||
@@ -150,7 +147,7 @@
|
|||||||
if (!userClickedStatus) {
|
if (!userClickedStatus) {
|
||||||
timerHandler = setTimeout(function () {
|
timerHandler = setTimeout(function () {
|
||||||
$("#tooltip").hide();
|
$("#tooltip").hide();
|
||||||
}, 2000);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user