Commit 179cacb0 authored by Tristan Cavelier's avatar Tristan Cavelier

dashboard repairAllDocs script added

parent 4f9d1ca6
......@@ -77,6 +77,7 @@
<button onclick="scriptLogLocalStorage()">log localStorage</button>
<button onclick="localStorage.clear()">clear localStorage</button>
<button onclick="scriptRemoveAllDocs()">removeAllDocs</button>
<button onclick="scriptRepairAllDocs()">repairAllDocs</button>
</div>
<hr />
<button onclick="clearlog()">Clear Log</button>
......@@ -383,6 +384,18 @@ function scriptRemoveAllDocs() {
}));
});
}
function scriptRepairAllDocs() {
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});
var ret = command("repair");
select('#metadata').value = original_metadata_value;
return ret;
}));
});
}
//-->
</script>
</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