Skip to content

Commit 14a45c2

Browse files
committed
Addition of roadmap.
1 parent b35c4f4 commit 14a45c2

13 files changed

Lines changed: 1996 additions & 56 deletions

File tree

public/data/cdms-specs/specs.json

Lines changed: 1443 additions & 0 deletions
Large diffs are not rendered by default.

src/_nav.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ var pages = [
99
{
1010
/*
1111
component: 'VListItem',
12-
name: 'home',
12+
name: 'dashboard',
1313
to: '/dashboard',
14-
routeName: "home",
14+
routeName: "dashboard",
1515
icon: 'mdi-view-dashboard',
1616
*/
1717
},

src/components/AppSidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<v-list-item router :to="{name: 'station-list'}" prepend-icon="mdi-table" title="Table view"/>
1212
<v-list-item router :to="{name: 'station-viewer'}" prepend-icon="mdi-pencil" title="View/edit"/>
1313
<v-list-item router :to="{name: 'host-form'}" prepend-icon="mdi-pencil" title="Create new"/>
14-
<v-list-item router :to="{name: 'sensor-list'}" prepend-icon="mdi-upload" title="Import"/>
14+
<v-list-item router :to="{name: 'station-import'}" prepend-icon="mdi-upload" title="Import"/>
1515
</v-list-group>
1616
<v-divider/>
1717

src/models/MQTTSubscription.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Model } from 'pinia-orm'
2+
3+
export default class MQTTSubscription extends Model {
4+
static entity = 'mqtt_subscription' ;
5+
static fields(){
6+
return{
7+
id: this.string(''),
8+
topic: this.string(''), // topic we are subscribing to
9+
bucket: this.string(''), // where to put the data
10+
process: this.string(''), // process to use to process the data
11+
collection: this.string(''), // which collection to associate with this subscription
12+
subscribed: this.boolean(false) // current status of the process
13+
}
14+
}
15+
}

src/router/routes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ const routes = [
5959
name: 'station-viewer',
6060
component: () => import(/* webpackChunkName: "dashboard" */ '@/views/station.vue'),
6161
},
62+
{
63+
path: 'import',
64+
name: 'station-import',
65+
component: () => import(/* webpackChunkName: "dashboard" */ '@/views/station-import.vue'),
66+
}
6267
]
6368
},
6469
{
@@ -444,6 +449,11 @@ const routes = [
444449
name: 'data-table',
445450
component: () => import(/* webpackChunkName: "dashboard" */ '@/views/data-table.vue')
446451
},
452+
{
453+
path: '/roadmap',
454+
name: 'roadmap',
455+
component: () => import(/* webpackChunkName: "dashboard" */ '@/views/roadmap.vue')
456+
},
447457
...generateOtherRoutes(navs)
448458
],
449459
},

src/views/roadmap.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div>
3+
<roadmap/>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import Roadmap from './../web-components/roadmap.vue';
9+
10+
11+
export default {
12+
name: 'MyView',
13+
components: {
14+
Roadmap,
15+
},
16+
};
17+
</script>
18+
19+
<style>
20+
</style>

src/views/station-import.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div>
3+
<station-import/>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import StationImport from './../web-components/station-import.vue';
9+
10+
11+
export default {
12+
name: 'MyView',
13+
components: {
14+
StationImport,
15+
},
16+
};
17+
</script>
18+
19+
<style>
20+
</style>

src/views/wis2-subscribe.vue

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<div>
3+
<wis2-subscription/>
4+
</div>
5+
</template>
6+
7+
<script>
8+
import Wis2Subscription from './../web-components/wis2-subscription.vue';
9+
10+
11+
export default {
12+
name: 'MyView',
13+
components: {
14+
Wis2Subscription,
15+
},
16+
};
17+
</script>
18+
19+
<style>
20+
</style>

