-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 💡 update console-ui theme (#8951)
✅ Closes: #8950
- Loading branch information
Showing
38 changed files
with
28,871 additions
and
587 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { withRouter } from 'react-router-dom'; | ||
import { Icon, Message } from '@alifd/next'; | ||
import PropTypes from 'prop-types'; | ||
|
||
// 创建假元素 | ||
function createFakeElement(value) { | ||
const fakeElement = document.createElement('textarea'); | ||
|
||
fakeElement.style.border = '0'; | ||
fakeElement.style.padding = '0'; | ||
fakeElement.style.margin = '0'; | ||
|
||
fakeElement.style.position = 'absolute'; | ||
fakeElement.style.left = '-999px'; | ||
fakeElement.style.top = `${window.pageYOffset || document.documentElement.scrollTop}px`; | ||
fakeElement.setAttribute('readonly', ''); | ||
fakeElement.value = value; | ||
return fakeElement; | ||
} | ||
|
||
function copyText(value) { | ||
const element = createFakeElement(value); | ||
document.body.appendChild(element); | ||
|
||
// 选中元素 | ||
element.focus(); | ||
element.select(); | ||
element.setSelectionRange(0, element.value.length); | ||
|
||
document.execCommand('copy'); | ||
document.body.removeChild(element); | ||
Message.success('Success copied!'); | ||
} | ||
|
||
@withRouter | ||
class Copy extends React.Component { | ||
static displayName = 'Copy'; | ||
|
||
static propTypes = { | ||
style: PropTypes.object, | ||
value: PropTypes.string, | ||
textNode: PropTypes.string, | ||
className: PropTypes.string, | ||
showIcon: PropTypes.bool, | ||
}; | ||
|
||
render() { | ||
const { style = {}, value, textNode, className, showIcon = true } = this.props; | ||
return ( | ||
<div className={className} onClick={() => (showIcon ? '' : copyText(value))} style={style}> | ||
{textNode || value} | ||
{showIcon && ( | ||
<Icon | ||
title="复制" | ||
className="copy-icon" | ||
size="small" | ||
type="copy" | ||
onClick={() => copyText(value)} | ||
/> | ||
)} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Copy; |
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,69 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { Provider, connect } from 'react-redux'; | ||
import { withRouter } from 'react-router-dom'; | ||
import PropTypes from 'prop-types'; | ||
import Copy from '../Copy'; | ||
|
||
@withRouter | ||
@connect(state => ({ ...state.locale })) | ||
class PageTitle extends React.Component { | ||
static propTypes = { | ||
title: PropTypes.string, | ||
desc: PropTypes.string, | ||
nameSpace: PropTypes.bool, | ||
locale: PropTypes.object, | ||
}; | ||
|
||
getNameSpace(locale, desc, nameSpace) { | ||
if (!nameSpace) { | ||
return desc; | ||
} | ||
return ( | ||
<span style={{ display: 'flex', alignItems: 'center', marginLeft: 16 }}> | ||
{locale.NameSpace.namespaceID} | ||
<Copy | ||
style={{ | ||
marginLeft: 16, | ||
height: 32, | ||
display: 'flex', | ||
alignItems: 'center', | ||
background: 'rgb(239, 243, 248)', | ||
padding: '0px 8px', | ||
minWidth: 220, | ||
}} | ||
value={desc} | ||
/> | ||
</span> | ||
); | ||
} | ||
|
||
render() { | ||
const { title, desc, nameSpace, locale } = this.props; | ||
return ( | ||
<div style={{ display: 'flex', alignItems: 'center', marginTop: 8, marginBottom: 8 }}> | ||
<span style={{ fontSize: 28, height: 40, fontWeight: 500 }}>{title}</span> | ||
<span style={{ marginLeft: 4 }}> | ||
{desc && desc !== 'undefined' ? this.getNameSpace(locale, desc, nameSpace) : ''} | ||
</span> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PageTitle; |
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,43 @@ | ||
/* | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Provider, connect } from 'react-redux'; | ||
import './index.scss'; | ||
|
||
@connect(state => ({ ...state.locale })) | ||
class QueryResult extends React.Component { | ||
static displayName = 'QueryResult'; | ||
|
||
static propTypes = { | ||
locale: PropTypes.object, | ||
total: PropTypes.number, | ||
}; | ||
|
||
render() { | ||
const { locale = {}, total } = this.props; | ||
return ( | ||
<div className="query_result_wrapper"> | ||
{locale.ConfigurationManagement.queryResults} | ||
<strong style={{ fontWeight: 'bold' }}> {total} </strong> | ||
{locale.ConfigurationManagement.articleMeetRequirements} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default QueryResult; |
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,21 @@ | ||
/*! | ||
* Copyright 1999-2018 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
.query_result_wrapper{ | ||
font-size: 16px; | ||
margin-bottom: 16px; | ||
font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", STHeiti, "Microsoft YaHei"; | ||
} |
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
Oops, something went wrong.