You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2026-05-22 09:05:38 +02:00
Status screen
This commit is contained in:
@@ -56,12 +56,16 @@ class BaseItem extends BaseModel {
|
||||
synced: syncedCount,
|
||||
};
|
||||
|
||||
output.toDelete = {
|
||||
total: await this.deletedItemCount(),
|
||||
};
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static async syncedCount() {
|
||||
const ItemClass = this.itemClass(this.modelType());
|
||||
const r = await this.db().selectOne('SELECT count(*) as total FROM `' + ItemClass.tableName() + '` WHERE updated_time > sync_time');
|
||||
const r = await this.db().selectOne('SELECT count(*) as total FROM `' + ItemClass.tableName() + '` WHERE updated_time <= sync_time');
|
||||
return r.total;
|
||||
}
|
||||
|
||||
@@ -143,6 +147,11 @@ class BaseItem extends BaseModel {
|
||||
return this.db().selectAll('SELECT * FROM deleted_items');
|
||||
}
|
||||
|
||||
static async deletedItemCount() {
|
||||
let r = await this.db().selectOne('SELECT count(*) as total FROM deleted_items');
|
||||
return r['total'];
|
||||
}
|
||||
|
||||
static remoteDeletedItem(itemId) {
|
||||
return this.db().exec('DELETE FROM deleted_items WHERE item_id = ?', [itemId]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user