@@ -13,31 +13,47 @@ const raw = ref<VecMergeHashKaniList>([]);
1313ofetch <VecMergeHashKaniList >(
1414 URL_MERGE_DIFF ,
1515 { parseResponse: JSON .parse }
16- ).then (val => raw .value = val );
16+ ).then (val => {
17+ raw .value = val ;
18+ data .value = val ;
19+ });
20+
21+ // Real data for DataTable.
22+ const data = ref <VecMergeHashKaniList >([]);
23+ // Changed data for DataTable.
24+ const dataChanged = ref <VecMergeHashKaniList >([]);
25+ function valueChange(v : VecMergeHashKaniList ) {
26+ dataChanged .value = v ;
27+ }
1728
1829// fitler rows
1930const filters = ref (FILTERS .filters );
2031// stats
21- const counts = computed <{ total: number , standard: number , contract: number }>(() => ({
32+ type Counts = { total: number , selected_total: number , standard: number , contract: number };
33+ const counts = computed <Counts >(() => ({
2234 total: raw .value .length ,
35+ selected_total: dataChanged .value .length ,
2336 standard: raw .value .filter (ele => ele .proof_kind === ProofKind .Standard ).length ,
2437 contract:
2538 raw .value .filter (ele => ele .proof_kind === ProofKind .Contract ).length ,
2639}));
2740
2841const selectedProofKind = ref <string []>([]);
29- watch (selectedProofKind , val => console .log (val ));
42+ watch (selectedProofKind , val => {
43+ data .value = (val .length === 0 ) ? raw .value :
44+ raw .value .filter (ele => val .find (k => k === ele .proof_kind ));
45+ });
3046
3147// Set title
3248useHead ({ title: " Verify Rust Std - Kani" });
3349 </script >
3450
3551<template >
3652
37- <DataTable :value =" raw " paginator :rows =" 5" :rowsPerPageOptions =" [5, 10, 20, 50]" sortMode =" multiple" removableSort
53+ <DataTable :value =" data " paginator :rows =" 5" :rowsPerPageOptions =" [5, 10, 20, 50]" sortMode =" multiple" removableSort
3854 v-model:multi-sort-meta =" multiSort" stripedRows :tableStyle =" { width: `${Math.round(viewportWidth - 10)}px` }"
3955 tableClass =" p-1" :scrollHeight =" `${Math.round(viewportHeight * 0.78)}px`" v-model:filters =" filters"
40- :globalFilterFields =" FILTERS.fields" currentPageReportTemplate = " {first} to {last} of {totalRecords} " >
56+ :globalFilterFields =" FILTERS.fields" @value-change = " valueChange " >
4157
4258 <template #header >
4359 <div class =" flex justify-between items-center" >
@@ -72,10 +88,15 @@ useHead({ title: "Verify Rust Std - Kani" });
7288 </Column >
7389
7490 <template #paginatorstart >
75- <span >Total: {{ counts.total }}</span >
91+ <div class =" grid grid-cols-2 grid-rows-2 justify-items-end" >
92+ <span >Total:</span >
93+ <span >{{ counts.total }}</span >
94+ <span >Filtered:</span >
95+ <span >{{ counts.selected_total }}</span >
96+ </div >
7697 </template >
7798 <template #paginatorend >
78- <div class =" grid grid-cols-2 grid-rows-2 place -items-center " >
99+ <div class =" grid grid-cols-2 grid-rows-2 justify -items-end " >
79100 <span >Standard:</span >
80101 <span >{{ counts.standard }}</span >
81102 <span >Contract:</span >
0 commit comments