Compare commits

..

6 Commits

Author SHA1 Message Date
TwinProduction
98221626d3 Fix issue with json path when expected path doesn't match actual path 2020-07-24 13:20:28 -04:00
TwinProduction
60e30da7e5 Trim result body as well 2020-07-24 12:46:43 -04:00
TwinProduction
b05ae1c2d2 Minor improvement 2020-06-25 21:31:34 -04:00
TwinProduction
3b309500c3 Decrease tooltip fade timer from 2s to 500ms 2020-05-01 17:22:30 -04:00
TwinProduction
bf2fbcb395 Fix issue with scrollbar always showing 2020-04-26 23:59:30 -04:00
TwinProduction
fb90a0b299 Minor update 2020-04-22 23:54:30 -04:00
5 changed files with 16 additions and 11 deletions

View File

@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2020 TwinProduction
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -9,10 +9,9 @@ import (
"os"
)
type Config struct {
Metrics bool `yaml:"metrics"`
Services []*core.Service `yaml:"services"`
}
const (
DefaultConfigurationFilePath = "config/config.yaml"
)
var (
ErrNoServiceInConfig = errors.New("configuration file should contain at least 1 service")
@@ -21,6 +20,11 @@ var (
config *Config
)
type Config struct {
Metrics bool `yaml:"metrics"`
Services []*core.Service `yaml:"services"`
}
func Get() *Config {
if config == nil {
panic(ErrConfigNotLoaded)
@@ -43,7 +47,7 @@ func Load(configFile string) error {
}
func LoadDefaultConfiguration() error {
err := Load("config/config.yaml")
err := Load(DefaultConfigurationFilePath)
if err != nil {
if err == ErrConfigFileNotFound {
return Load("config/config.yml")

View File

@@ -18,6 +18,7 @@ const (
func sanitizeAndResolve(list []string, result *Result) []string {
var sanitizedList []string
body := strings.TrimSpace(string(result.Body))
for _, element := range list {
element = strings.TrimSpace(element)
switch strings.ToUpper(element) {
@@ -28,7 +29,7 @@ func sanitizeAndResolve(list []string, result *Result) []string {
case ResponseTimePlaceHolder:
element = strconv.Itoa(int(result.Duration.Milliseconds()))
case BodyPlaceHolder:
element = string(result.Body)
element = body
default:
// if starts with BodyPlaceHolder, then evaluate json path
if strings.HasPrefix(element, BodyPlaceHolder) {

View File

@@ -52,6 +52,9 @@ func extractValue(currentKey string, value interface{}) interface{} {
}
return nil
}
if value == nil || value.(map[string]interface{})[currentKey] == nil {
return nil
}
// if currentKey contains both a key and an index (i.e. data[0])
array := value.(map[string]interface{})[currentKey].([]interface{})
if len(array) > arrayIndex {

View File

@@ -11,9 +11,6 @@
html {
height: 100%;
}
body {
min-height: 100%;
}
#results div.container:first-child {
border-top-left-radius: 3px;
border-top-right-radius: 3px;
@@ -150,7 +147,7 @@
if (!userClickedStatus) {
timerHandler = setTimeout(function () {
$("#tooltip").hide();
}, 2000);
}, 500);
}
}