Commit 13c35ce3 authored by Tristan Cavelier's avatar Tristan Cavelier

jio dashboard metadata field improved

You can now affect the value of "times" field in some metadata
field. Every '\u0000' found in this field will be replaced by the
"times" value from 0 to n.
parent 594886ae
...@@ -280,15 +280,23 @@ function callback(err, val, begin_date) { ...@@ -280,15 +280,23 @@ function callback(err, val, begin_date) {
log('return : ' + JSON.stringify(val, null, " ")); log('return : ' + JSON.stringify(val, null, " "));
} }
function command(method) { function command(method, num) {
var begin_date = Date.now(), doc = {}, opts = {}; var begin_date = Date.now(), doc = {}, opts = {};
if (!my_jio) { if (!my_jio) {
return error('no jio set'); return error('no jio set');
} }
doc = JSON.parse(select('#metadata').value); doc = select('#metadata').value;
opts = JSON.parse(select("#options").value); opts = select("#options").value;
if (num !== undefined) {
doc = doc.replace(/\\u0000/g, num);
opts = opts.replace(/\\u0000/g, num);
}
doc = JSON.parse(doc);
opts = JSON.parse(opts);
log(method + '\ndoc: ' + JSON.stringify(doc, null, " ") + log(method + '\ndoc: ' + JSON.stringify(doc, null, " ") +
'\nopts: ' + JSON.stringify(opts, null, " ")); '\nopts: ' + JSON.stringify(opts, null, " "));
...@@ -319,7 +327,7 @@ function doCommandNTimes(method) { ...@@ -319,7 +327,7 @@ function doCommandNTimes(method) {
n = 1; n = 1;
} }
while (++i < n) { while (++i < n) {
command(method); command(method, i);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment