-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1fd036d
commit 57807c1
Showing
7 changed files
with
261 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import "@babel/polyfill"; | ||
import React from "react"; | ||
import { render } from "react-dom"; | ||
import App from "./components/App"; | ||
import { I18nextProvider } from "react-i18next"; | ||
import i18n from "./i18n"; | ||
import '@babel/polyfill' | ||
import React from 'react' | ||
import { render } from 'react-dom' | ||
import App from './components/App' | ||
import { I18nextProvider } from 'react-i18next' | ||
import i18n from './i18n' | ||
|
||
render( | ||
<I18nextProvider i18n={i18n}> | ||
<App /> | ||
</I18nextProvider>, | ||
document.querySelector("#root") | ||
); | ||
document.querySelector('#root'), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React from 'react' | ||
import { Container } from './../components' | ||
import GluuNotification from './../routes/Apps/Gluu/GluuNotification' | ||
import GluuCommitDialog from '../../app/routes/Apps/Gluu/GluuCommitDialog' | ||
import { useTranslation } from 'react-i18next' | ||
import ApiKey from './LicenseScreens/ApiKey' | ||
function ApiKeyRedirect({ | ||
backendIsUp, | ||
isLicenseValid, | ||
activateLicense, | ||
redirectUrl, | ||
islicenseCheckResultLoaded, | ||
isLicenseActivationResultLoaded, | ||
}) { | ||
const { t } = useTranslation() | ||
function submitForm(message) { | ||
activateLicense(message.trim()) | ||
} | ||
|
||
function toggle() { | ||
window.location.href = redirectUrl | ||
} | ||
|
||
return ( | ||
<React.Fragment> | ||
<Container> | ||
{/* <div | ||
style={{ | ||
backgroundColor: 'white', | ||
margin: 'auto', | ||
marginTop: '20%', | ||
}} | ||
> | ||
<img | ||
style={{ | ||
display: 'block', | ||
marginLeft: 'auto', | ||
marginTop: 'auto', | ||
marginRight: 'auto', | ||
width: '100%', | ||
height: '100%', | ||
}} | ||
src={require('../images/gif/npe-redirecting.gif')} | ||
alt="loading..." | ||
/> | ||
</div> */} | ||
{!isLicenseValid && islicenseCheckResultLoaded && <ApiKey />} | ||
{/* <GluuCommitDialog | ||
handler={toggle} | ||
modal={!isLicenseValid && islicenseCheckResultLoaded} | ||
onAccept={submitForm} | ||
isLoading={false} | ||
label={t( | ||
'License key required to access Gluu Admin UI. Please enter license key.', | ||
)} | ||
placeholderLabel={t('Enter license key')} | ||
inputType={'text'} | ||
/> */} | ||
{!backendIsUp && ( | ||
<GluuNotification | ||
type="error" | ||
message={t('The UI backend service is down')} | ||
description={t( | ||
'Please contact the side administrator or make sure it is up and running.', | ||
)} | ||
show={true} | ||
/> | ||
)} | ||
{isLicenseActivationResultLoaded && !isLicenseValid && ( | ||
<GluuNotification | ||
type="error" | ||
message={t('Invalid License')} | ||
description={t( | ||
'License has been not enabled for this application. Please contact support and confirm if license-key is correct.', | ||
)} | ||
show={true} | ||
/> | ||
)} | ||
</Container> | ||
</React.Fragment> | ||
) | ||
} | ||
export default ApiKeyRedirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React, { useState } from 'react' | ||
import logo from './../../images/logos/logo192.png' | ||
function ApiKey() { | ||
let params = { | ||
apiKey: '', | ||
productCode: '', | ||
sharedKey: '', | ||
managementKey: '', | ||
} | ||
|
||
const [values, setValues] = useState(params) | ||
|
||
const handleChange = (e) => { | ||
const { name, value } = e.target | ||
setValues((prevState) => ({ | ||
...prevState, | ||
[name]: value, | ||
})) | ||
} | ||
|
||
const submitValues = () => { | ||
console.log(values) | ||
} | ||
|
||
return ( | ||
<div> | ||
<div className="container text-dark"> | ||
<div className="row"> | ||
<div className="col-md-12 text-center my-5"> | ||
<img | ||
src={logo} | ||
style={{ maxWidth: '200px' }} | ||
className="img-fluid" | ||
/> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-md-8 text-center h2 mx-auto mb-3"> | ||
Please enter details to activate | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-md-8 mx-auto"> | ||
<label>Api Keys</label> | ||
<input | ||
type="text" | ||
className="form-control" | ||
value={values.apiKey} | ||
name="apiKey" | ||
onChange={handleChange} | ||
/> | ||
<label>Product Code</label> | ||
<input | ||
type="text" | ||
className="form-control" | ||
value={values.productCode} | ||
name="productCode" | ||
onChange={handleChange} | ||
/> | ||
<label>Shared Key</label> | ||
<input | ||
type="text" | ||
className="form-control" | ||
value={values.sharedKey} | ||
name="sharedKey" | ||
onChange={handleChange} | ||
/> | ||
<label>Management Key</label> | ||
<input | ||
type="text" | ||
className="form-control" | ||
value={values.managementKey} | ||
name="managementKey" | ||
onChange={handleChange} | ||
/> | ||
<input | ||
type="button" | ||
value={'Submit'} | ||
onClick={() => submitValues()} | ||
className="btn mt-3" | ||
style={{ backgroundColor: '#00a361', color: 'white' }} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
export default ApiKey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters