Commit 7982a0ac authored by Tristan Cavelier's avatar Tristan Cavelier

jio_dashboard.html updated

parent 37761727
...@@ -44,42 +44,42 @@ var clearlog = function () { ...@@ -44,42 +44,42 @@ var clearlog = function () {
</script> </script>
<table border="1" style="width: 100%;"> <table border="1" style="width: 100%;">
<tr style="font-style:italic;"> <tr style="font-style:italic;">
<th>simple storage</th><th>multi storage</th><th>distant storage</th> <th>simple storage</th><!-- <th>multi storage</th><th>distant storage</th> -->
<th>revision managing</th><th>custom storage description</th> <!-- <th>revision managing</th> --><th>custom storage description</th>
</tr> </tr>
<tr> <tr>
<th>local</th><th>crypt & local</th><th>dav</th> <th>local</th><!-- <th>crypt & local</th><th>dav</th> -->
<th>revision & local</th><th>custom</th> <!-- <th>revision & local</th> --><th>custom</th>
</tr> </tr>
<tr> <tr>
<th> <th>
<input type="text" id="localuser" value="localuser" placeholder="username" /><br /> <input type="text" id="localuser" value="localuser" placeholder="username" /><br />
<input type="text" id="localapp" value="localapp" placeholder="application_name" /><br /> <input type="text" id="localapp" value="localapp" placeholder="application_name" /><br />
</th> </th>
<th> <!-- <th> -->
<input type="text" id="cryptuser" value="cryptuser" placeholder="username" /><br /> <!-- <input type="text" id="cryptuser" value="cryptuser" placeholder="username" /><br /> -->
<input type="text" id="cryptapp" value="cryptapp" placeholder="application_name" /><br /> <!-- <input type="text" id="cryptapp" value="cryptapp" placeholder="application_name" /><br /> -->
<input type="password" id="cryptpassword" value="pwd" placeholder="password" /><br /> <!-- <input type="password" id="cryptpassword" value="pwd" placeholder="password" /><br /> -->
</th> <!-- </th> -->
<th> <!-- <th> -->
<input type="text" id="davurl" value="http://dav.com/uploads" placeholder="url" /><br /> <!-- <input type="text" id="davurl" value="http://dav.com/uploads" placeholder="url" /><br /> -->
<input type="text" id="davauthtype" value="basic" placeholder="auth_type" disabled /> <br /> <!-- <input type="text" id="davauthtype" value="basic" placeholder="auth_type" disabled /> <br /> -->
<input type="text" id="davuser" value="davuser" placeholder="username" /><br /> <!-- <input type="text" id="davuser" value="davuser" placeholder="username" /><br /> -->
<input type="password" id="davpassword" value="pwd" placeholder="password" /><br /> <!-- <input type="password" id="davpassword" value="pwd" placeholder="password" /><br /> -->
</th> <!-- </th> -->
<th> <!-- <th> -->
<input type="text" id="revisionuser" value="localuser" placeholder="username" /><br /> <!-- <input type="text" id="revisionuser" value="localuser" placeholder="username" /><br /> -->
<input type="text" id="revisionapp" value="localapp" placeholder="application_name" /><br /> <!-- <input type="text" id="revisionapp" value="localapp" placeholder="application_name" /><br /> -->
</th> <!-- </th> -->
<th style="width:100%;"> <th style="width:100%;">
<textarea id="customstorage" style="width:98%;">{&quot;type&quot;:&quot;local&quot;,&quot;username&quot;:&quot;customuser&quot;,&quot;application_name&quot;:&quot;customapp&quot;,&quot;customkey&quot;:&quot;customvalue&quot;}</textarea> <textarea id="customstorage" style="width:98%;">{&quot;type&quot;:&quot;local&quot;,&quot;username&quot;:&quot;customuser&quot;,&quot;application_name&quot;:&quot;customapp&quot;,&quot;customkey&quot;:&quot;customvalue&quot;}</textarea>
</th> </th>
</tr> </tr>
<tr> <tr>
<th><button onclick="newLocalJio()">Create New jIO</button></th> <th><button onclick="newLocalJio()">Create New jIO</button></th>
<th><button onclick="newCryptJio()">Create New jIO</button></th> <!-- <th><button onclick="newCryptJio()">Create New jIO</button></th> -->
<th><button onclick="newDavJio()">Create New jIO</button></th> <!-- <th><button onclick="newDavJio()">Create New jIO</button></th> -->
<th><button onclick="newRevisionJio()">Create New jIO</button></th> <!-- <th><button onclick="newRevisionJio()">Create New jIO</button></th> -->
<th><button onclick="newCustomJio()">Create New jIO</button></th> <th><button onclick="newCustomJio()">Create New jIO</button></th>
</tr> </tr>
</table> </table>
...@@ -149,86 +149,26 @@ var clearlog = function () { ...@@ -149,86 +149,26 @@ var clearlog = function () {
<hr /> <hr />
<div id="log"> <div id="log">
</div> </div>
<script type="text/javascript" src="../src/md5.amd.js"></script> <script src="../src/sha256.amd.js"></script>
<script type="text/javascript" src="../complex_queries.js"></script> <script src="../jio.js"></script>
<script type="text/javascript" src="../jio.js"></script> <script src="../complex_queries.js"></script>
<script type="text/javascript" src="../src/jio.storage/localstorage.js"> <script src="../src/jio.storage/localstorage.js"></script>
</script> <script src="../lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../lib/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../src/jio.storage/davstorage.js">
</script>
<script type="text/javascript" src="../src/jio.storage/erp5storage.js">
</script>
<script type="text/javascript" src="../src/sha256.amd.js"></script>
<script type="text/javascript" src="../src/jio.storage/revisionstorage.js">
</script>
<script type="text/javascript" src="../src/jio.storage/splitstorage.js">
</script>
<script type="text/javascript" src="../src/jio.storage/gidstorage.js">
</script>
<script type="text/javascript" src="../src/jio.storage/indexstorage.js">
</script>
<script type="text/javascript" src="../lib/sjcl/sjcl.min.js"></script>
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
var my_jio = null; var my_jio = null;
var newLocalJio = function () { function newLocalJio() {
var localuser, localapp; var spec = local_storage.createDescription($('#localuser').val(),
localuser = $('#localuser').val(); $('#localapp').val());
localapp = $('#localapp').val();
var spec = {type: 'local', username: localuser, application_name: localapp};
if (my_jio) { log('closing older jio'); my_jio.close(); }
log('local storage description object: ' + JSON.stringify(spec)); log('local storage description object: ' + JSON.stringify(spec));
my_jio = jIO.newJio(spec); my_jio = jIO.createJIO(spec);
};
var newCryptJio = function () {
var user, app, pwd;
user = $('#cryptuser').val();
app = $('#cryptapp').val();
pwd = $('#cryptpassword').val();
var spec = {type: 'crypt', username: user, password: pwd, storage:{
type: 'local', username: user, application_name: app
}};
if (my_jio) { log('closing older jio'); my_jio.close(); }
log('crypt storage description object: ' + JSON.stringify(spec));
my_jio = jIO.newJio(spec);
};
var newDavJio = function () {
var user, app, pwd, url;
user = $('#davuser').val();
pwd = $('#davpassword').val();
url = $('#davurl').val();
var spec = {
"type": "dav",
"url": url,
"auth_type": "basic",
"username": user,
"password": pwd
};
if (my_jio) { log('closing older jio'); my_jio.close(); }
log('dav storage description object: ' + JSON.stringify(spec));
my_jio = jIO.newJio(spec);
};
var newRevisionJio = function () {
var user, app;
user = $('#revisionuser').val();
app = $('#revisionapp').val();
var spec = {
type: 'revision', sub_storage: {
type: 'local', username: user, application_name: app
}
};
if (my_jio) { log('closing older jio'); my_jio.close(); }
log('revision storage description object: '+JSON.stringify(spec));
my_jio = jIO.newJio(spec);
}; };
var newCustomJio = function () { function newCustomJio() {
var spec = JSON.parse ($('#customstorage').val()); var spec = JSON.parse($('#customstorage').val());
if (my_jio) { log('closing older jio'); my_jio.close(); }
log('custom storage description object: '+JSON.stringify(spec)); log('custom storage description object: '+JSON.stringify(spec));
my_jio = jIO.newJio(spec); my_jio = jIO.newJio(spec);
}; };
var printLocalStorage = function () { function printLocalStorage() {
var i; var i;
log('LOCALSTORAGE'); log('LOCALSTORAGE');
for (i in localStorage) { for (i in localStorage) {
...@@ -236,14 +176,14 @@ var printLocalStorage = function () { ...@@ -236,14 +176,14 @@ var printLocalStorage = function () {
} }
log('------------------------------'); log('------------------------------');
}; };
var callback = function (err, val, begin_date) { function callback(err, val, begin_date) {
log('time : ' + (Date.now() - begin_date)); log('time : ' + (Date.now() - begin_date));
if (err) { if (err) {
return error('return :' + JSON.stringify(err)); return error('return :' + JSON.stringify(err));
} }
log('return : ' + JSON.stringify(val)); log('return : ' + JSON.stringify(val));
}; };
var command = function (method) { function command(method) {
var begin_date = Date.now(), doc = {}, opts = {}; var begin_date = Date.now(), doc = {}, opts = {};
log(method); log(method);
if (!my_jio) { if (!my_jio) {
...@@ -270,28 +210,28 @@ var command = function (method) { ...@@ -270,28 +210,28 @@ var command = function (method) {
callback(err, val, begin_date); callback(err, val, begin_date);
}); });
}; };
var post = function () { function post() {
command('post'); command('post');
}; };
var put = function () { function put() {
command('put'); command('put');
}; };
var get = function () { function get() {
command('get'); command('get');
}; };
var remove = function () { function remove() {
command('remove'); command('remove');
}; };
var allDocs = function () { function allDocs() {
command('allDocs'); command('allDocs');
}; };
var putAttachment = function () { function putAttachment() {
command('putAttachment'); command('putAttachment');
}; };
var getAttachment = function () { function getAttachment() {
command('getAttachment'); command('getAttachment');
}; };
var removeAttachment = function () { function removeAttachment() {
command('removeAttachment'); command('removeAttachment');
}; };
//--> //-->
......
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