@eodash/eodash 5.0.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/core/client/App.vue +8 -2
- package/core/client/asWebComponent.js +5 -5
- package/core/client/components/DashboardLayout.vue +43 -26
- package/core/client/components/EodashOverlay.vue +5 -6
- package/core/client/components/ErrorAlert.vue +2 -2
- package/core/client/components/Footer.vue +4 -4
- package/core/client/components/Header.vue +3 -3
- package/core/client/components/MobileLayout.vue +47 -27
- package/core/client/composables/DefineEodash.js +38 -43
- package/core/client/composables/DefineTemplate.js +4 -2
- package/core/client/composables/DefineWidgets.js +14 -8
- package/core/client/composables/index.js +273 -23
- package/core/client/eodashSTAC/EodashCollection.js +84 -62
- package/core/client/eodashSTAC/createLayers.js +30 -0
- package/core/client/eodashSTAC/helpers.js +159 -28
- package/core/client/eodashSTAC/parquet.js +145 -0
- package/core/client/eodashSTAC/triggers.js +6 -3
- package/core/client/plugins/index.js +4 -3
- package/core/client/plugins/vuetify.js +3 -0
- package/core/client/store/actions.js +21 -4
- package/core/client/store/stac.js +93 -56
- package/core/client/store/states.js +15 -5
- package/core/client/types.ts +59 -43
- package/core/client/utils/index.js +79 -0
- package/core/client/utils/keys.js +2 -2
- package/core/client/utils/states.js +30 -5
- package/core/client/views/Dashboard.vue +36 -32
- package/core/client/vite-env.d.ts +7 -0
- package/dist/client/{DashboardLayout-CkWvOMOW.js → DashboardLayout-Dq9Kfe6O.js} +24 -13
- package/dist/client/{DynamicWebComponent-DYBbpvUK.js → DynamicWebComponent-DCBMXskE.js} +1 -1
- package/dist/client/{EodashDatePicker-CALmW3SI.js → EodashDatePicker-DtngxU6s.js} +59 -32
- package/dist/client/{EodashItemFilter-DlQiE713.js → EodashItemFilter-ClQebJQt.js} +20 -10
- package/dist/client/{EodashLayerControl-DEzEbft7.js → EodashLayerControl-BLBds28C.js} +29 -16
- package/dist/client/EodashLayoutSwitcher-DQ8SfVDd.js +61 -0
- package/dist/client/EodashMapBtns-B89_YBDw.js +326 -0
- package/dist/client/{EodashStacInfo-DPPxDkF6.js → EodashStacInfo-Dt1nF06x.js} +3 -18
- package/dist/client/{EodashTools-CUaL9s4H.js → EodashTools-DV5ykmWc.js} +13 -13
- package/dist/client/{ExportState-DjyIZVhl.js → ExportState-B6zZQUmE.js} +57 -52
- package/dist/client/{Footer-DyL0JoWt.js → Footer-DNhXs8k6.js} +15 -13
- package/dist/client/{Header-B5Dgty9l.js → Header-BjhN5JY4.js} +32 -28
- package/dist/client/MobileLayout-JelB6w1G.js +118 -0
- package/dist/client/{PopUp-BfB8s_ki.js → PopUp-CgpvNr3o.js} +18 -10
- package/dist/client/ProcessList-vecpxThi.js +198 -0
- package/dist/client/{VImg-FD1WVphJ.js → VImg-CETuikH2.js} +221 -26
- package/dist/client/{VMain-DJKG4SvM.js → VMain-Ci9DyaGU.js} +7 -7
- package/dist/client/{VTooltip-CfeefrXI.js → VTooltip-J4ac48X7.js} +12 -10
- package/dist/client/{WidgetsContainer-C2TaTdb6.js → WidgetsContainer-CCML4TyV.js} +1 -1
- package/dist/client/asWebComponent-ZyEzWOOf.js +19092 -0
- package/dist/client/async-B7jIrM53.js +804 -0
- package/dist/client/eo-dash.js +1 -1
- package/dist/client/{VOverlay-BzOdRu9h.js → forwardRefs-BQclvjMq.js} +332 -28
- package/dist/client/handling-BS24aG1q.js +1227 -0
- package/dist/client/helpers-wXK7Ywio.js +4556 -0
- package/dist/client/index-4UCzZi8B.js +376 -0
- package/dist/client/{index-4CT7Tz83.js → index-9KR-G20t.js} +2 -2
- package/dist/client/{index-CIHH_3dW.js → index-B2XpdgR6.js} +227 -86
- package/dist/client/material-symbols-outlined.woff2 +0 -0
- package/dist/client/material-symbols-rounded.woff2 +0 -0
- package/dist/client/material-symbols-sharp.woff2 +0 -0
- package/dist/client/material-symbols-subset.woff2 +0 -0
- package/dist/client/{ssrBoot-BP7SYRyC.js → ssrBoot-Zgc_Ttvi.js} +2 -2
- package/dist/client/templates.js +840 -0
- package/dist/client/transition-yBii4fu6.js +40 -0
- package/dist/node/cli.js +16 -6
- package/dist/node/types.d.ts +1 -1
- package/dist/types/core/client/App.vue.d.ts +2 -2
- package/dist/types/core/client/asWebComponent.d.ts +1 -1
- package/dist/types/core/client/components/DynamicWebComponent.vue.d.ts +1 -3
- package/dist/types/core/client/components/Footer.vue.d.ts +1 -105
- package/dist/types/core/client/components/IframeWrapper.vue.d.ts +1 -1
- package/dist/types/core/client/components/MobileLayout.vue.d.ts +1 -324
- package/dist/types/core/client/composables/DefineEodash.d.ts +2 -2
- package/dist/types/core/client/composables/DefineTemplate.d.ts +1 -1
- package/dist/types/core/client/composables/DefineWidgets.d.ts +4 -4
- package/dist/types/core/client/composables/index.d.ts +24 -2
- package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +9 -6
- package/dist/types/core/client/eodashSTAC/helpers.d.ts +25 -5
- package/dist/types/core/client/eodashSTAC/parquet.d.ts +2 -0
- package/dist/types/core/client/plugins/vuetify.d.ts +7 -4
- package/dist/types/core/client/store/actions.d.ts +3 -2
- package/dist/types/core/client/store/stac.d.ts +16 -13
- package/dist/types/core/client/store/states.d.ts +14 -4
- package/dist/types/core/client/types.d.ts +46 -31
- package/dist/types/core/client/utils/index.d.ts +2 -0
- package/dist/types/core/client/utils/keys.d.ts +4 -4
- package/dist/types/core/client/utils/states.d.ts +59 -47
- package/dist/types/core/client/views/Dashboard.vue.d.ts +2 -2
- package/dist/types/templates/baseConfig.d.ts +4 -0
- package/dist/types/templates/compare.d.ts +185 -0
- package/dist/types/templates/expert.d.ts +147 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/light.d.ts +154 -0
- package/dist/types/widgets/EodashDatePicker.vue.d.ts +1 -458
- package/dist/types/widgets/EodashItemFilter.vue.d.ts +3 -3
- package/dist/types/widgets/EodashLayerControl.vue.d.ts +14 -7
- package/dist/types/widgets/EodashLayoutSwitcher.vue.d.ts +1 -3
- package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +12 -8
- package/dist/types/widgets/EodashMap/index.vue.d.ts +9 -4
- package/dist/types/widgets/EodashProcess/ProcessList.vue.d.ts +8 -1
- package/dist/types/widgets/EodashProcess/index.vue.d.ts +8 -4
- package/dist/types/widgets/EodashProcess/methods/async.d.ts +19 -18
- package/dist/types/widgets/EodashProcess/methods/composables.d.ts +3 -2
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.d.ts +6 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.d.ts +4 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +5 -0
- package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/index.d.ts +1 -0
- package/dist/types/widgets/EodashProcess/methods/handling.d.ts +12 -5
- package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +72 -41
- package/dist/types/widgets/EodashProcess/methods/utils.d.ts +41 -21
- package/dist/types/widgets/EodashProcess/states.d.ts +11 -0
- package/dist/types/widgets/EodashProcess/types.d.ts +41 -0
- package/dist/types/widgets/EodashStacInfo.vue.d.ts +14 -14
- package/dist/types/widgets/EodashTools.vue.d.ts +3 -3
- package/dist/types/widgets/ExportState.vue.d.ts +1 -1
- package/dist/types/widgets/PopUp.vue.d.ts +11 -16
- package/dist/types/widgets/WidgetsContainer.vue.d.ts +3 -6
- package/package.json +55 -45
- package/templates/baseConfig.js +68 -0
- package/templates/compare.js +142 -0
- package/templates/expert.js +124 -0
- package/templates/index.js +8 -0
- package/templates/light.js +139 -0
- package/widgets/EodashDatePicker.vue +80 -31
- package/widgets/EodashItemFilter.vue +26 -11
- package/widgets/EodashLayerControl.vue +20 -11
- package/widgets/EodashLayoutSwitcher.vue +6 -3
- package/widgets/EodashMap/EodashMapBtns.vue +269 -0
- package/widgets/EodashMap/index.vue +255 -45
- package/widgets/EodashMap/methods/create-layers-config.js +4 -3
- package/widgets/EodashMap/methods/index.js +33 -23
- package/widgets/EodashProcess/ProcessList.vue +47 -11
- package/widgets/EodashProcess/index.vue +55 -20
- package/widgets/EodashProcess/methods/async.js +99 -60
- package/widgets/EodashProcess/methods/composables.js +21 -14
- package/widgets/EodashProcess/methods/custom-endpoints/chart/index.js +35 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +275 -0
- package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +132 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.js +94 -0
- package/widgets/EodashProcess/methods/custom-endpoints/layers/index.js +33 -0
- package/widgets/EodashProcess/methods/handling.js +127 -80
- package/widgets/EodashProcess/methods/outputs.js +376 -125
- package/widgets/EodashProcess/methods/utils.js +442 -10
- package/widgets/EodashProcess/states.js +13 -0
- package/widgets/EodashProcess/types.ts +46 -0
- package/widgets/EodashStacInfo.vue +2 -17
- package/widgets/EodashTools.vue +13 -13
- package/widgets/WidgetsContainer.vue +1 -1
- package/core/client/eodash.js +0 -454
- package/dist/client/EodashLayoutSwitcher-CDeCV8F-.js +0 -52
- package/dist/client/EodashMapBtns-CktQCfa-.js +0 -131
- package/dist/client/MobileLayout-CRsg_5Q4.js +0 -1217
- package/dist/client/ProcessList-DTefwQZx.js +0 -484
- package/dist/client/asWebComponent-CLhcT715.js +0 -12479
- package/dist/client/eo-dash.css +0 -5
- package/dist/client/forwardRefs-Bon_Kku1.js +0 -245
- package/dist/client/index-Bm9cbtx5.js +0 -201
- package/dist/client/index-DiGDvTQU.js +0 -780
- package/dist/client/transition-C5I57hn6.js +0 -37
- package/dist/types/core/client/eodash.d.ts +0 -8
- package/widgets/EodashMapBtns.vue +0 -113
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { onMounted, watch, nextTick, ref, useTemplateRef, computed, createElementBlock, openBlock, createVNode, createCommentVNode, createElementVNode, unref, normalizeStyle, toRaw, createBlock, withCtx, createTextVNode } from 'vue';
|
|
2
|
+
import '@eox/chart';
|
|
3
|
+
import '@eox/drawtools';
|
|
4
|
+
import '@eox/jsonform';
|
|
5
|
+
import { Q as eoxLayersKey, P as useOnLayersUpdate, _ as _export_sfc, E as useSTAcStore, G as VBtn } from './asWebComponent-ZyEzWOOf.js';
|
|
6
|
+
import { storeToRefs } from 'pinia';
|
|
7
|
+
import { P as ProcessList, c as compareJobs, j as jobs } from './ProcessList-vecpxThi.js';
|
|
8
|
+
import { i as initProcess, o as onChartClick, h as handleProcesses } from './handling-BS24aG1q.js';
|
|
9
|
+
import { useEventBus } from '@vueuse/core';
|
|
10
|
+
import { u as updateJobsStatus, d as download } from './async-B7jIrM53.js';
|
|
11
|
+
import { D as compareIndicator, C as indicator, I as mapCompareEl, d as mapEl } from './helpers-wXK7Ywio.js';
|
|
12
|
+
import { mdiCogPlayOutline, mdiDownloadCircleOutline } from '@mdi/js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Composable resposible of timing the Initialization of the process
|
|
16
|
+
*
|
|
17
|
+
* @export
|
|
18
|
+
* @async
|
|
19
|
+
* @param {Object} params
|
|
20
|
+
* @param {import("vue").Ref<import("stac-ts").StacCollection | null>} params.selectedStac
|
|
21
|
+
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} params.jsonformEl
|
|
22
|
+
* @param {import("vue").Ref<Record<string,any> | null>} params.jsonformSchema
|
|
23
|
+
* @param {import("vue").Ref<import("@eox/chart").EOxChart["spec"] | null>} params.chartSpec
|
|
24
|
+
* @param {import("vue").Ref<any[]>} params.processResults
|
|
25
|
+
* @param {import("vue").Ref<boolean>} params.isProcessed
|
|
26
|
+
* @param {import("vue").Ref<boolean>} params.loading
|
|
27
|
+
* @param {import("vue").Ref<boolean>} params.isPolling
|
|
28
|
+
* @param {import("@eox/map").EOxMap | null} params.mapElement
|
|
29
|
+
*/
|
|
30
|
+
const useInitProcess = ({
|
|
31
|
+
selectedStac,
|
|
32
|
+
jsonformEl,
|
|
33
|
+
jsonformSchema,
|
|
34
|
+
chartSpec,
|
|
35
|
+
isProcessed,
|
|
36
|
+
processResults,
|
|
37
|
+
loading,
|
|
38
|
+
isPolling,
|
|
39
|
+
mapElement,
|
|
40
|
+
}) => {
|
|
41
|
+
const layersEvents = useEventBus(eoxLayersKey);
|
|
42
|
+
|
|
43
|
+
onMounted(async () => {
|
|
44
|
+
// wait for the layers to be rendered
|
|
45
|
+
if ((mapElement?.layers.length ?? 0) > 1) {
|
|
46
|
+
await initProcess({
|
|
47
|
+
enableCompare: mapElement?.id === "compare",
|
|
48
|
+
selectedStac,
|
|
49
|
+
jsonformEl,
|
|
50
|
+
jsonformSchema,
|
|
51
|
+
chartSpec,
|
|
52
|
+
isProcessed,
|
|
53
|
+
processResults,
|
|
54
|
+
loading,
|
|
55
|
+
isPolling,
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
layersEvents.once(async () => {
|
|
59
|
+
await initProcess({
|
|
60
|
+
enableCompare: mapElement?.id === "compare",
|
|
61
|
+
selectedStac,
|
|
62
|
+
jsonformEl,
|
|
63
|
+
jsonformSchema,
|
|
64
|
+
chartSpec,
|
|
65
|
+
isProcessed,
|
|
66
|
+
loading,
|
|
67
|
+
processResults,
|
|
68
|
+
isPolling,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const evtKey =
|
|
75
|
+
mapElement?.id === "compare" ? "compareLayers:updated" : "layers:updated";
|
|
76
|
+
useOnLayersUpdate(async (evt, _payload) => {
|
|
77
|
+
if (evt !== evtKey) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
await initProcess({
|
|
81
|
+
enableCompare: mapElement?.id === "compare",
|
|
82
|
+
selectedStac,
|
|
83
|
+
jsonformEl,
|
|
84
|
+
jsonformSchema,
|
|
85
|
+
chartSpec,
|
|
86
|
+
isProcessed,
|
|
87
|
+
processResults,
|
|
88
|
+
loading,
|
|
89
|
+
isPolling,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Auto execute the process when the jsonform has the execute option
|
|
96
|
+
*
|
|
97
|
+
* @param {import("vue").Ref<boolean>} autoExec
|
|
98
|
+
* @param {import("vue").Ref<import("@eox/jsonform").EOxJSONForm | null>} jsonformEl
|
|
99
|
+
* @param {import("vue").Ref<Record<string,any> | null>} jsonformSchema
|
|
100
|
+
* @param {() => Promise<void>} startProcess
|
|
101
|
+
**/
|
|
102
|
+
function useAutoExec(
|
|
103
|
+
autoExec,
|
|
104
|
+
jsonformEl,
|
|
105
|
+
jsonformSchema,
|
|
106
|
+
startProcess,
|
|
107
|
+
) {
|
|
108
|
+
/**
|
|
109
|
+
* @param {CustomEvent} _e
|
|
110
|
+
**/
|
|
111
|
+
const onJsonFormChange = async (_e) => {
|
|
112
|
+
await startProcess();
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const addEventListener = async () => {
|
|
116
|
+
await nextTick(() => {
|
|
117
|
+
//@ts-expect-error TODO
|
|
118
|
+
jsonformEl.value?.addEventListener("change", onJsonFormChange);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
const removeEventListener = () => {
|
|
122
|
+
//@ts-expect-error TODO
|
|
123
|
+
jsonformEl.value?.removeEventListener("change", onJsonFormChange);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
watch(jsonformSchema, (updatedSchema) => {
|
|
127
|
+
autoExec.value = updatedSchema?.options?.["execute"] || false;
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
onMounted(() => {
|
|
131
|
+
watch(
|
|
132
|
+
autoExec,
|
|
133
|
+
async (exec) => {
|
|
134
|
+
if (exec) {
|
|
135
|
+
await addEventListener();
|
|
136
|
+
} else {
|
|
137
|
+
removeEventListener();
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{ immediate: true },
|
|
141
|
+
);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const _style_0 = "eox-chart{--background-color: transparent;padding-top:1em}eox-jsonform{padding:.7em;min-height:0px}";
|
|
146
|
+
|
|
147
|
+
const _hoisted_1 = {
|
|
148
|
+
ref: "container",
|
|
149
|
+
class: "pb-4"
|
|
150
|
+
};
|
|
151
|
+
const _hoisted_2 = [".schema"];
|
|
152
|
+
const _hoisted_3 = [".spec", ".dataValues", ".opt"];
|
|
153
|
+
const _hoisted_4 = { class: "mt-4 text-right" };
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
const _sfc_main = {
|
|
157
|
+
__name: 'index',
|
|
158
|
+
props: {
|
|
159
|
+
enableCompare: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: false,
|
|
162
|
+
},
|
|
163
|
+
vegaEmbedOptions: {
|
|
164
|
+
type: Object,
|
|
165
|
+
default() {
|
|
166
|
+
return { actions: true };
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
setup(__props) {
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
/** @type {import("vue").Ref<import("vega").Spec|null>} */
|
|
174
|
+
const chartSpec = ref(null);
|
|
175
|
+
|
|
176
|
+
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
177
|
+
const chartData = ref(null);
|
|
178
|
+
const isProcessed = ref(false);
|
|
179
|
+
|
|
180
|
+
/** @type {import("vue").Ref<Record<string,any>|null>} */
|
|
181
|
+
const jsonformSchema = ref(null);
|
|
182
|
+
|
|
183
|
+
const jsonformEl =
|
|
184
|
+
/** @type {Readonly<import("vue").ShallowRef<import("@eox/jsonform").EOxJSONForm | null>>} */ (
|
|
185
|
+
useTemplateRef("jsonformEl")
|
|
186
|
+
);
|
|
187
|
+
const isAsync = computed(
|
|
188
|
+
() =>
|
|
189
|
+
selectedStac.value?.links.filter((l) => l.endpoint === "eoxhub_workspaces")
|
|
190
|
+
.length,
|
|
191
|
+
);
|
|
192
|
+
const containerEl = useTemplateRef("container");
|
|
193
|
+
|
|
194
|
+
const loading = ref(false);
|
|
195
|
+
|
|
196
|
+
const autoExec = ref(false);
|
|
197
|
+
|
|
198
|
+
const isPolling = ref(false);
|
|
199
|
+
/** @type {import("vue").Ref<any[]>} */
|
|
200
|
+
const processResults = ref([]);
|
|
201
|
+
|
|
202
|
+
const showExecBtn = computed(
|
|
203
|
+
() =>
|
|
204
|
+
!autoExec.value &&
|
|
205
|
+
(!!jsonformSchema.value || !!chartSpec.value) &&
|
|
206
|
+
!!jsonformEl.value,
|
|
207
|
+
);
|
|
208
|
+
const { selectedStac, selectedCompareStac } = storeToRefs(useSTAcStore());
|
|
209
|
+
const currentSelectedStac = __props.enableCompare ? selectedCompareStac : selectedStac;
|
|
210
|
+
const mapElement = __props.enableCompare ? mapCompareEl : mapEl;
|
|
211
|
+
const currentIndicator = __props.enableCompare ? compareIndicator : indicator;
|
|
212
|
+
const currentJobs = __props.enableCompare ? compareJobs : jobs;
|
|
213
|
+
|
|
214
|
+
const jsonformKey = computed(
|
|
215
|
+
() => currentIndicator.value + mapElement.value?.id,
|
|
216
|
+
);
|
|
217
|
+
|
|
218
|
+
useInitProcess({
|
|
219
|
+
selectedStac: currentSelectedStac,
|
|
220
|
+
mapElement: mapElement.value,
|
|
221
|
+
jsonformEl,
|
|
222
|
+
jsonformSchema,
|
|
223
|
+
chartSpec,
|
|
224
|
+
isProcessed,
|
|
225
|
+
processResults,
|
|
226
|
+
loading,
|
|
227
|
+
isPolling,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
const downloadResults = () => {
|
|
231
|
+
processResults.value.forEach((result) => {
|
|
232
|
+
if (!result) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
let fileName = "";
|
|
236
|
+
if (typeof result === "string") {
|
|
237
|
+
fileName = result.includes("/")
|
|
238
|
+
? (result.split("/").pop() ?? "")
|
|
239
|
+
: result;
|
|
240
|
+
fileName = fileName.includes("?") ? fileName.split("?")[0] : fileName;
|
|
241
|
+
} else {
|
|
242
|
+
fileName = currentSelectedStac.value?.id + "_process_results.json";
|
|
243
|
+
}
|
|
244
|
+
download(fileName, result);
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const startProcess = async () => {
|
|
249
|
+
/** @param {*} jsonformSchema */
|
|
250
|
+
const getDrawToolsProperty = (jsonformSchema) => {
|
|
251
|
+
for (const property in jsonformSchema.properties) {
|
|
252
|
+
if (jsonformSchema.properties[property]?.options?.drawtools) {
|
|
253
|
+
return property;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
const drawToolsProperty = getDrawToolsProperty(jsonformSchema.value);
|
|
258
|
+
const propertyIsEmpty =
|
|
259
|
+
drawToolsProperty &&
|
|
260
|
+
//@ts-expect-error jsonfrom.value is not typed
|
|
261
|
+
Array.isArray(jsonformEl.value?.value[drawToolsProperty]) &&
|
|
262
|
+
//@ts-expect-error jsonfrom.value is not typed
|
|
263
|
+
!jsonformEl.value?.value[drawToolsProperty].length;
|
|
264
|
+
|
|
265
|
+
if (propertyIsEmpty) {
|
|
266
|
+
isProcessed.value = false;
|
|
267
|
+
chartSpec.value = null;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const errors = jsonformEl.value?.editor.validate();
|
|
271
|
+
if (errors?.length) {
|
|
272
|
+
console.warn("[eodash] Form validation failed", errors);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
processResults.value = [];
|
|
277
|
+
|
|
278
|
+
await handleProcesses({
|
|
279
|
+
jobs: currentJobs,
|
|
280
|
+
selectedStac: currentSelectedStac,
|
|
281
|
+
jsonformEl,
|
|
282
|
+
jsonformSchema,
|
|
283
|
+
chartSpec,
|
|
284
|
+
chartData,
|
|
285
|
+
loading,
|
|
286
|
+
isPolling,
|
|
287
|
+
processResults,
|
|
288
|
+
mapElement: mapElement.value,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
isProcessed.value = true;
|
|
292
|
+
if (isAsync.value) updateJobsStatus(currentJobs, currentIndicator.value);
|
|
293
|
+
};
|
|
294
|
+
useAutoExec(autoExec, jsonformEl, jsonformSchema, startProcess);
|
|
295
|
+
|
|
296
|
+
const chartStyles = computed(() => {
|
|
297
|
+
/** @type {Record<string,string>} */
|
|
298
|
+
const styles = {};
|
|
299
|
+
if (!chartSpec.value?.["height"]) {
|
|
300
|
+
styles["height"] =
|
|
301
|
+
Math.max(
|
|
302
|
+
(containerEl.value?.offsetHeight ?? 0) -
|
|
303
|
+
(jsonformEl.value?.offsetHeight ?? 0),
|
|
304
|
+
200,
|
|
305
|
+
) + "px";
|
|
306
|
+
}
|
|
307
|
+
return styles;
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
return (_ctx, _cache) => {
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
314
|
+
createVNode(ProcessList, {
|
|
315
|
+
"map-element": unref(mapElement),
|
|
316
|
+
"enable-compare": __props.enableCompare
|
|
317
|
+
}, null, 8 /* PROPS */, ["map-element", "enable-compare"]),
|
|
318
|
+
(jsonformSchema.value)
|
|
319
|
+
? (openBlock(), createElementBlock("eox-jsonform", {
|
|
320
|
+
key: jsonformKey.value,
|
|
321
|
+
ref_key: "jsonformEl",
|
|
322
|
+
ref: jsonformEl,
|
|
323
|
+
".schema": jsonformSchema.value
|
|
324
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2))
|
|
325
|
+
: createCommentVNode("v-if", true),
|
|
326
|
+
(isProcessed.value && chartSpec.value)
|
|
327
|
+
? (openBlock(), createElementBlock("eox-chart", {
|
|
328
|
+
key: 1,
|
|
329
|
+
class: "chart",
|
|
330
|
+
".spec": toRaw(chartSpec.value),
|
|
331
|
+
".dataValues": toRaw(chartData.value),
|
|
332
|
+
"onClick:item": _cache[0] || (_cache[0] = (...args) => (unref(onChartClick) && unref(onChartClick)(...args))),
|
|
333
|
+
style: normalizeStyle(chartStyles.value),
|
|
334
|
+
".opt": __props.vegaEmbedOptions
|
|
335
|
+
}, null, 44 /* STYLE, PROPS, NEED_HYDRATION */, _hoisted_3))
|
|
336
|
+
: createCommentVNode("v-if", true),
|
|
337
|
+
createElementVNode("div", _hoisted_4, [
|
|
338
|
+
(showExecBtn.value)
|
|
339
|
+
? (openBlock(), createBlock(VBtn, {
|
|
340
|
+
key: 0,
|
|
341
|
+
loading: loading.value,
|
|
342
|
+
style: {"margin-right":"20px"},
|
|
343
|
+
"append-icon": [unref(mdiCogPlayOutline)],
|
|
344
|
+
onClick: startProcess,
|
|
345
|
+
color: "primary"
|
|
346
|
+
}, {
|
|
347
|
+
default: withCtx(() => _cache[1] || (_cache[1] = [
|
|
348
|
+
createTextVNode(" Execute ", -1 /* CACHED */)
|
|
349
|
+
])),
|
|
350
|
+
_: 1 /* STABLE */,
|
|
351
|
+
__: [1]
|
|
352
|
+
}, 8 /* PROPS */, ["loading", "append-icon"]))
|
|
353
|
+
: createCommentVNode("v-if", true),
|
|
354
|
+
(processResults.value.length && isProcessed.value && !isAsync.value)
|
|
355
|
+
? (openBlock(), createBlock(VBtn, {
|
|
356
|
+
key: 1,
|
|
357
|
+
color: "primary",
|
|
358
|
+
"append-icon": [unref(mdiDownloadCircleOutline)],
|
|
359
|
+
onClick: downloadResults
|
|
360
|
+
}, {
|
|
361
|
+
default: withCtx(() => _cache[2] || (_cache[2] = [
|
|
362
|
+
createTextVNode(" Download ", -1 /* CACHED */)
|
|
363
|
+
])),
|
|
364
|
+
_: 1 /* STABLE */,
|
|
365
|
+
__: [2]
|
|
366
|
+
}, 8 /* PROPS */, ["append-icon"]))
|
|
367
|
+
: createCommentVNode("v-if", true)
|
|
368
|
+
])
|
|
369
|
+
], 512 /* NEED_PATCH */))
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
};
|
|
374
|
+
const index = /*#__PURE__*/_export_sfc(_sfc_main, [['styles',[_style_0]]]);
|
|
375
|
+
|
|
376
|
+
export { index as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveComponent, render, h, mergeProps } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
import { V as VTooltip } from './VTooltip-
|
|
2
|
+
import { W as consoleError, X as isObject } from './asWebComponent-ZyEzWOOf.js';
|
|
3
|
+
import { V as VTooltip } from './VTooltip-J4ac48X7.js';
|
|
4
4
|
|
|
5
5
|
// Utilities
|
|
6
6
|
function useDirectiveComponent(component, props) {
|