Skip to content

Commit c381d8e

Browse files
feat(inspector): new component
1 parent 7a5e621 commit c381d8e

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<template>
2+
<div class="pa-0">
3+
<v-btn
4+
:loading="loading"
5+
color="primary"
6+
@click="get_inspection_results(props.input_geode_object, props.filename)"
7+
>
8+
Inspect
9+
<template #loader>
10+
<v-progress-circular indeterminate size="20" color="white" width="3" />
11+
</template>
12+
</v-btn>
13+
<v-btn variant="text" @click="emit('decrement_step')">Cancel</v-btn>
14+
</div>
15+
</template>
16+
17+
<script setup>
18+
import schemas from "@geode/opengeodeweb-back/schemas.json"
19+
const schema = schemas.opengeodeweb_back.inspect_file
20+
21+
const emit = defineEmits([
22+
"update_values",
23+
"increment_step",
24+
"decrement_step",
25+
])
26+
const props = defineProps({
27+
input_geode_object: { type: String, required: false },
28+
filename: { type: String, required: false },
29+
})
30+
const loading = ref(false)
31+
const toggle_loading = useToggle(loading)
32+
33+
async function get_inspection_results(input_geode_object, filename) {
34+
toggle_loading()
35+
const params = { input_geode_object, filename }
36+
37+
await api_fetch(
38+
{ schema, params },
39+
{
40+
response_function: (response) => {
41+
emit("update_values", {
42+
inspection_result: [response._data.inspection_result],
43+
})
44+
emit("increment_step")
45+
},
46+
},
47+
)
48+
toggle_loading()
49+
}
50+
</script>

0 commit comments

Comments
 (0)