Skip to content

Commit 33003a1

Browse files
committed
show last 10 messages
1 parent a063949 commit 33003a1

File tree

8 files changed

+24
-17
lines changed

8 files changed

+24
-17
lines changed

src/components/TempChartDialog.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ export default defineComponent({
7070
return "N/A";
7171
},
7272
async fetchMessages() {
73-
// fetch the last 20 messages for the selected station
73+
// fetch the last 10 messages for the selected station
7474
this.loading = true;
7575
try {
7676
const url = `${window.VUE_APP_OAPI}/collections/messages/items?` + new URLSearchParams({
7777
q: this.metadata_id.replace("urn:wmo:md:", ""),
7878
wigos_station_identifier: this.selectedStation.id,
79-
limit: "20",
79+
limit: "10",
8080
sortby: "-datetime"
8181
});
8282
const response = await fetchWithToken(url);

src/components/data/DataTable.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ export default defineComponent({
141141
142142
try {
143143
const url = `${window.VUE_APP_OAPI}/collections/${this.topic}/items?f=json&name=${this.selectedDatastream.name}&reportId=${this.selectedDatastream.reportId}&wigos_station_identifier=${this.selectedStation.id}&sortby=-reportTime`
144-
console.log(url)
145144
const response = await fetchAllOAFFeatures(url);
146145
const data: ItemsResponse = await response.json();
147146
this.plot(response.url);
@@ -158,7 +157,6 @@ export default defineComponent({
158157
catchAndDisplayError(String(error));
159158
} finally {
160159
this.loading = false;
161-
console.log("done");
162160
}
163161
},
164162
plot(url: string) {

src/components/data/TempDataPlotter.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default defineComponent({
5757
// load data from the provided URL
5858
this.loading = true;
5959
try {
60-
console.log("Decoding BUFR data from URL:", this.data_url);
6160
const response = await fetch(`${window.VUE_APP_OAPI}/processes/bufr2UpperAirChart/execution`, {
6261
method: "POST",
6362
headers: {

src/components/data/TempDataViewer.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
</tr>
2222
</tbody>
2323
</v-table>
24+
<div v-if="messages.length != 0">
25+
<i>Showing last {{ messages.length }} files published</i>
26+
</div>
27+
<div v-else>
28+
<i>Found 0 files published for this station.</i>
29+
</div>
2430
</v-col>
2531
</v-row>
2632
</v-container>
@@ -69,7 +75,6 @@ export default defineComponent({
6975
// Always reset state first
7076
this.internalDataURL = null;
7177
this.selected_id = "";
72-
console.log("Number of messages available:", this.messages.length);
7378
if (this.messages.length > 0) {
7479
this.updateSelectedMessage(this.messages[0]);
7580
} else {
@@ -109,7 +114,6 @@ export default defineComponent({
109114
updateSelectedMessage(message: Feature) {
110115
this.internalDataURL = null;
111116
this.selected_id = message.id;
112-
console.log("Selected message ID:", this.selected_id);
113117
// loop over links in message to find the one with rel="canonical" or rel="update"
114118
const dataLink = message.links.find(link => link.rel === "canonical" || link.rel === "update");
115119
if (dataLink) {
@@ -118,7 +122,6 @@ export default defineComponent({
118122
this.internalDataURL = null;
119123
console.warn("No data link found in message:", message);
120124
}
121-
console.log("Data URL set to:", this.internalDataURL);
122125
},
123126
},
124127
});

src/components/station/MsgStationLatest.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export default defineComponent({
9191
const data: ItemsResponse = await response.json();
9292
if (data.features.length > 0) {
9393
const latest = data.features[0];
94-
console.log("Latest message for station", station.id, latest);
9594
this.latest_datetime = latest.properties.datetime || null;
9695
this.latest_pubtime = latest.properties.pubtime || null;
9796
// get the first link with rel="canonical" or rel="update"

src/components/station/StationLatest.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export default defineComponent({
9393
catchAndDisplayError(String(error));
9494
} finally {
9595
this.loading = false;
96-
console.log("done");
9796
}
9897
},
9998
async loadRecentObservations(station: Feature, limit: number) {

src/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export interface MetadataResponse {
169169

170170
// Superset of Feature, with additional helper fields for easier use in the frontend
171171
export interface Dataset extends DiscoveryMetadata {
172-
hasSynop: boolean
172+
mapType: string
173173
id: string
174174
bbox: number[]
175175
// links in a format that can be used by the wis2box UI

src/views/DatasetView.vue

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<v-col sm="12" md="3">
1212
<v-container>
1313
<v-row justify="center" fill-height>
14-
<template v-if="dataset.hasSynop">
15-
<v-card class="pa-0 ma-0" @click="loadMap(dataset.id)" @keydown.enter="loadMap(dataset.id)"
14+
<template v-if="dataset.mapType != 'unknown'">
15+
<v-card class="pa-0 ma-0" @click="loadMap(dataset.id, dataset.mapType)" @keydown.enter="loadMap(dataset.id, dataset.mapType)"
1616
aria-label="Dataset map">
1717
<v-overlay open-on-hover contained activator="parent" class="align-center justify-center">
1818
<v-btn flat>
@@ -117,15 +117,20 @@ export default defineComponent({
117117
}
118118
119119
for (const feature of data.features) {
120-
121120
// if "wmo:topicHierarchy" not is available in the properties hasSynop should be false
121+
let mapType = "unknown";
122122
let hasSynop = false;
123123
let hasTemp = false;
124124
let hasTopic = false;
125125
if (feature.properties["wmo:topicHierarchy"]) {
126126
hasTopic = true;
127127
hasSynop = feature.properties["wmo:topicHierarchy"].includes("surface-based-observations/synop");
128128
hasTemp = feature.properties["wmo:topicHierarchy"].includes("surface-based-observations/temp");
129+
if (hasSynop) {
130+
mapType = "synop";
131+
} else if (hasTemp) {
132+
mapType = "temp";
133+
}
129134
}
130135
const uiLinks = [];
131136
@@ -195,7 +200,7 @@ export default defineComponent({
195200
const bbox = feature.geometry.coordinates[0].flat(2);
196201
197202
this.datasets.push({
198-
hasSynop,
203+
mapType,
199204
bbox,
200205
uiLinks,
201206
...feature,
@@ -207,8 +212,12 @@ export default defineComponent({
207212
this.loading = false;
208213
}
209214
},
210-
loadMap(topic: string) {
211-
this.$router.push(`/fixed-land-station-map/${topic}`);
215+
loadMap(topic: string, mapType: string) {
216+
if (mapType === "synop") {
217+
this.$router.push(`/fixed-land-station-map/${topic}`);
218+
} else if (mapType === "temp") {
219+
this.$router.push(`/fixed-upper-air-map/${topic}`);
220+
}
212221
},
213222
},
214223
});

0 commit comments

Comments
 (0)