Merge pull request #9 from cloudflare/js-fixes

Js fixes
This commit is contained in:
Łukasz Mierzwa
2017-03-27 10:40:46 -07:00
committed by GitHub
6 changed files with 18 additions and 11 deletions

View File

@@ -42,7 +42,12 @@ clean:
.PHONY: run
run: $(NAME)
DEBUG=true ALERTMANAGER_URI=$(ALERTMANAGER_URI) PORT=$(PORT) ./$(NAME)
DEBUG=true \
ALERTMANAGER_URI=$(ALERTMANAGER_URI) \
COLOR_LABELS_UNIQUE="instance" \
COLOR_LABELS_STATIC="job" \
PORT=$(PORT) \
./$(NAME)
.PHONY: docker-image
docker-image: bindata_assetfs.go
@@ -54,6 +59,8 @@ run-docker: docker-image
docker run \
--name $(NAME) \
-e ALERTMANAGER_URI=$(ALERTMANAGER_URI) \
-e COLOR_LABELS_UNIQUE="instance" \
-e COLOR_LABELS_STATIC="job" \
-e PORT=$(PORT) \
-p $(PORT):$(PORT) \
$(NAME):$(VERSION)

View File

@@ -46,7 +46,7 @@ var Colors = (function() {
}
isStaticLabel = function(key) {
return ($.inArray(key, getStaticLabels()) >= 0);
return ($.inArray(key, Colors.GetStaticLabels()) >= 0);
}
init = function(staticColors) {

View File

@@ -107,7 +107,7 @@ var Config = (function() {
// reset settings button action
$(params.ResetSelector).on('click', function(elem) {
reset();
Config.Reset();
location.reload();
});

View File

@@ -66,7 +66,7 @@ var Counter = (function(params) {
bgColor: '#333',
textColor: '#ff0'
});
setUnknown();
Counter.Unknown();
}

View File

@@ -22,13 +22,13 @@ var Progress = (function() {
complete = function() {
resetTimer();
Progress.ResetTimer();
NProgress.done();
}
pause = function() {
resetTimer();
Progress.ResetTimer();
NProgress.set(0.0);
}
@@ -37,7 +37,7 @@ var Progress = (function() {
var step_ms = 250; // animation step in ms
var steps = (Unsee.GetRefreshRate() * 1000) / step_ms; // how many steps we have
NProgress.set(0.0);
resetTimer();
Progress.ResetTimer();
timer = setInterval(function() {
NProgress.inc(1.0 / steps);
}, step_ms);

File diff suppressed because one or more lines are too long