Skip to content

Commit

Permalink
Revert "Switch to new API with UI keys" - tested in prod, will switch…
Browse files Browse the repository at this point in the history
… back once alarms/dashboards are in place.

This reverts commit 3ca947d.
  • Loading branch information
softwareengineerprogrammer committed Apr 18, 2024
1 parent 3ca947d commit dee3289
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions geophires/geophires-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ function renderRevenueAndCashflowProfile(resultsData) {

}

let _UI_KEY = 'RONSrTE7Es7iIJ2D9S2Xn3e49vCXV1Sl7FFi3kaU'

function submitForm(oFormElement) {
let parsed_params = JSON.parse(oFormElement.querySelector('textarea[name="geophires_input_parameters"]').value)

Expand Down Expand Up @@ -278,7 +276,6 @@ function submitForm(oFormElement) {
}

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

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

setVisible($('#json-input-tab'), true)
Expand Down
4 changes: 2 additions & 2 deletions geophires/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h3>
id="geophires_param_form"
method="POST"
class="apiActionForm"
action="https://api.gtp.scientificweb.services/get-geophires-result">
action="https://prod.gt1.scientificweb.services/get-geophires-result">
</form>
</div>
<div class="mui-tabs__pane" id="pane-default-3">
Expand All @@ -132,7 +132,7 @@ <h3>
<form
method="POST"
class="apiActionForm"
action="https://api.gtp.scientificweb.services/get-geophires-result"
action="https://prod.gt1.scientificweb.services/get-geophires-result"
onsubmit="return submitForm(this);">
<textarea id="geophires_input_parameters"
name="geophires_input_parameters"
Expand Down

0 comments on commit dee3289

Please sign in to comment.