diff options
author | BlackDex <[email protected]> | 2023-02-28 20:43:22 +0100 |
---|---|---|
committer | BlackDex <[email protected]> | 2023-02-28 20:43:22 +0100 |
commit | f10e6b6ac2edbdaab3b4ddad1328ef77c65ba02c (patch) | |
tree | 93ba014bcd89e77bdd4b61e05057b12fe3600a90 /src/db/models/event.rs | |
parent | af6d17b7013d4d82fac916cb867c0dd97da9c301 (diff) | |
download | vaultwarden-f10e6b6ac2edbdaab3b4ddad1328ef77c65ba02c.tar.gz vaultwarden-f10e6b6ac2edbdaab3b4ddad1328ef77c65ba02c.zip |
Some Admin Interface updates
- Updated datatables
- Added NTP Time check
- Added Collections, Groups and Events count for orgs
- Renamed `Items` to `Ciphers`
- Some small style updates
Diffstat (limited to 'src/db/models/event.rs')
-rw-r--r-- | src/db/models/event.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/db/models/event.rs b/src/db/models/event.rs index 64312273..af2f6c66 100644 --- a/src/db/models/event.rs +++ b/src/db/models/event.rs @@ -263,6 +263,17 @@ impl Event { }} } + pub async fn count_by_org(org_uuid: &str, conn: &mut DbConn) -> i64 { + db_run! { conn: { + event::table + .filter(event::org_uuid.eq(org_uuid)) + .count() + .first::<i64>(conn) + .ok() + .unwrap_or(0) + }} + } + pub async fn find_by_org_and_user_org( org_uuid: &str, user_org_uuid: &str, |