Skip to content

Commit 79b98db

Browse files
vwfoxstbischof
authored andcommitted
fix: preview OGCSATA
1 parent 960adc0 commit 79b98db

File tree

9 files changed

+184
-132
lines changed

9 files changed

+184
-132
lines changed

bodenfeuchte4b.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
-1.04 MB
Binary file not shown.

packages/lib/datasource/ogcsta/src/classes/OgcSta.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,22 @@ export class OgcStaStore extends BaseDatasource implements OgcStaStoreI {
117117
this.connection = configuration.connection
118118
this.requestFlag = { key: FILTERRESET, params: undefined }
119119

120+
// Auto-enable history if time filters are configured but enabled is undefined
121+
// (backwards compatibility with old configs that have time filters but no enabled flag)
122+
if (configuration.history && configuration.history.enabled === undefined) {
123+
const hasTimeFilters =
124+
configuration.history.timeRange?.start || configuration.history.timeRange?.startVariable ||
125+
configuration.history.timeRange?.end || configuration.history.timeRange?.endVariable ||
126+
configuration.history.phenomenonTime?.start || configuration.history.phenomenonTime?.startVariable ||
127+
configuration.history.phenomenonTime?.end || configuration.history.phenomenonTime?.endVariable ||
128+
configuration.history.resultTime?.start || configuration.history.resultTime?.startVariable ||
129+
configuration.history.resultTime?.end || configuration.history.resultTime?.endVariable;
130+
if (hasTimeFilters) {
131+
this.logHistory('Auto-enabling history due to configured time filters');
132+
configuration.history.enabled = true;
133+
}
134+
}
135+
120136
// Setup MQTT Connection if configured
121137
if (configuration.mqttConnection && this.connectionRepository) {
122138
try {

packages/lib/datasource/ogcsta/src/workers/ObservationsWorkerManager.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@ export class ObservationsWorkerManager {
6767
} else {
6868
params.set('$orderby', 'phenomenonTime desc');
6969
}
70+
// Only set $top if explicitly provided (don't default to 1 for history queries)
7071
if (req.historyParams && req.historyParams.$top) {
7172
params.set('$top', req.historyParams.$top.toString());
72-
} else {
73-
params.set('$top', '1');
7473
}
7574
7675
const url = req.baseUrl + '/v1.1/Datastreams(' + req.datastreamId + ')/Observations?' + params.toString();
@@ -199,8 +198,8 @@ export class ObservationsWorkerManager {
199198
if (historyParams?.$filter) params.set('$filter', historyParams.$filter)
200199
if (historyParams?.$orderby) params.set('$orderby', historyParams.$orderby)
201200
else params.set('$orderby', 'phenomenonTime desc')
201+
// Only set $top if explicitly provided (don't default to 1 for history queries)
202202
if (historyParams?.$top) params.set('$top', historyParams.$top.toString())
203-
else params.set('$top', '1')
204203

205204
const url = `${baseUrl}/v1.1/Datastreams(${datastreamId})/Observations?${params.toString()}`
206205
const response = await fetch(url)
@@ -240,4 +239,4 @@ export function getObservationsWorkerManager(): ObservationsWorkerManager {
240239
workerManagerInstance = new ObservationsWorkerManager()
241240
}
242241
return workerManagerInstance
243-
}
242+
}

packages/lib/datasource/ogcsta/src/workers/observationsWorker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ self.onmessage = async (event: MessageEvent<WorkerMessage>) => {
104104
}
105105
}
106106

107-
export {}
107+
export {}

packages/ui/vue/datasource/ogcsta/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"org.eclipse.daanse.board.app.lib.datasource.rest": "^0.0.1-next.1",
3838
"org.eclipse.daanse.board.app.lib.repository.datasource": "^0.0.1-next.1",
3939
"org.eclipse.daanse.board.app.ui.vue.composables": "^0.0.1-next.1",
40+
"org.eclipse.daanse.board.app.ui.vue.variable.components": "^0.0.1-next.1",
4041
"vue-json-pretty": "^2.4.0"
41-
4242
}
4343
}

packages/ui/vue/datasource/ogcsta/src/MapPreview.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,12 @@ watch([chartData, chartCanvas], async () => {
453453
No data available
454454
</div>
455455

456-
<div v-for="thing in hierarchicalData" :key="thing.iotId || thing['@iot.id']"
457-
class="thing-item"
458-
:class="{ 'thing-selected': selectedThing?.id === (thing.iotId || thing['@iot.id']) }">
456+
<div
457+
v-for="thing in hierarchicalData"
458+
:key="thing.iotId || thing['@iot.id']"
459+
class="thing-item"
460+
:class="{ 'thing-selected': selectedThing?.id === (thing.iotId || thing['@iot.id']) }"
461+
>
459462
<div class="tree-node thing-node" @click="toggleThing(thing.iotId || thing['@iot.id'], thing)">
460463
<va-icon :name="expandedThings.has(thing.iotId || thing['@iot.id']) ? 'expand_more' : 'chevron_right'" size="small" />
461464
<va-icon name="sensors" size="small" color="primary" />

0 commit comments

Comments
 (0)