Skip to content

Commit 30eebb2

Browse files
committed
Prevent escaping js whitespace
1 parent 313b97d commit 30eebb2

File tree

1 file changed

+47
-42
lines changed

1 file changed

+47
-42
lines changed
Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,50 @@
1+
---
2+
include-before-body:
3+
text: |
4+
<script setup>
5+
import { ref, computed, onMounted, watch } from 'vue'
6+
const start = ref('')
7+
const end = ref('')
8+
const n_tiles = ref(1)
9+
const submitted = ref(false)
10+
const error = ref('')
11+
let runtime = 0
12+
13+
const valid = computed(() => {
14+
if (!start.value || !end.value) return false
15+
if (start.value > end.value) return false
16+
if (!Number.isInteger(n_tiles.value) || n_tiles.value < 0) return false
17+
return true
18+
})
19+
20+
watch([start, end, n_tiles], () => {
21+
error.value = ""
22+
if (start.value && end.value && start.value > end.value) {
23+
error.value = "Start date must be on or before end date."
24+
}
25+
if (Date.parse(start.value) < Date.parse("2014-10-01")) {
26+
error.value = "Data only available after Oct 2014"
27+
}
28+
if (!Number.isInteger(n_tiles.value)) {
29+
error.value = "Count must be an integer."
30+
}
31+
32+
33+
const runtime_per_year_per_tile_in_s = 384.673805
34+
const satellite_revisit_days = 6
35+
36+
let duration_years = (Date.parse(end.value) - Date.parse(start.value)) * 1e-3 / 60 / 60 / 24 / 365
37+
runtime = n_tiles.value * (duration_years*runtime_per_year_per_tile_in_s)^2
38+
})
39+
40+
onMounted(() => {
41+
start.value = "2022-01-01"
42+
end.value = "2023-01-01"
43+
})
44+
</script>
45+
---
46+
47+
148
# Pricing
249

350
This project is creating free and open-source software under the MIT license.
@@ -57,45 +104,3 @@ Please note that these results are not official offerings from any cloud provide
57104
Estimates may vary depending on the area of interest, orbits to be analysed, and execution platform.
58105
</div>
59106

60-
<script setup>
61-
import { ref, computed, onMounted, watch } from 'vue'
62-
63-
const start = ref('')
64-
const end = ref('')
65-
const n_tiles = ref(1)
66-
const submitted = ref(false)
67-
const error = ref('')
68-
let runtime = 0
69-
70-
const valid = computed(() => {
71-
if (!start.value || !end.value) return false
72-
if (start.value > end.value) return false
73-
if (!Number.isInteger(n_tiles.value) || n_tiles.value < 0) return false
74-
return true
75-
})
76-
77-
watch([start, end, n_tiles], () => {
78-
error.value = ""
79-
if (start.value && end.value && start.value > end.value) {
80-
error.value = "Start date must be on or before end date."
81-
}
82-
if (Date.parse(start.value) < Date.parse("2014-10-01")) {
83-
error.value = "Data only available after Oct 2014"
84-
}
85-
if (!Number.isInteger(n_tiles.value)) {
86-
error.value = "Count must be an integer."
87-
}
88-
89-
90-
const runtime_per_year_per_tile_in_s = 384.673805
91-
const satellite_revisit_days = 6
92-
93-
let duration_years = (Date.parse(end.value) - Date.parse(start.value)) * 1e-3 / 60 / 60 / 24 / 365
94-
runtime = n_tiles.value * (duration_years*runtime_per_year_per_tile_in_s)^2
95-
})
96-
97-
onMounted(() => {
98-
start.value = "2022-01-01"
99-
end.value = "2023-01-01"
100-
})
101-
</script>

0 commit comments

Comments
 (0)