Skip to content

Commit 012b2cb

Browse files
committed
ui: add DataTable for merged_list.json
1 parent 945a8da commit 012b2cb

File tree

8 files changed

+85
-16
lines changed

8 files changed

+85
-16
lines changed

ui/app/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
22
<div>
3-
<Test />
3+
<Kani />
44
</div>
55
</template>

ui/app/components/Kani.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script setup lang="ts">
2+
import { ofetch } from "ofetch";
3+
import { URL_MERGE_DIFF, MergeKaniColumns, multiSort, type VecMergeHashKaniList } from "~/shared/utils/merged_list";
4+
5+
const vec = ref<VecMergeHashKaniList>([]);
6+
// Download JSON
7+
ofetch<VecMergeHashKaniList>(
8+
URL_MERGE_DIFF,
9+
{ parseResponse: JSON.parse }
10+
).then(val => vec.value = val);
11+
12+
// Set title
13+
useHead({ title: "Verify Rust Std - Kani" });
14+
</script>
15+
16+
<template>
17+
<div>len = {{ vec.length }}</div>
18+
19+
<DataTable :value="vec" paginator :rows="5" :rowsPerPageOptions="[5, 10, 20, 50]" sortMode="multiple" removableSort
20+
sortField="proof_kind" :sort-order="1" v-model:multi-sort-meta="multiSort" tableStyle="min-width: 50rem">
21+
<Column v-for="col of MergeKaniColumns" :key="col.key" :field="col.col.field" :header="col.col.header"
22+
:style="{ width: col.col.width }" :sortable="col.col.sortable"></Column>
23+
</DataTable>
24+
</template>

ui/app/components/Test.vue

Lines changed: 0 additions & 7 deletions
This file was deleted.

ui/app/shared/utils/merged_list.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import type { DataTableSortMeta } from "primevue";
2+
3+
export const URL_MERGE_DIFF = "https://raw.githubusercontent.com/os-checker/verify-rust-std_data/refs/heads/main/merge_diff.json";
4+
5+
export type VecMergeHashKaniList = MergeHashKaniList[];
6+
7+
export interface MergeHashKaniList {
8+
file: string;
9+
func: string;
10+
hash?: string;
11+
proof_kind?: ProofKind;
12+
}
13+
14+
export enum ProofKind {
15+
Standard = "Standard",
16+
Contract = "Contract"
17+
}
18+
19+
export interface Column {
20+
field: string,
21+
header: string,
22+
width: string,
23+
sortable?: boolean,
24+
}
25+
26+
export interface MergeKaniColumn {
27+
key: string,
28+
col: Column,
29+
}
30+
31+
export const MergeKaniColumns: MergeKaniColumn[] = [
32+
{
33+
key: "file",
34+
col: { field: "file", header: "File Path", width: "25%", sortable: true },
35+
},
36+
{
37+
key: "func",
38+
col: { field: "func", header: "Function", width: "25%", sortable: true },
39+
},
40+
{
41+
key: "hash",
42+
col: { field: "hash", header: "Hash", width: "25%" },
43+
},
44+
{
45+
key: "proof_kind",
46+
col: { field: "proof_kind", header: "Proof Kind", width: "10%", sortable: true },
47+
},
48+
];
49+
50+
export const multiSort: DataTableSortMeta[] = [
51+
{ field: "proof_kind", order: 1 },
52+
{ field: "func", order: 1 },
53+
];

ui/nuxt.config.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ import Aura from '@primeuix/themes/aura';
44
export default defineNuxtConfig({
55
compatibilityDate: '2025-07-15',
66
devtools: { enabled: true },
7-
typescript: {
8-
typeCheck: true
9-
},
10-
modules: [
11-
'@primevue/nuxt-module'
12-
],
7+
ssr: false, // Client-side Only Rendering (SPA)
8+
typescript: { typeCheck: true },
9+
modules: ['@primevue/nuxt-module'],
1310
primevue: {
1411
options: {
1512
theme: {
1613
preset: Aura
1714
}
1815
}
1916
}
20-
})
17+
})

ui/package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"@primeuix/themes": "^1.2.3",
1414
"nuxt": "^4.0.1",
15+
"ofetch": "^1.4.1",
1516
"primevue": "^4.3.7",
1617
"vue": "^3.5.18",
1718
"vue-router": "^4.5.1"

ui/verify-rust-std_data

0 commit comments

Comments
 (0)