-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from opencdms/clean-up
Addition of catalogue and station import
- Loading branch information
Showing
13 changed files
with
2,005 additions
and
58 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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,15 @@ | ||
import { Model } from 'pinia-orm' | ||
|
||
export default class MQTTSubscription extends Model { | ||
static entity = 'mqtt_subscription' ; | ||
static fields(){ | ||
return{ | ||
id: this.string(''), | ||
topic: this.string(''), // topic we are subscribing to | ||
bucket: this.string(''), // where to put the data | ||
process: this.string(''), // process to use to process the data | ||
collection: this.string(''), // which collection to associate with this subscription | ||
subscribed: this.boolean(false) // current status of the process | ||
} | ||
} | ||
} |
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,20 @@ | ||
<template> | ||
<div> | ||
<roadmap/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Roadmap from './../web-components/roadmap.vue'; | ||
export default { | ||
name: 'MyView', | ||
components: { | ||
Roadmap, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
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,20 @@ | ||
<template> | ||
<div> | ||
<station-import/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import StationImport from './../web-components/station-import.vue'; | ||
export default { | ||
name: 'MyView', | ||
components: { | ||
StationImport, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
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,20 @@ | ||
<template> | ||
<div> | ||
<wis2-subscription/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import Wis2Subscription from './../web-components/wis2-subscription.vue'; | ||
export default { | ||
name: 'MyView', | ||
components: { | ||
Wis2Subscription, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style> | ||
</style> |
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,79 @@ | ||
<template> | ||
<v-card> | ||
<v-card-title>Specification and roadmap</v-card-title> | ||
<v-card-text>The core functionality and requirements for a climate data management | ||
are defined in the <a href="https://library.wmo.int/index.php?lvl=notice_display&id=16300"> | ||
WMO Climate Data Management Systems specifications (WMO-No. 1131)</a>. The specifications | ||
detailed in WMO-No. 1131 cover a range of topics, including policy and core IT infrastructure. | ||
Within the OpenCDMS project only the data management functions are considered, notably those covered | ||
by Section 4 to 8 of WMO-No. 1131. The cards below summarises these functions and progress | ||
towards their implementation. The full list of specifications can be found at | ||
<a href="https://spec.opencdms.org">https://spec.opencdms.org</a>. | ||
</v-card-text> | ||
</v-card> | ||
<v-expansion-panels v-if="requirements"> | ||
<v-expansion-panel v-for="requirement in requirements" :title="requirement.title"> | ||
<v-expansion-panel-text class="v-card-text">{{requirement.text}} | ||
<v-expansion-panels v-if="requirement.requirements" multiple> | ||
<v-expansion-panel v-for="r2 in requirement.requirements" :title="r2.title"> | ||
<v-expansion-panel-text class="v-card-text">{{r2.text}}</v-expansion-panel-text> | ||
<v-expansion-panel-text> | ||
<v-card v-for="r3 in r2.requirements"> | ||
<v-card-title>{{r3.title}} ({{r3.classification}})</v-card-title> | ||
<v-card-text>{{r3.text}}</v-card-text> | ||
<v-card :color="r3.color" :title="r3.status"/> | ||
</v-card> | ||
</v-expansion-panel-text> | ||
</v-expansion-panel> | ||
</v-expansion-panels> | ||
</v-expansion-panel-text> | ||
</v-expansion-panel> | ||
</v-expansion-panels> | ||
</template> | ||
|
||
<script> | ||
import { ref, defineComponent } from 'vue'; | ||
import { VCard, VCardTitle, VCardText } from 'vuetify/lib/components'; | ||
import { VExpansionPanels, VExpansionPanel, VExpansionPanelText } from 'vuetify/lib/components'; | ||
import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, onErrorCaptured} from 'vue'; | ||
import axios from 'axios'; | ||
export default defineComponent({ | ||
name: 'roadmap', | ||
props: { | ||
}, | ||
components: { | ||
VCard, | ||
VCardTitle, | ||
VCardText, | ||
VExpansionPanel, | ||
VExpansionPanels, | ||
VExpansionPanelText | ||
}, | ||
methods: {}, | ||
setup() { | ||
const requirements=ref(null) | ||
const renderRequirement = (requirement) => { | ||
} | ||
// lifecycle hooks | ||
onBeforeMount( async () => { | ||
}); | ||
onMounted( async() => { | ||
const response = await axios.get("/data/cdms-specs/specs.json") | ||
requirements.value = response.data | ||
console.log(requirements) | ||
// This hook is called after the component is mounted to the DOM. | ||
// This is a good place to perform any necessary DOM manipulations, initialize | ||
// third-party libraries, or set up event listeners. | ||
}); | ||
return {requirements}; | ||
} | ||
}); | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<template> | ||
<v-container> | ||
<v-card> | ||
<v-card-title>Import station from OSCAR/Surface</v-card-title> | ||
<v-card-text> | ||
<v-form> | ||
<v-text-field clearable :rules="[rules.validWSI]" label="WIGOS Identifier" v-model="wigos_identifier"/> | ||
<v-btn @click="search">Search</v-btn> | ||
</v-form> | ||
</v-card-text> | ||
</v-card> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import { defineComponent, ref, watchEffect, computed, watch } from 'vue'; | ||
import { VCard, VCardTitle, VCardText, VCardItem, VTabs, VTab, VBtn, VAutocomplete, VCardSubtitle, VTextField } from 'vuetify/lib/components'; | ||
import { VContainer, VForm } from 'vuetify/lib/components'; | ||
// opencdms imports | ||
import Host from '@/models/Host'; | ||
import {flatten_geojson} from '@/utils/geojson.js'; | ||
import {loadData} from '@/utils/load-data.js'; | ||
import { useRoute, useRouter } from 'vue-router'; | ||
import {useRepo} from 'pinia-orm'; | ||
export default defineComponent({ | ||
name: 'import-wmdr-host', | ||
components: { | ||
VContainer, VBtn, VForm, VTextField, | ||
VCard, VCardTitle, VCardText | ||
}, | ||
setup(props, {context}){ | ||
const router = useRouter(); | ||
const wigos_identifier = ref(""); | ||
const rules = ref({ | ||
validWSI: value => /^0-[0-9]{1,5}-[0-9]{0,5}-[0-9a-zA-Z]{1,16}$/.test(value) || 'Invalid WSI', | ||
}); | ||
const search = async () => { | ||
//var oscar_url = "https://oscar.wmo.int/surface/rest/api/search/station?wigosId="; | ||
//var query = oscar_url + wigos_identifier.value; | ||
//console.log(query); | ||
//var stations = await fetch(query).then(response => response.json()); | ||
//console.log(stations); | ||
var payload = { | ||
"inputs": { | ||
WIGOS_identifier: wigos_identifier.value | ||
}, | ||
"outputs": { | ||
"status": null | ||
} | ||
} | ||
payload = JSON.stringify(payload); | ||
var url_ = process.env.API + "/processes/ingestHost/execution" | ||
var response = await fetch( url_, { | ||
method: 'POST', | ||
body: payload, | ||
headers: { | ||
encode: 'json' | ||
} | ||
}); | ||
if(response.ok){ | ||
// reload host | ||
await loadData(process.env.API + '/collections/stations/items?limit=1000&f=json', true) | ||
.then( (result) => flatten_geojson(result.features) ).then( (result) => { useRepo(Host).save(result) }); | ||
var station_url = '#/station/' + wigos_identifier.value; | ||
router.push('/station/'+wigos_identifier.value); | ||
}else{ | ||
console.log(response); | ||
} | ||
}; | ||
return {rules, search, wigos_identifier}; | ||
} | ||
}); | ||
</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.