mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-08 20:46:12 +08:00
All importers return progress object
This commit is contained in:
parent
0a39cdc582
commit
ae990e2b4b
8 changed files with 51 additions and 9 deletions
|
@ -45,7 +45,12 @@ PassmanImporter.clippers.readFile = function (file_data, callback) {
|
|||
if(_credential.label){
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
this.call_progress(i/json_objects.length*100);
|
||||
var progress = {
|
||||
percent: i/json_objects.length*100,
|
||||
loaded: i,
|
||||
total: json_objects.length
|
||||
};
|
||||
this.call_progress(progress);
|
||||
}
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
|
|
|
@ -35,7 +35,13 @@ PassmanImporter.dashLaneCsv.readFile = function (file_data, callback) {
|
|||
if(_credential.label){
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
this.call_progress(i/rows.length*100);
|
||||
|
||||
var progress = {
|
||||
percent: i/rows.length*100,
|
||||
loaded: i,
|
||||
total: rows.length
|
||||
};
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
});
|
||||
|
|
|
@ -35,7 +35,14 @@ PassmanImporter.keepassCsv.readFile = function (file_data, callback) {
|
|||
}
|
||||
_credential.tags = tags;
|
||||
credential_list.push(_credential);
|
||||
this.call_progress(i/parsed_csv.length*100);
|
||||
|
||||
var progress = {
|
||||
percent: i/parsed_csv.length*100,
|
||||
loaded: i,
|
||||
total: parsed_csv.length
|
||||
};
|
||||
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
});
|
||||
|
|
|
@ -27,7 +27,12 @@ PassmanImporter.lastpassCsv.readFile = function (file_data, callback) {
|
|||
if(_credential.label){
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
this.call_progress(i/parsed_csv.length*100);
|
||||
var progress = {
|
||||
percent: i/parsed_csv.length*100,
|
||||
loaded: i,
|
||||
total: parsed_csv.length
|
||||
};
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list)
|
||||
});
|
||||
|
|
|
@ -56,8 +56,13 @@ PassmanImporter.passmanJson.readFile = function (file_data, callback) {
|
|||
if(_credential.label){
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
var progress = {
|
||||
percent: i/parsed_json.length*100,
|
||||
loaded: i,
|
||||
total: parsed_json.length
|
||||
};
|
||||
|
||||
this.call_progress(i/parsed_json.length*100);
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
});
|
||||
|
|
|
@ -38,7 +38,14 @@ PassmanImporter.passpackCsv.readFile = function (file_data, callback) {
|
|||
if (_credential.label) {
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
this.call_progress(i/parsed_csv.length*100);
|
||||
|
||||
var progress = {
|
||||
percent: i/parsed_csv.length*100,
|
||||
loaded: i,
|
||||
total: parsed_csv.length
|
||||
};
|
||||
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
})
|
||||
|
|
|
@ -58,12 +58,12 @@ PassmanImporter.randomData.readFile = function (file_data, callback) {
|
|||
}
|
||||
credential_list.push(_credential);
|
||||
if (i <= max) {
|
||||
var values = {
|
||||
var progress = {
|
||||
percent: i / max * 100,
|
||||
loaded: i,
|
||||
total: max
|
||||
};
|
||||
_this.call_progress(values);
|
||||
_this.call_progress(progress);
|
||||
generateCredential(max, i + 1, callback)
|
||||
} else {
|
||||
callback(credential_list)
|
||||
|
|
|
@ -26,7 +26,14 @@ PassmanImporter.zohoCsv.readFile = function (file_data, callback) {
|
|||
if(_credential.label){
|
||||
credential_list.push(_credential);
|
||||
}
|
||||
this.call_progress(i/parsed_csv.length*100);
|
||||
|
||||
var progress = {
|
||||
percent: i/parsed_csv.length*100,
|
||||
loaded: i,
|
||||
total: parsed_csv.length
|
||||
};
|
||||
|
||||
this.call_progress(progress);
|
||||
}
|
||||
this.call_then(credential_list);
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue