From 48fc8e346441ea0eb828c2429d4d65a888e96ea2 Mon Sep 17 00:00:00 2001 From: Paul A Date: Fri, 20 Oct 2017 15:32:58 +0200 Subject: [PATCH 1/3] Removed duplicate function --- var/www/static/js/indexjavascript.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/var/www/static/js/indexjavascript.js b/var/www/static/js/indexjavascript.js index 47013634..0c45622e 100644 --- a/var/www/static/js/indexjavascript.js +++ b/var/www/static/js/indexjavascript.js @@ -27,12 +27,12 @@ function initfunc( csvay, scroot) { }; function update_values() { - $SCRIPT_ROOT = window.scroot ; + $SCRIPT_ROOT = window.scroot ; $.getJSON($SCRIPT_ROOT+"/_stuff", function(data) { window.glob_tabvar = data; - }); - }; + }); +} // Plot and update the number of processed pastes @@ -124,14 +124,6 @@ function initfunc( csvay, 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'); source.onmessage = function(event) { From f6b6777095447e0b401dd55e04c64d632b515407 Mon Sep 17 00:00:00 2001 From: Paul A Date: Fri, 20 Oct 2017 15:44:09 +0200 Subject: [PATCH 2/3] Fixed some code for the JavaScript (coding-style) --- var/www/static/js/indexjavascript.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/var/www/static/js/indexjavascript.js b/var/www/static/js/indexjavascript.js index 0c45622e..8f9db82c 100644 --- a/var/www/static/js/indexjavascript.js +++ b/var/www/static/js/indexjavascript.js @@ -1,5 +1,5 @@ var time_since_last_pastes_num = {}; -var data_for_processed_paste = { }; +var data_for_processed_paste = {}; var list_feeder = []; window.paste_num_tabvar_all = {}; @@ -22,8 +22,8 @@ function checkIfReceivedData(){ function initfunc( csvay, scroot) { - window.csv = csvay; - window.scroot = scroot; + window.csv = csvay; + window.scroot = scroot; }; function update_values() { @@ -43,9 +43,9 @@ function update_values() { function fetch_data(dataset, curr_data, feeder_name) { if (curr_data.length > 0){ - var data_old = curr_data[0]; - curr_data = curr_data.slice(1); - curr_max[dataset] = curr_max[dataset] == data_old ? Math.max.apply(null, curr_data) : curr_max[dataset]; + var data_old = curr_data[0]; + curr_data = curr_data.slice(1); + curr_max[dataset] = curr_max[dataset] == data_old ? Math.max.apply(null, curr_data) : curr_max[dataset]; } while (curr_data.length < totalPoints) { @@ -131,9 +131,8 @@ source.onmessage = function(event) { create_log_table(feed); }; -function pad_2(number) -{ - return (number < 10 ? '0' : '') + number; +function pad_2(number) { + return (number < 10 ? '0' : '') + number; } function create_log_table(obj_json) { @@ -179,7 +178,6 @@ function create_log_table(obj_json) { window.paste_num_tabvar_all["global"] = paste_processed; time_since_last_pastes_num["global"] = new Date().getTime(); } else { - if (list_feeder.indexOf(feeder) == -1) { list_feeder.push(feeder); data_for_processed_paste["Proc"+feeder] = Array(totalPoints+1).join(0).split(''); @@ -274,7 +272,7 @@ function create_log_table(obj_json) { }; 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){ tableBody.deleteRow(0); } From 795d8c8f53cdfd309c1320a57e6475eb3283e18c Mon Sep 17 00:00:00 2001 From: Paul A Date: Fri, 20 Oct 2017 15:56:14 +0200 Subject: [PATCH 3/3] Modified the README.md --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8be9cf13..9c3e3c9e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Installation ------------ Type these command lines for a fully automated installation and start AIL framework -``` +```bash git clone https://github.com/CIRCL/AIL-framework.git cd AIL-framework ./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) ------------ 1. Install Docker -``` +```bash sudo su apt-get install -y curl curl https://get.docker.com | /bin/bash ``` 2. Type these commands to build the Docker image: -``` +```bash git clone https://github.com/CIRCL/ail-framework cd 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: -``` +```bash docker ps ``` After getting the name or identifier type the following commands: -``` +```bash docker exec -it CONTAINER_NAME_OR_IDENTIFIER bash 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: -``` +```bash cd $AILENV cd var/www/ bash update_thirdparty.sh @@ -96,7 +96,7 @@ bash update_thirdparty.sh and then you can start the web interface python script: -``` +```bash cd $AILENV cd var/www/ 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: - ``http://localhost:7000/`` +``` +http://localhost:7000/ +``` HOWTO -----