-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from equinor/master
Release 83862 jobs in web console (#276)
- Loading branch information
Showing
73 changed files
with
1,884 additions
and
599 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
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,63 @@ | ||
import PropTypes from 'prop-types'; | ||
import { Link } from 'react-router-dom'; | ||
import * as routing from '../../utils/routing'; | ||
import SecretStatus from '../secret-status'; | ||
import React from 'react'; | ||
import { getEnvironment, getComponentSecret } from '../../state/environment'; | ||
import { connect } from 'react-redux'; | ||
import environmentModel from '../../models/environment'; | ||
|
||
const ActiveComponentSecrets = ({ | ||
appName, | ||
envName, | ||
componentName, | ||
secrets, | ||
environment, | ||
}) => { | ||
return ( | ||
<React.Fragment> | ||
<h2 className="o-heading-section">Secrets</h2> | ||
{secrets.length === 0 && <p>This component uses no secrets</p>} | ||
{secrets.length > 0 && ( | ||
<ul className="o-indent-list"> | ||
{secrets.map((secretName) => { | ||
let envSecret = getComponentSecret( | ||
environment, | ||
secretName, | ||
componentName | ||
); | ||
return ( | ||
<li key={secretName}> | ||
<Link | ||
to={routing.getSecretUrl( | ||
appName, | ||
envName, | ||
componentName, | ||
secretName | ||
)} | ||
> | ||
{secretName} | ||
</Link>{' '} | ||
<SecretStatus secret={envSecret} /> | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
)} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
ActiveComponentSecrets.propTypes = { | ||
appName: PropTypes.string.isRequired, | ||
envName: PropTypes.string.isRequired, | ||
componentName: PropTypes.string.isRequired, | ||
secrets: PropTypes.arrayOf(PropTypes.string), | ||
environment: PropTypes.shape(environmentModel), | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ | ||
environment: getEnvironment(state), | ||
}); | ||
|
||
export default connect(mapStateToProps)(ActiveComponentSecrets); |
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,34 @@ | ||
import Breadcrumb from '../breadcrumb'; | ||
import { routeWithParams } from '../../utils/string'; | ||
import routes from '../../routes'; | ||
import * as routing from '../../utils/routing'; | ||
import EnvironmentBadge from '../environment-badge'; | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const ComponentBreadCrumb = ({ appName, envName, componentName }) => { | ||
return ( | ||
<Breadcrumb | ||
links={[ | ||
{ label: appName, to: routeWithParams(routes.app, { appName }) }, | ||
{ label: 'Environments', to: routing.getEnvsUrl(appName) }, | ||
{ | ||
label: <EnvironmentBadge envName={envName} />, | ||
to: routeWithParams(routes.appEnvironment, { | ||
appName, | ||
envName, | ||
}), | ||
}, | ||
{ label: componentName }, | ||
]} | ||
/> | ||
); | ||
}; | ||
|
||
ComponentBreadCrumb.propTypes = { | ||
appName: PropTypes.string.isRequired, | ||
envName: PropTypes.string.isRequired, | ||
componentName: PropTypes.string.isRequired, | ||
}; | ||
|
||
export default ComponentBreadCrumb; |
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,29 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import PortModel from '../../models/port'; | ||
|
||
const ComponentPorts = ({ ports }) => { | ||
return ( | ||
<React.Fragment> | ||
{ports.length > 0 && ( | ||
<React.Fragment> | ||
<p>Open ports:</p> | ||
<ul className="o-indent-list"> | ||
{ports.map((port) => ( | ||
<li key={port.port}> | ||
{port.port} ({port.name}) | ||
</li> | ||
))} | ||
</ul> | ||
</React.Fragment> | ||
)} | ||
{ports.length === 0 && <p>No open ports</p>} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
ComponentPorts.propTypes = { | ||
ports: PropTypes.arrayOf(PropTypes.exact(PortModel)), | ||
}; | ||
|
||
export default ComponentPorts; |
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,39 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import { getEnvironment } from '../../state/environment'; | ||
import { connect } from 'react-redux'; | ||
import { buildComponentTypeLabelMap } from '../../models/component-type'; | ||
import Component from '../../models/component'; | ||
|
||
const ComponentSecrets = ({ component }) => { | ||
let componentTypeTitle = component | ||
? buildComponentTypeLabelMap(component.type) | ||
: ''; | ||
return ( | ||
<React.Fragment> | ||
<div> | ||
<h2 className="o-heading-section">Secrets</h2> | ||
{component && component.secrets.length === 0 && ( | ||
<p>This {componentTypeTitle.toLowerCase()} uses no secrets</p> | ||
)} | ||
{component && component.secrets.length > 0 && ( | ||
<ul className="o-indent-list"> | ||
{component.secrets.map((secret) => ( | ||
<li key={secret}>{secret}</li> | ||
))} | ||
</ul> | ||
)} | ||
</div> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
ComponentSecrets.propTypes = { | ||
component: PropTypes.arrayOf(PropTypes.shape(Component)), | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ | ||
environment: getEnvironment(state), | ||
}); | ||
|
||
export default connect(mapStateToProps)(ComponentSecrets); |
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,56 @@ | ||
import React from 'react'; | ||
|
||
const EnvVariables = ({ component, includeRadixVars }) => { | ||
let hasRadixVars = false; | ||
const envVarNames = component && Object.keys(component.variables); | ||
|
||
const varList = envVarNames.map((varName) => { | ||
const isRadixVar = varName.slice(0, 6) === 'RADIX_'; | ||
hasRadixVars = includeRadixVars && (hasRadixVars || isRadixVar); | ||
|
||
if (!isRadixVar) { | ||
return ( | ||
<React.Fragment key={varName}> | ||
<dt>{varName}</dt> | ||
<dd>{(component && component.variables)[varName]}</dd> | ||
</React.Fragment> | ||
); | ||
} | ||
|
||
if (includeRadixVars !== true) { | ||
return ''; | ||
} | ||
|
||
return ( | ||
<React.Fragment key={varName}> | ||
<dt> | ||
* <em>{varName}</em> | ||
</dt> | ||
<dd> | ||
<em>{(component && component.variables)[varName]}</em> | ||
</dd> | ||
</React.Fragment> | ||
); | ||
}); | ||
|
||
return ( | ||
<React.Fragment> | ||
<h2 className="o-heading-section">Environment variables</h2> | ||
{envVarNames.length === 0 && ( | ||
<p>This component uses no environment variables</p> | ||
)} | ||
{envVarNames.length > 0 && ( | ||
<div> | ||
<dl className="o-key-values">{varList}</dl> | ||
{hasRadixVars && ( | ||
<p> | ||
<small>* automatically added by Radix</small> | ||
</p> | ||
)} | ||
</div> | ||
)} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default EnvVariables; |
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,50 @@ | ||
import componentModel from '../../models/component'; | ||
import EnvVariables from '../component/env-variables'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import Alert from '../alert'; | ||
|
||
const JobSchedulerDetails = ({ component }) => { | ||
return ( | ||
<React.Fragment> | ||
<p>Job Scheduler:</p> | ||
<ul className="o-indent-list"> | ||
<li key="status"> | ||
status <strong>{component.status}</strong> | ||
</li> | ||
<li key="port"> | ||
port <strong>{component.schedulerPort}</strong> | ||
</li> | ||
<li key="url"> | ||
URL{' '} | ||
<strong> | ||
http://{component.name}:{component.schedulerPort}/api/v1 | ||
</strong> | ||
</li> | ||
<li key="payload-path"> | ||
payload{' '} | ||
{component.scheduledJobPayloadPath && | ||
component.scheduledJobPayloadPath.length > 0 && ( | ||
<strong>{component.scheduledJobPayloadPath}</strong> | ||
)} | ||
{!component.scheduledJobPayloadPath || | ||
(component.scheduledJobPayloadPath.length <= 0 && ( | ||
<strong>is empty</strong> | ||
))} | ||
</li> | ||
</ul> | ||
{component.status !== 'Consistent' && ( | ||
<Alert> | ||
Job-scheduler has been manually stopped; please note that new | ||
deployment will cause it to be restarted | ||
</Alert> | ||
)} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
EnvVariables.propTypes = { | ||
component: PropTypes.shape(componentModel), | ||
}; | ||
|
||
export default JobSchedulerDetails; |
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,26 @@ | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
import ComponentItem from '../../models/component-summary'; | ||
import { | ||
buildComponentMap, | ||
buildComponentTypeLabelMap, | ||
} from '../../models/component-type'; | ||
|
||
export const ComponentList = ({ components }) => { | ||
let compMap = buildComponentMap(components); | ||
return Object.keys(compMap).map((compType) => | ||
compMap[compType].map((component) => ( | ||
<p key={component.name}> | ||
{buildComponentTypeLabelMap(compType)} <strong>{component.name}</strong> | ||
</p> | ||
)) | ||
); | ||
}; | ||
|
||
ComponentList.propTypes = { | ||
appName: PropTypes.string.isRequired, | ||
jobName: PropTypes.string.isRequired, | ||
components: PropTypes.arrayOf(PropTypes.shape(ComponentItem)).isRequired, | ||
}; | ||
|
||
export default ComponentList; |
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
Oops, something went wrong.