|
@@ -72,7 +72,7 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
formData: {} as any,
|
|
formData: {} as any,
|
|
|
upgradeVersion: "",
|
|
upgradeVersion: "",
|
|
|
devOpsMode: localStorage.getItem("devOpsMode") === "true",
|
|
devOpsMode: localStorage.getItem("devOpsMode") === "true",
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
expandedJobRun: null as any,
|
|
expandedJobRun: null as any,
|
|
|
pods: null as any,
|
|
pods: null as any,
|
|
|
};
|
|
};
|
|
@@ -160,7 +160,7 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
pushFiltered(
|
|
pushFiltered(
|
|
|
{ location: this.props.location, history: this.props.history },
|
|
{ location: this.props.location, history: this.props.history },
|
|
|
this.props.match.url,
|
|
this.props.match.url,
|
|
|
- ["project_id"],
|
|
|
|
|
|
|
+ ["project_id", "job"],
|
|
|
{
|
|
{
|
|
|
chart_revision: this.state.currentChart.version,
|
|
chart_revision: this.state.currentChart.version,
|
|
|
}
|
|
}
|
|
@@ -450,11 +450,9 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
sortJobsAndSave = (jobs: any[]) => {
|
|
sortJobsAndSave = (jobs: any[]) => {
|
|
|
-
|
|
|
|
|
// Set job run from URL if needed
|
|
// Set job run from URL if needed
|
|
|
const urlParams = new URLSearchParams(location.search);
|
|
const urlParams = new URLSearchParams(location.search);
|
|
|
const urlJob = urlParams.get("job");
|
|
const urlJob = urlParams.get("job");
|
|
|
- console.log("urljob:", urlJob);
|
|
|
|
|
|
|
|
|
|
jobs.sort((job1, job2) => {
|
|
jobs.sort((job1, job2) => {
|
|
|
if (job1.metadata.name === urlJob) {
|
|
if (job1.metadata.name === urlJob) {
|
|
@@ -483,11 +481,10 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
setJobRun = (job: any) => {
|
|
setJobRun = (job: any) => {
|
|
|
- console.log("got to set job", job);
|
|
|
|
|
this.getPods(job, () => {
|
|
this.getPods(job, () => {
|
|
|
this.setState({ expandedJobRun: job, currentTab: "logs" });
|
|
this.setState({ expandedJobRun: job, currentTab: "logs" });
|
|
|
});
|
|
});
|
|
|
- }
|
|
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
renderTabContents = (currentTab: string, submitValues?: any) => {
|
|
renderTabContents = (currentTab: string, submitValues?: any) => {
|
|
|
switch (currentTab) {
|
|
switch (currentTab) {
|
|
@@ -519,7 +516,6 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
setJobs={(jobs: any) => this.setState({ jobs })}
|
|
setJobs={(jobs: any) => this.setState({ jobs })}
|
|
|
isAuthorized={this.props.isAuthorized}
|
|
isAuthorized={this.props.isAuthorized}
|
|
|
saveValuesStatus={this.state.saveValuesStatus}
|
|
saveValuesStatus={this.state.saveValuesStatus}
|
|
|
-
|
|
|
|
|
expandJob={(job: any) => this.setJobRun(job)}
|
|
expandJob={(job: any) => this.setJobRun(job)}
|
|
|
/>
|
|
/>
|
|
|
</TabWrapper>
|
|
</TabWrapper>
|
|
@@ -750,16 +746,23 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
<Br />
|
|
<Br />
|
|
|
<Banner>
|
|
<Banner>
|
|
|
A template update is available.
|
|
A template update is available.
|
|
|
- <Link onClick={(e) => {
|
|
|
|
|
- e.stopPropagation();
|
|
|
|
|
- this.setState({
|
|
|
|
|
- upgradeVersion: currentChart.latest_version,
|
|
|
|
|
- });
|
|
|
|
|
- }}>
|
|
|
|
|
|
|
+ <Link
|
|
|
|
|
+ onClick={(e) => {
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ upgradeVersion: currentChart.latest_version,
|
|
|
|
|
+ });
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
View upgrade notes
|
|
View upgrade notes
|
|
|
</Link>
|
|
</Link>
|
|
|
</Banner>
|
|
</Banner>
|
|
|
- <Br /><Br /><Br /><Br /><Br /><Br />
|
|
|
|
|
|
|
+ <Br />
|
|
|
|
|
+ <Br />
|
|
|
|
|
+ <Br />
|
|
|
|
|
+ <Br />
|
|
|
|
|
+ <Br />
|
|
|
|
|
+ <Br />
|
|
|
</>
|
|
</>
|
|
|
)}
|
|
)}
|
|
|
</HeaderWrapper>
|
|
</HeaderWrapper>
|
|
@@ -825,10 +828,10 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
|
|
|
|
|
if (job.status?.failed >= 1) {
|
|
if (job.status?.failed >= 1) {
|
|
|
return (
|
|
return (
|
|
|
- <Status color="#cc3d42">Failed {time}
|
|
|
|
|
- {
|
|
|
|
|
- job.status.conditions.length > 0 && `: ${job.status.conditions[0].reason}`
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ <Status color="#cc3d42">
|
|
|
|
|
+ Failed {time}
|
|
|
|
|
+ {job.status.conditions.length > 0 &&
|
|
|
|
|
+ `: ${job.status.conditions[0].reason}`}
|
|
|
</Status>
|
|
</Status>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -898,12 +901,18 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
icon={currentChart.chart.metadata.icon}
|
|
icon={currentChart.chart.metadata.icon}
|
|
|
iconWidth="33px"
|
|
iconWidth="33px"
|
|
|
>
|
|
>
|
|
|
- {chart.name} <Gray>at {this.readableDate(run.status.startTime)}</Gray>
|
|
|
|
|
|
|
+ {chart.name}{" "}
|
|
|
|
|
+ <Gray>at {this.readableDate(run.status.startTime)}</Gray>
|
|
|
</TitleSection>
|
|
</TitleSection>
|
|
|
|
|
|
|
|
<InfoWrapper>
|
|
<InfoWrapper>
|
|
|
<LastDeployed>
|
|
<LastDeployed>
|
|
|
- {this.renderStatus(run, run.status.completionTime ? this.readableDate(run.status.completionTime) : "")}
|
|
|
|
|
|
|
+ {this.renderStatus(
|
|
|
|
|
+ run,
|
|
|
|
|
+ run.status.completionTime
|
|
|
|
|
+ ? this.readableDate(run.status.completionTime)
|
|
|
|
|
+ : ""
|
|
|
|
|
+ )}
|
|
|
<TagWrapper>
|
|
<TagWrapper>
|
|
|
Namespace <NamespaceTag>{chart.namespace}</NamespaceTag>
|
|
Namespace <NamespaceTag>{chart.namespace}</NamespaceTag>
|
|
|
</TagWrapper>
|
|
</TagWrapper>
|
|
@@ -917,26 +926,26 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
setCurrentTab={(x: string) => this.setState({ currentTab: x })}
|
|
setCurrentTab={(x: string) => this.setState({ currentTab: x })}
|
|
|
options={[
|
|
options={[
|
|
|
{
|
|
{
|
|
|
- label: "Logs", value: "logs",
|
|
|
|
|
|
|
+ label: "Logs",
|
|
|
|
|
+ value: "logs",
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- label: "Config", value: "config",
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ label: "Config",
|
|
|
|
|
+ value: "config",
|
|
|
|
|
+ },
|
|
|
]}
|
|
]}
|
|
|
>
|
|
>
|
|
|
- {
|
|
|
|
|
- this.state.currentTab === "logs" ? (
|
|
|
|
|
- <JobLogsWrapper>
|
|
|
|
|
- <Logs
|
|
|
|
|
- selectedPod={this.state.pods[0]}
|
|
|
|
|
- podError={!this.state.pods[0] ? "Pod no longer exists." : ""}
|
|
|
|
|
- rawText={true}
|
|
|
|
|
- />
|
|
|
|
|
- </JobLogsWrapper>
|
|
|
|
|
- ) : (
|
|
|
|
|
- <>{this.renderConfigSection(run)}</>
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ {this.state.currentTab === "logs" ? (
|
|
|
|
|
+ <JobLogsWrapper>
|
|
|
|
|
+ <Logs
|
|
|
|
|
+ selectedPod={this.state.pods[0]}
|
|
|
|
|
+ podError={!this.state.pods[0] ? "Pod no longer exists." : ""}
|
|
|
|
|
+ rawText={true}
|
|
|
|
|
+ />
|
|
|
|
|
+ </JobLogsWrapper>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <>{this.renderConfigSection(run)}</>
|
|
|
|
|
+ )}
|
|
|
</TabRegion>
|
|
</TabRegion>
|
|
|
</BodyWrapper>
|
|
</BodyWrapper>
|
|
|
</StyledExpandedChart>
|
|
</StyledExpandedChart>
|
|
@@ -946,13 +955,11 @@ class ExpandedJobChart extends Component<PropsType, StateType> {
|
|
|
render() {
|
|
render() {
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
- {
|
|
|
|
|
- !this.state.expandedJobRun ? (
|
|
|
|
|
- <>{this.renderExpandedChart()}</>
|
|
|
|
|
- ) : (
|
|
|
|
|
- <>{this.renderExpandedJobRun()}</>
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ {!this.state.expandedJobRun ? (
|
|
|
|
|
+ <>{this.renderExpandedChart()}</>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <>{this.renderExpandedJobRun()}</>
|
|
|
|
|
+ )}
|
|
|
</>
|
|
</>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|