Commit 594bb104 authored by Tristan Cavelier's avatar Tristan Cavelier

add useful functions to jio dashboard

parent 4fe2c534
...@@ -268,10 +268,6 @@ function createJIO() { ...@@ -268,10 +268,6 @@ function createJIO() {
} }
} }
function printLocalStorage() {
log("localStorage content\n" + JSON.stringify(localStorage, null, " "));
}
function logError(begin_date, err) { function logError(begin_date, err) {
log('time : ' + (Date.now() - begin_date)); log('time : ' + (Date.now() - begin_date));
error('return :' + JSON.stringify(err, null, " ")); error('return :' + JSON.stringify(err, null, " "));
...@@ -365,6 +361,25 @@ function check() { ...@@ -365,6 +361,25 @@ function check() {
function repair() { function repair() {
return doCommandNTimes("repair"); return doCommandNTimes("repair");
} }
//////////////////////////////////////////////////////////////////////
// scripts
function scriptLogLocalStorage() {
log("localStorage content\n" + JSON.stringify(localStorage, null, " "));
}
function scriptRemoveAllDocs() {
var original_metadata_value = select('#metadata').value;
return command("allDocs").then(function (answer) {
return RSVP.all(answer.data.rows.map(function (row) {
select("#metadata").value = JSON.stringify({"_id": row.id});
return command("remove");
}));;
}).then(function () {
select('#metadata').value = original_metadata_value;
});
}
//--> //-->
</script> </script>
</body> </body>
......
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