src/web-components/roadmap.vue

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<v-card>
3+
<v-card-title>Specification and roadmap</v-card-title>
4+
<v-card-text>The core functionality and requirements for a climate data management
5+
are defined in the <a href="https://library.wmo.int/index.php?lvl=notice_display&id=16300">
6+
WMO Climate Data Management Systems specifications (WMO-No. 1131)</a>. The specifications
7+
detailed in WMO-No. 1131 cover a range of topics, including policy and core IT infrastructure.
8+
Within the OpenCDMS project only the data management functions are considered, notably those covered
9+
by Section 4 to 8 of WMO-No. 1131. The cards below summarises these functions and progress
10+
towards their implementation. The full list of specifications can be found at
11+
<a href="https://spec.opencdms.org">https://spec.opencdms.org</a>.
12+
</v-card-text>
13+
</v-card>
14+
<v-expansion-panels v-if="requirements">
15+
<v-expansion-panel v-for="requirement in requirements" :title="requirement.title">
16+
<v-expansion-panel-text class="v-card-text">{{requirement.text}}
17+
<v-expansion-panels v-if="requirement.requirements" multiple>
18+
<v-expansion-panel v-for="r2 in requirement.requirements" :title="r2.title">
19+
<v-expansion-panel-text class="v-card-text">{{r2.text}}</v-expansion-panel-text>
20+
<v-expansion-panel-text>
21+
<v-card v-for="r3 in r2.requirements">
22+
<v-card-title>{{r3.title}} ({{r3.classification}})</v-card-title>
23+
<v-card-text>{{r3.text}}</v-card-text>
24+
<v-card :color="r3.color" :title="r3.status"/>
25+
</v-card>
26+
</v-expansion-panel-text>
27+
</v-expansion-panel>
28+
</v-expansion-panels>
29+
</v-expansion-panel-text>
30+
</v-expansion-panel>
31+
</v-expansion-panels>
32+
</template>
33+
34+
<script>
35+
import { ref, defineComponent } from 'vue';
36+
import { VCard, VCardTitle, VCardText } from 'vuetify/lib/components';
37+
import { VExpansionPanels, VExpansionPanel, VExpansionPanelText } from 'vuetify/lib/components';
38+
import { onBeforeMount, onMounted, onBeforeUpdate, onUpdated, onBeforeUnmount, onUnmounted, onErrorCaptured} from 'vue';
39+
import axios from 'axios';
40+
41+
export default defineComponent({
42+
name: 'roadmap',
43+
props: {
44+
},
45+
components: {
46+
VCard,
47+
VCardTitle,
48+
VCardText,
49+
VExpansionPanel,
50+
VExpansionPanels,
51+
VExpansionPanelText
52+
},
53+
methods: {},
54+
setup() {
55+
56+
const requirements=ref(null)
57+
58+
const renderRequirement = (requirement) => {
59+
60+
}
61+
62+
// lifecycle hooks
63+
onBeforeMount( async () => {
64+
65+
});
66+
onMounted( async() => {
67+
const response = await axios.get("/data/cdms-specs/specs.json")
68+
requirements.value = response.data
69+
console.log(requirements)
70+
// This hook is called after the component is mounted to the DOM.
71+
// This is a good place to perform any necessary DOM manipulations, initialize
72+
// third-party libraries, or set up event listeners.
73+
});
74+
return {requirements};
75+
}
76+
77+
});
78+
79+
</script>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<template>
2+
<v-container>
3+
<v-card>
4+
<v-card-title>Import station from OSCAR/Surface</v-card-title>
5+
<v-card-text>
6+
<v-form>
7+
<v-text-field clearable :rules="[rules.validWSI]" label="WIGOS Identifier" v-model="wigos_identifier"/>
8+
<v-btn @click="search">Search</v-btn>
9+
</v-form>
10+
</v-card-text>
11+
</v-card>
12+
</v-container>
13+
</template>
14+
15+
<script>
16+
import { defineComponent, ref, watchEffect, computed, watch } from 'vue';
17+
import { VCard, VCardTitle, VCardText, VCardItem, VTabs, VTab, VBtn, VAutocomplete, VCardSubtitle, VTextField } from 'vuetify/lib/components';
18+
import { VContainer, VForm } from 'vuetify/lib/components';
19+
20+
// opencdms imports
21+
import Host from '@/models/Host';
22+
import {flatten_geojson} from '@/utils/geojson.js';
23+
import {loadData} from '@/utils/load-data.js';
24+
import { useRoute, useRouter } from 'vue-router';
25+
import {useRepo} from 'pinia-orm';
26+
27+
28+
export default defineComponent({
29+
name: 'import-wmdr-host',
30+
components: {
31+
VContainer, VBtn, VForm, VTextField,
32+
VCard, VCardTitle, VCardText
33+
},
34+
setup(props, {context}){
35+
const router = useRouter();
36+
const wigos_identifier = ref("");
37+
const rules = ref({
38+
validWSI: value => /^0-[0-9]{1,5}-[0-9]{0,5}-[0-9a-zA-Z]{1,16}$/.test(value) || 'Invalid WSI',
39+
});
40+
41+
const search = async () => {
42+
//var oscar_url = "https://oscar.wmo.int/surface/rest/api/search/station?wigosId=";
43+
//var query = oscar_url + wigos_identifier.value;
44+
//console.log(query);
45+
//var stations = await fetch(query).then(response => response.json());
46+
//console.log(stations);
47+
var payload = {
48+
"inputs": {
49+
WIGOS_identifier: wigos_identifier.value
50+
},
51+
"outputs": {
52+
"status": null
53+
}
54+
}
55+
payload = JSON.stringify(payload);
56+
var url_ = process.env.API + "/processes/ingestHost/execution"
57+
var response = await fetch( url_, {
58+
method: 'POST',
59+
body: payload,
60+
headers: {
61+
encode: 'json'
62+
}
63+
});
64+
65+
if(response.ok){
66+
// reload host
67+
await loadData(process.env.API + '/collections/stations/items?limit=1000&f=json', true)
68+
.then( (result) => flatten_geojson(result.features) ).then( (result) => { useRepo(Host).save(result) });
69+
var station_url = '#/station/' + wigos_identifier.value;
70+
router.push('/station/'+wigos_identifier.value);
71+
}else{
72+
console.log(response);
73+
}
74+
};
75+
return {rules, search, wigos_identifier};
76+
}
77+
});
78+
79+
80+
</script>

0 commit comments

Comments
 (0)