-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Addition of csv form. * Addition of csv form * Tweak to csv2bufr component, removal of hardcoded API URL * Addition of station table and station form. * fix inspect-button --------- Co-authored-by: david-i-berry <[email protected]>
- Loading branch information
1 parent
623a5db
commit d17f15e
Showing
20 changed files
with
1,093 additions
and
75 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{"name": "Africa", "id": "I", "description": "Region I - Africa"}, | ||
{"name": "Asia", "id": "II", "description": "Region II - Asia"}, | ||
{"name": "South America", "id": "III", "description": "Region III - South America"}, | ||
{"name": "North America, Central America and the Caribbean", "id": "IV", "description": "Region IV - North America, Central America and the Caribbean"}, | ||
{"name": "South-West Pacific", "id": "V", "description": "South-West Pacific"}, | ||
{"name": "Europe", "id": "VI", "description": "Europe"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{"name": "Air (fixed)", "id": "Air (fixed)", "description": "Airborne station/platform, at fixed position"}, | ||
{"name": "Air (mobile)", "id": "Air (mobile)", "description": "Airborne station/platform, moving around"}, | ||
{"name": "Lake/River (fixed)", "id": "Lake/River (fixed)", "description": "Station/platform at lake/river surface, at fixed position"}, | ||
{"name": "Lake/River (mobile)", "id": "Lake/River (mobile)", "description": "Station/platform at lake/river surface, moving around"}, | ||
{"name": "Land (fixed)", "id": "Land (fixed)", "description": "Station/platform on solid terrain, at fixed position"}, | ||
{"name": "Land (mobile)", "id": "Land (mobile)", "description": "Station/platform on solid terrain, moving around"}, | ||
{"name": "Land (on ice)", "id": "Land (on ice)", "description": "Station/platform on ice-covered ground, moving with the ice"}, | ||
{"name": "Sea (fixed)", "id": "Sea (fixed)", "description": "Station/platform at sea surface, at fixed position"}, | ||
{"name": "Sea (mobile)", "id": "Sea (mobile)", "description": "Station/platform at sea surface, moving around"}, | ||
{"name": "Sea (on ice)", "id": "Sea (on ice)", "description": "Station/platform on floating ice, moving with the ice"}, | ||
{"name": "Space-based", "id": "Space-based", "description": "Satellite platform in orbit"}, | ||
{"name": "Underwater (fixed)", "id": "Underwater (fixed)", "description": "Station/platform under water, at fixed horizontal position"}, | ||
{"name": "Underwater (mobile)", "id": "Underwater (mobile)", "description": "Station/platform under water, moving around also horizontally"}, | ||
{"name": "unknown", "id": "unknown", "description": "The station/platform type is unknown."} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{ | ||
"name": "Operational", | ||
"id": "operational", | ||
"description": "The station fully complies with the reporting obligations of the observation programme/network concerned." | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[ | ||
{"name": "Algeria", "id": "Algeria", "description": "Algeria"}, | ||
{"name": "Congo", "id": "Congo", "description": "Congo"}, | ||
{"name": "Italy", "id": "Italy", "description": "Italy"}, | ||
{"name": "Malawi", "id": "Malawi", "description": "Malawi"}, | ||
{"name": "Romania", "id": "Romania", "description": "Romania"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<template> | ||
<div v-if="! errorMessage"> | ||
<v-autocomplete | ||
v-if="(options !== null)" | ||
:items="options" | ||
item-title="name" | ||
item-value="id" | ||
label="Type of observing facility" | ||
v-model="selected" | ||
:readonly="readonly" | ||
:hint="selected ? selected.description : 'Select facility type'" | ||
persistent-hint | ||
return-object | ||
/> | ||
</div> | ||
<div v-else class="error"> | ||
<v-text-field class="text-error" read-only :hint="props.defaultHint" persistent-hint>{{ errorMessage }}</v-text-field> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent, ref, onBeforeMount, watch, onErrorCaptured, computed} from 'vue'; | ||
import {VAutocomplete, VTextField} from 'vuetify/lib/components/index.mjs'; | ||
export default defineComponent({ | ||
name: 'FacilityTypeSelector', | ||
components: { | ||
VAutocomplete, VTextField | ||
}, | ||
props: { | ||
modelValue: {}, | ||
readonly: false | ||
}, | ||
emits: ["update:modelValue"], | ||
setup(props, {emit}){ | ||
const apiUrl = "/code_lists/facilityType.json"; | ||
const options = ref(null); | ||
const selected = ref(null); | ||
const errorMessage = ref(null); | ||
const fetchOptions = async () => { | ||
try { | ||
const response = await fetch(apiUrl); | ||
if (!response.ok) { | ||
throw new Error(`HTTP error! Status: ${response.status}`); | ||
} | ||
const data = await response.json(); | ||
options.value = data; // Assuming the API response contains the options in the expected format | ||
} catch (error) { | ||
errorMessage.value = 'Error fetching facility type options.'; | ||
console.error('Error fetching facility type options:', error); | ||
} | ||
}; | ||
onBeforeMount( async () => { | ||
await fetchOptions() ; | ||
// update if we have an initial value | ||
if( props.modelValue.length ){ | ||
selected.value = options.value.find(option => option.id === props.modelValue) ; | ||
} | ||
}); | ||
watch( selected, (newValue) => { | ||
if( selected.value ){ | ||
emit("update:modelValue", newValue); | ||
} | ||
}); | ||
return {selected, options, errorMessage}; | ||
} | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.