|
@@ -33,13 +33,17 @@ const tabOptions = [
|
|
|
{ label: 'Chart Overview', value: 'graph' },
|
|
{ label: 'Chart Overview', value: 'graph' },
|
|
|
{ label: 'Search Chart', value: 'list' },
|
|
{ label: 'Search Chart', value: 'list' },
|
|
|
{ label: 'Raw Values', value: 'values' },
|
|
{ label: 'Raw Values', value: 'values' },
|
|
|
- { label: 'Logs', value: 'logs' },
|
|
|
|
|
|
|
+ { label: 'Detailed Logs', value: 'detailed-logs' },
|
|
|
|
|
+ { label: 'Deploy', value: 'deploy' },
|
|
|
|
|
+ { label: 'Settings', value: 'settings' },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
const basicOptions = [
|
|
const basicOptions = [
|
|
|
- { label: 'Update Values', value: 'values-form' },
|
|
|
|
|
|
|
+ { label: 'Values', value: 'values-form' },
|
|
|
{ label: 'Environment', value: 'environment' },
|
|
{ label: 'Environment', value: 'environment' },
|
|
|
{ label: 'Logs', value: 'logs' },
|
|
{ label: 'Logs', value: 'logs' },
|
|
|
|
|
+ { label: 'Deploy', value: 'deploy' },
|
|
|
|
|
+ { label: 'Settings', value: 'settings' },
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
// TODO: consolidate revisionPreview and currentChart (currentChart can just be the initial state)
|
|
// TODO: consolidate revisionPreview and currentChart (currentChart can just be the initial state)
|
|
@@ -83,17 +87,26 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
|
|
|
let { currentCluster } = this.context;
|
|
let { currentCluster } = this.context;
|
|
|
this.setState({ revisionPreview: oldChart });
|
|
this.setState({ revisionPreview: oldChart });
|
|
|
|
|
|
|
|
- api.getChartComponents('<token>', {
|
|
|
|
|
- namespace: oldChart.namespace,
|
|
|
|
|
- context: currentCluster,
|
|
|
|
|
- storage: StorageType.Secret
|
|
|
|
|
- }, { name: oldChart.name, revision: oldChart.version }, (err: any, res: any) => {
|
|
|
|
|
- if (err) {
|
|
|
|
|
- console.log(err)
|
|
|
|
|
- } else {
|
|
|
|
|
- this.setState({ components: res.data });
|
|
|
|
|
|
|
+ if (oldChart) {
|
|
|
|
|
+ api.getChartComponents('<token>', {
|
|
|
|
|
+ namespace: oldChart.namespace,
|
|
|
|
|
+ context: currentCluster,
|
|
|
|
|
+ storage: StorageType.Secret
|
|
|
|
|
+ }, { name: oldChart.name, revision: oldChart.version }, (err: any, res: any) => {
|
|
|
|
|
+ if (err) {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.setState({ components: res.data });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // Handle preview old chart while logs tab is open
|
|
|
|
|
+ if (this.state.currentTab === 'logs') {
|
|
|
|
|
+ this.setState({ currentTab: 'values-form' });
|
|
|
|
|
+ } else if (this.state.currentTab === 'detailed-logs') {
|
|
|
|
|
+ this.setState({ currentTab: 'graph' });
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
toggleDevOpsMode = () => {
|
|
toggleDevOpsMode = () => {
|
|
@@ -121,6 +134,21 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
|
|
|
return `${time} on ${date}`;
|
|
return `${time} on ${date}`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Hide certain tabs when previewing old charts
|
|
|
|
|
+ getTabOptions = () => {
|
|
|
|
|
+ let options = basicOptions.slice();
|
|
|
|
|
+ if (this.state.devOpsMode) {
|
|
|
|
|
+ options = tabOptions.slice();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (this.state.revisionPreview) {
|
|
|
|
|
+ options.pop();
|
|
|
|
|
+ options.pop();
|
|
|
|
|
+ options.pop();
|
|
|
|
|
+ }
|
|
|
|
|
+ return options;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
renderTabContents = () => {
|
|
renderTabContents = () => {
|
|
|
let { currentChart, refreshChart, setSidebar } = this.props;
|
|
let { currentChart, refreshChart, setSidebar } = this.props;
|
|
|
let chart = currentChart;
|
|
let chart = currentChart;
|
|
@@ -199,7 +227,7 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
|
|
|
|
|
|
|
|
<TagWrapper>
|
|
<TagWrapper>
|
|
|
Namespace
|
|
Namespace
|
|
|
- <NamespaceTag>
|
|
|
|
|
|
|
+ <NamespaceTag>
|
|
|
{chart.namespace}
|
|
{chart.namespace}
|
|
|
</NamespaceTag>
|
|
</NamespaceTag>
|
|
|
</TagWrapper>
|
|
</TagWrapper>
|
|
@@ -219,7 +247,8 @@ export default class ExpandedChart extends Component<PropsType, StateType> {
|
|
|
|
|
|
|
|
<TabSelectorWrapper>
|
|
<TabSelectorWrapper>
|
|
|
<TabSelector
|
|
<TabSelector
|
|
|
- options={this.state.devOpsMode ? tabOptions : basicOptions}
|
|
|
|
|
|
|
+ options={this.getTabOptions()}
|
|
|
|
|
+ color={this.state.revisionPreview ? '#f5cb42' : null}
|
|
|
currentTab={this.state.currentTab}
|
|
currentTab={this.state.currentTab}
|
|
|
setCurrentTab={(value: string) => this.setState({ currentTab: value })}
|
|
setCurrentTab={(value: string) => this.setState({ currentTab: value })}
|
|
|
addendum={
|
|
addendum={
|