Merge pull request #145 from PaulSec/master

Removed duplicate function update_values()
pull/148/merge
mokaddem 2017-10-20 17:11:39 +02:00 committed by GitHub
commit 1cea828ed7
2 changed files with 22 additions and 30 deletions

View File

@ -35,7 +35,7 @@ Installation
------------ ------------
Type these command lines for a fully automated installation and start AIL framework Type these command lines for a fully automated installation and start AIL framework
``` ```bash
git clone https://github.com/CIRCL/AIL-framework.git git clone https://github.com/CIRCL/AIL-framework.git
cd AIL-framework cd AIL-framework
./installing_deps.sh ./installing_deps.sh
@ -54,14 +54,14 @@ There is also a [Travis file](.travis.yml) used for automating the installation
Docker Quick Start (Ubuntu 16.04 LTS) Docker Quick Start (Ubuntu 16.04 LTS)
------------ ------------
1. Install Docker 1. Install Docker
``` ```bash
sudo su sudo su
apt-get install -y curl apt-get install -y curl
curl https://get.docker.com | /bin/bash curl https://get.docker.com | /bin/bash
``` ```
2. Type these commands to build the Docker image: 2. Type these commands to build the Docker image:
``` ```bash
git clone https://github.com/CIRCL/ail-framework git clone https://github.com/CIRCL/ail-framework
cd AIL-framework cd AIL-framework
docker build -t ail-framework . docker build -t ail-framework .
@ -72,12 +72,12 @@ docker run -p 7000:7000 ail-framework
``` ```
4. To debug the running container, type the following command and note the container name or identifier: 4. To debug the running container, type the following command and note the container name or identifier:
``` ```bash
docker ps docker ps
``` ```
After getting the name or identifier type the following commands: After getting the name or identifier type the following commands:
``` ```bash
docker exec -it CONTAINER_NAME_OR_IDENTIFIER bash docker exec -it CONTAINER_NAME_OR_IDENTIFIER bash
cd /opt/ail cd /opt/ail
``` ```
@ -88,7 +88,7 @@ Starting AIL web interface
To start the web interface, you first need to fetch the required Javascript/CSS files: To start the web interface, you first need to fetch the required Javascript/CSS files:
``` ```bash
cd $AILENV cd $AILENV
cd var/www/ cd var/www/
bash update_thirdparty.sh bash update_thirdparty.sh
@ -96,7 +96,7 @@ bash update_thirdparty.sh
and then you can start the web interface python script: and then you can start the web interface python script:
``` ```bash
cd $AILENV cd $AILENV
cd var/www/ cd var/www/
Flask_server.py Flask_server.py
@ -104,7 +104,9 @@ Flask_server.py
Eventually you can browse the status of the AIL framework website at the following URL: Eventually you can browse the status of the AIL framework website at the following URL:
``http://localhost:7000/`` ```
http://localhost:7000/
```
HOWTO HOWTO
----- -----

View File

@ -1,5 +1,5 @@
var time_since_last_pastes_num = {}; var time_since_last_pastes_num = {};
var data_for_processed_paste = { }; var data_for_processed_paste = {};
var list_feeder = []; var list_feeder = [];
window.paste_num_tabvar_all = {}; window.paste_num_tabvar_all = {};
@ -22,17 +22,17 @@ function checkIfReceivedData(){
function initfunc( csvay, scroot) { function initfunc( csvay, scroot) {
window.csv = csvay; window.csv = csvay;
window.scroot = scroot; window.scroot = scroot;
}; };
function update_values() { function update_values() {
$SCRIPT_ROOT = window.scroot ; $SCRIPT_ROOT = window.scroot ;
$.getJSON($SCRIPT_ROOT+"/_stuff", $.getJSON($SCRIPT_ROOT+"/_stuff",
function(data) { function(data) {
window.glob_tabvar = data; window.glob_tabvar = data;
}); });
}; }
// Plot and update the number of processed pastes // Plot and update the number of processed pastes
@ -43,9 +43,9 @@ function update_values() {
function fetch_data(dataset, curr_data, feeder_name) { function fetch_data(dataset, curr_data, feeder_name) {
if (curr_data.length > 0){ if (curr_data.length > 0){
var data_old = curr_data[0]; var data_old = curr_data[0];
curr_data = curr_data.slice(1); curr_data = curr_data.slice(1);
curr_max[dataset] = curr_max[dataset] == data_old ? Math.max.apply(null, curr_data) : curr_max[dataset]; curr_max[dataset] = curr_max[dataset] == data_old ? Math.max.apply(null, curr_data) : curr_max[dataset];
} }
while (curr_data.length < totalPoints) { while (curr_data.length < totalPoints) {
@ -124,14 +124,6 @@ function initfunc( csvay, scroot) {
window.scroot = scroot; window.scroot = scroot;
}; };
function update_values() {
$SCRIPT_ROOT = window.scroot ;
$.getJSON($SCRIPT_ROOT+"/_stuff",
function(data) {
window.glob_tabvar = data;
});
};
var source = new EventSource('/_logs'); var source = new EventSource('/_logs');
source.onmessage = function(event) { source.onmessage = function(event) {
@ -139,9 +131,8 @@ source.onmessage = function(event) {
create_log_table(feed); create_log_table(feed);
}; };
function pad_2(number) function pad_2(number) {
{ return (number < 10 ? '0' : '') + number;
return (number < 10 ? '0' : '') + number;
} }
function create_log_table(obj_json) { function create_log_table(obj_json) {
@ -187,7 +178,6 @@ function create_log_table(obj_json) {
window.paste_num_tabvar_all["global"] = paste_processed; window.paste_num_tabvar_all["global"] = paste_processed;
time_since_last_pastes_num["global"] = new Date().getTime(); time_since_last_pastes_num["global"] = new Date().getTime();
} else { } else {
if (list_feeder.indexOf(feeder) == -1) { if (list_feeder.indexOf(feeder) == -1) {
list_feeder.push(feeder); list_feeder.push(feeder);
data_for_processed_paste["Proc"+feeder] = Array(totalPoints+1).join(0).split(''); data_for_processed_paste["Proc"+feeder] = Array(totalPoints+1).join(0).split('');
@ -282,7 +272,7 @@ function create_log_table(obj_json) {
}; };
var sel = document.getElementById("log_select") var sel = document.getElementById("log_select")
if (tableBody.rows.length > sel.options[sel.options.selectedIndex].value){ if (tableBody.rows.length > sel.options[sel.options.selectedIndex].value) {
while (tableBody.rows.length != sel.options[sel.options.selectedIndex].value){ while (tableBody.rows.length != sel.options[sel.options.selectedIndex].value){
tableBody.deleteRow(0); tableBody.deleteRow(0);
} }