Skip to content

Commit

Permalink
fix(console): 1.5.0-alpha bug fix (#959)
Browse files Browse the repository at this point in the history
* fix(console): promethus default config and imported cluster show upgrade

* fix(console): worker update error

* fix(console): query pod is all

* fix(console): adjust layout
  • Loading branch information
jo-hnny authored Dec 1, 2020
1 parent 9e57bde commit f11ef5e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const fetchPodActions = generateFetcherActionCreator({
} else {
podResourceInfo.namespaces = 'namespaces';
k8sQueryObj = {
labelSelector: resourceDetailState?.resourceDetailInfo?.selection?.spec?.selector?.matchlabels,
labelSelector: resourceDetailState?.resourceDetailInfo?.selection?.spec?.selector?.matchLabels,
fieldSelector: {
'metadata.name': podName ? podName : undefined,
'status.phase': phase ? phase : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ export class ClusterTablePanel extends React.Component<RootProps, State> {
{renderDeleteButton()}
{renderKuberctlButton()}
{/* {cluster.spec.type === 'Imported' && renderUpdateTokenButton()} */}
{cluster.spec.type === 'Imported' && renderUpdateTokenButton()}
{renderMoreButton()}
{/* {cluster.spec.type === 'Imported' && renderUpdateTokenButton()} */}
{cluster.spec.type !== 'Imported' && renderMoreButton()}
</React.Fragment>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ export function ConfigPromethus({ route, actions }: RootProps) {
const initialConfig: LocalConfigType = {
resources: {
limits: {
cpu: 0,
memory: 0
cpu: 4,
memory: 8096
},
requests: {
cpu: 0,
memory: 0
cpu: 0.1,
memory: 128
}
},
runOnMaster: false,
Expand All @@ -38,7 +38,6 @@ export function ConfigPromethus({ route, actions }: RootProps) {
return (
<AntdLayout
title="配置告警"
goBack={cancelBack}
footer={
<Space>
<Button type="primary" htmlType="submit" form="promethusConfigForm">
Expand All @@ -59,34 +58,34 @@ export function ConfigPromethus({ route, actions }: RootProps) {
>
<Form.Item label="Promethus CPU限制">
<Space>
<Form.Item noStyle name={['resources', 'limits', 'cpu']} rules={[{ type: 'number' }]}>
<InputNumber style={inputStyle} />
<Form.Item noStyle name={['resources', 'limits', 'cpu']} rules={[{ type: 'number', min: 0 }]}>
<InputNumber style={inputStyle} min={0} />
</Form.Item>
</Space>
</Form.Item>
<Form.Item label="Promethus CPU预留">
<Space>
<Form.Item noStyle name={['resources', 'requests', 'cpu']} rules={[{ type: 'number' }]}>
<InputNumber style={inputStyle} />
<Form.Item noStyle name={['resources', 'requests', 'cpu']} rules={[{ type: 'number', min: 0 }]}>
<InputNumber style={inputStyle} min={0} />
</Form.Item>
</Space>
</Form.Item>
<Form.Item label="Promethus 内存限制">
<Space>
<Form.Item noStyle name={['resources', 'limits', 'memory']} rules={[{ type: 'number' }]}>
<InputNumber style={inputStyle} />
<Form.Item noStyle name={['resources', 'limits', 'memory']} rules={[{ type: 'number', min: 4 }]}>
<InputNumber style={inputStyle} min={4} />
</Form.Item>
Gi
Mi
</Space>
</Form.Item>
<Form.Item label="Promethus 内存预留">
<Space>
<Form.Item noStyle name={['resources', 'requests', 'memory']} rules={[{ type: 'number' }]}>
<InputNumber style={inputStyle} />
<Form.Item noStyle name={['resources', 'requests', 'memory']} rules={[{ type: 'number', min: 4 }]}>
<InputNumber style={inputStyle} min={4} />
</Form.Item>
Gi
Mi
</Space>
</Form.Item>
<Form.Item label="Master节点上运行">
Expand All @@ -102,8 +101,8 @@ export function ConfigPromethus({ route, actions }: RootProps) {
</Form.Item>
<Form.Item label="重复告警的间隔">
<Space>
<Form.Item noStyle name={['alertRepeatInterval']} rules={[{ type: 'number' }]}>
<InputNumber style={inputStyle} />
<Form.Item noStyle name={['alertRepeatInterval']} rules={[{ type: 'number', min: 0 }]}>
<InputNumber style={inputStyle} min={0} />
</Form.Item>
m
</Space>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function WorkerUpdate({ route }: RootProps) {
title="升级Worker"
footer={
<Space>
<Button type="primary" disabled={targetKeys.length > 0} onClick={submit}>
<Button type="primary" disabled={targetKeys.length <= 0} onClick={submit}>
确定
</Button>
<Button onClick={goback}>取消</Button>
Expand All @@ -86,7 +86,7 @@ export function WorkerUpdate({ route }: RootProps) {
>
<Form labelAlign="left" labelCol={{ span: 3 }} size="middle">
<Form.Item label=" 升级说明">
当前所选集群Master版本为1.16.3,您可为您的节点Kubernetes版本升级到当前的最新版本。
当前所选集群Master版本为{clusterVersion},您可为您的节点Kubernetes版本升级到当前的最新版本。
</Form.Item>

<Form.Item label="选择节点">
Expand Down
5 changes: 2 additions & 3 deletions web/console/src/modules/common/layouts/AntdLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { Card, Layout, Space, PageHeader } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { Card, Layout, PageHeader } from 'antd';

const { Header, Content, Footer } = Layout;
const { Content, Footer } = Layout;

export interface AntdLayoutProps {
title: string;
Expand Down

0 comments on commit f11ef5e

Please sign in to comment.