Skip to content

Commit 3ca947d

Browse files
Switch to new API with UI keys
1 parent 26ed2b3 commit 3ca947d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

geophires/geophires-ui.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ function renderRevenueAndCashflowProfile(resultsData) {
207207

208208
}
209209

210+
let _UI_KEY = 'RONSrTE7Es7iIJ2D9S2Xn3e49vCXV1Sl7FFi3kaU'
211+
210212
function submitForm(oFormElement) {
211213
let parsed_params = JSON.parse(oFormElement.querySelector('textarea[name="geophires_input_parameters"]').value)
212214

@@ -276,6 +278,7 @@ function submitForm(oFormElement) {
276278
}
277279

278280
xhr.open(oFormElement.method, oFormElement.getAttribute("action"))
281+
xhr.setRequestHeader('x-api-key', _UI_KEY);
279282
xhr.send(JSON.stringify({
280283
'geophires_input_parameters': parsed_params,
281284
'output_format': 'json'
@@ -362,7 +365,8 @@ $(document).ready(function () {
362365

363366
if (location.hostname.indexOf('localhost') !== -1) {
364367
const path = 'get-geophires-result'
365-
const url = `https://dev.gt1.scientificweb.services/${path}`
368+
const url = `https://dev.gtp.scientificweb.services/${path}`
369+
_UI_KEY = 'dQz4mnNwyF68ho47m0biA2Q7mEt5Ub1Q2SV9ezhc'
366370
$('form.apiActionForm').attr('action', url)
367371

368372
setVisible($('#json-input-tab'), true)

geophires/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ <h3>
122122
id="geophires_param_form"
123123
method="POST"
124124
class="apiActionForm"
125-
action="https://prod.gt1.scientificweb.services/get-geophires-result">
125+
action="https://api.gtp.scientificweb.services/get-geophires-result">
126126
</form>
127127
</div>
128128
<div class="mui-tabs__pane" id="pane-default-3">
@@ -132,7 +132,7 @@ <h3>
132132
<form
133133
method="POST"
134134
class="apiActionForm"
135-
action="https://prod.gt1.scientificweb.services/get-geophires-result"
135+
action="https://api.gtp.scientificweb.services/get-geophires-result"
136136
onsubmit="return submitForm(this);">
137137
<textarea id="geophires_input_parameters"
138138
name="geophires_input_parameters"

0 commit comments

Comments
 (0)