From 87d5472f79cc296c9ae8b4a19443dc2e1a59d1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Boschi?= Date: Fri, 3 May 2024 01:08:47 +0200 Subject: [PATCH] add possibility to filter by ledger state --- web/src/main/bvmui/package.json | 1 + web/src/main/bvmui/src/components/Ledger.vue | 2 +- .../src/components/MetadataContainer.vue | 3 +- web/src/main/bvmui/src/components/Navbar.vue | 50 ++++++++++++++++--- web/src/main/bvmui/src/lib/library.js | 21 ++++++-- web/src/main/bvmui/src/views/Ledgers.vue | 37 +++++++++++--- .../bkvm/api/resources/LedgersResource.java | 18 +++++-- .../bkvm/bookkeeper/BookkeeperManager.java | 7 ++- web/src/main/java/org/bkvm/cache/Ledger.java | 6 ++- .../org/bkvm/cache/MetadataCacheTest.java | 6 +-- 10 files changed, 121 insertions(+), 30 deletions(-) diff --git a/web/src/main/bvmui/package.json b/web/src/main/bvmui/package.json index 89c83381..0323c0e0 100644 --- a/web/src/main/bvmui/package.json +++ b/web/src/main/bvmui/package.json @@ -6,6 +6,7 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint --no-fix", + "lint:fix": "vue-cli-service lint --fix", "test": "vue-cli-service test:unit -i" }, "dependencies": { diff --git a/web/src/main/bvmui/src/components/Ledger.vue b/web/src/main/bvmui/src/components/Ledger.vue index a1978771..8410e979 100644 --- a/web/src/main/bvmui/src/components/Ledger.vue +++ b/web/src/main/bvmui/src/components/Ledger.vue @@ -21,7 +21,7 @@ export default { }, computed: { rootClasses() { - return ["bvm-tile", this.ledger.state == "CLOSED" ? "closed" : ""]; + return ["bvm-tile", this.ledger.state === "CLOSED" ? "closed" : ""]; }, computedAge() { const countHours = Math.floor(this.ledger.age / 60); diff --git a/web/src/main/bvmui/src/components/MetadataContainer.vue b/web/src/main/bvmui/src/components/MetadataContainer.vue index 1e3d513b..8174fc56 100644 --- a/web/src/main/bvmui/src/components/MetadataContainer.vue +++ b/web/src/main/bvmui/src/components/MetadataContainer.vue @@ -29,14 +29,13 @@ export default { const arr = [] arr.push({ title: 'Description', value: this.currentLedger.description }) arr.push({ title: 'Cluster', value: this.currentLedger.clusterName }) - arr.push({ title: 'Age', value: this.$library.formatLedgerAge(this.currentLedger.age) }) + arr.push({ title: 'Age', value: this.$library.formatTimeFromMinutes(this.currentLedger.age) }) arr.push({ title: 'Created at', value: this.$library.formatDate(this.currentLedger.ctime) }) arr.push({ title: 'State', value: this.currentLedger.state }) arr.push({ title: 'Size', value: this.$library.formatBytes(this.currentLedger.length) }) arr.push({ title: 'LastEntryId', value: this.currentLedger.lastEntryId }) arr.push({ title: 'Password', value: this.currentLedger.password }) arr.push({ title: 'DigestType', value: this.currentLedger.digestType }) - arr.push({ title: 'Closed', value: this.currentLedger.closed }) arr.push({ title: 'MetadataFormatVersion', value: this.currentLedger.metadataFormatVersion }) arr.push({ title: 'Ensemble size (bookies)', value: this.currentLedger.ensembleSize }) arr.push({ title: 'Write quorum size (copies)', value: this.currentLedger.ensembleSize }) diff --git a/web/src/main/bvmui/src/components/Navbar.vue b/web/src/main/bvmui/src/components/Navbar.vue index 56ac368c..ddc58714 100644 --- a/web/src/main/bvmui/src/components/Navbar.vue +++ b/web/src/main/bvmui/src/components/Navbar.vue @@ -1,24 +1,62 @@