Use a variable for the default machine id

This commit is contained in:
Benjamin Bouvier 2014-01-06 13:14:28 +01:00
Родитель 2e26dbfcbd
Коммит 5033fe93af
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -70,4 +70,4 @@ There is also a `monitor.py` script provided in the server folder. You can run t
Website
-------
Nothing special needed, just place the static files somewhere. Note that AWFY's flot is slightly modified, so it might not work to just replace it with upstream flot. There must be a 'data' folder that contains the json/js files dumped by `update.py`. It can be a symlink.
Nothing special needed, just place the static files somewhere. Don't forget to replace the default machine number in website/awfy.js, which is the one that will show up in the first place. Note that AWFY's flot is slightly modified, so it might not work to just replace it with upstream flot. There must be a 'data' folder that contains the json/js files dumped by `update.py`. It can be a symlink.

Просмотреть файл

@ -5,6 +5,7 @@
"use strict";
var AWFY = { };
AWFY.DEFAULT_MACHINE_ID = 11;
AWFY.refreshTime = 60 * 5;
AWFY.machineId = 0;
AWFY.hasLegend = false;
@ -627,7 +628,7 @@ AWFY.parseURL = function () {
if ('machine' in this.queryParams)
machineId = parseInt(this.queryParams['machine']);
else
machineId = 11;
machineId = this.DEFAULT_MACHINE_ID;
var view = this.queryParams['view'];
if (!view || (view != 'overview' && view != 'breakdown'))