Skip to content

Commit

Permalink
fix: modify wrong code
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslcj committed Sep 12, 2018
1 parent 48fdb4d commit b352f61
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ class ExportDialog extends React.Component {
}

doExport() {
document.getElementById('downloadLink').click();
// document.getElementById('downloadLink').click();
let url = this.getLink();
window.open(url);
this.closeDialog();
}

Expand All @@ -93,7 +95,8 @@ class ExportDialog extends React.Component {

render() {
const footer = <div>
<a id="downloadLink" style={{ display: "none" }} href={this.getLink()} /><Button type="primary" onClick={this.doExport.bind(this)} {...{ "disabled": this.state.total <= 0 }}>{window.aliwareIntl.get('nacos.component.ExportDialog.export3')}</Button>
{/* <a id="downloadLink" style={{ display: "none" }} href={this.getLink()} /> */}
<Button type="primary" onClick={this.doExport.bind(this)} {...{ "disabled": this.state.total <= 0 }}>{window.aliwareIntl.get('nacos.component.ExportDialog.export3')}</Button>
</div>;

return <div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,6 @@ class NameSpaceList extends React.Component {
<div style={{ color: '#00C1DE', float: 'left', height: '32px', lineHeight: '32px', paddingRight: 10 }}>
Namespace: {this.state.nownamespace}
</div>**/}
<div style={{ float: 'left' }} hidden={window._getLink && !window._getLink("dingding") && !window._getLink("discuz") && !window._getLink("learningPath")}>
{!window.globalConfig.isParentEdas() ? <div style={{ float: 'left', height: '32px', lineHeight: '32px' }}>{window.aliwareIntl.get('com.alibaba.nacos.component.NameSpaceList.online_customer_support')}<a href={window._getLink && window._getLink("dingding")} hidden={window._getLink && !window._getLink("dingding")} className={"dingding"}></a>
<a href={window._getLink && window._getLink("discuz")} hidden={window._getLink && !window._getLink("discuz")} target={"_blank"} style={{ marginLeft: 10 }}>{window.aliwareIntl.get('nacos.component.NameSpaceList.Forum')}</a>
<span style={{ marginRight: 5, marginLeft: 5 }}>|</span>
<a href={window._getLink && window._getLink("learningPath")} hidden={window._getLink && !window._getLink("learningPath")} target={"_blank"}>{window.aliwareIntl.get('nacos.component.NameSpaceList.Quick_to_learn0') /*快速学习*/}</a>

</div> : ''}
</div>

</div>;
}
}
Expand Down
5 changes: 4 additions & 1 deletion console/src/main/resources/static/src/globalLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ window.request = (function (window) {
//有mock数据 直接返回 生产环境失效
if (projectConfig.is_preview && serviceObj.is_mock && config.success) {
var code = null;
eval('code = ' + serviceObj.defaults + ';')
try {
code = JSON.parse(serviceObj.defaults);
} catch (error) {
}
config.success(code);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions console/src/main/resources/static/src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ window.require(['vs/editor/editor.main'], () => {
label: 'testing',
kind: window.monaco.languages.CompletionItemKind.Keyword,
insertText: {
value: 'testing(${1:condition})'
value: `testing(\${1:condition})`
}
}, {
label: 'ifelse',
kind: window.monaco.languages.CompletionItemKind.Snippet,
insertText: {
value: ['if (${1:condition}) {', '\t$0', '} else {', '\t', '}'].join('\n')
value: [`if (\${1:condition}) {`, '\t$0', '} else {', '\t', '}'].join('\n')
},
documentation: 'If-Else Statement'
}];
Expand Down
10 changes: 5 additions & 5 deletions console/src/main/resources/static/src/pages/Configeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,12 @@ class Configeditor extends React.Component {
//如果是在normal面板选择了beta发布
let sufex = new Date().getTime();
self.setState({
tag: [{ title: window.aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: 'normal' + '-' + sufex }, { title: 'BETA', key: 'beta' + '-' + sufex }], hasbeta: true,
activeKey: 'beta' + '-' + sufex
tag: [{ title: window.aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: `normal-${sufex}` }, { title: 'BETA', key: `beta-${sufex}` }], hasbeta: true,
activeKey: `beta-${sufex}`
});
payload.betaIps = payload.betaIps || payload.ips;
self.valueMap['beta'] = payload; //赋值beta
self.changeTab('beta' + '-' + sufex);
self.changeTab(`beta-${sufex}`);
}
if (activeKey === 'normal' && self.hasips === false) {
//如果是在normal面板选择了发布
Expand Down Expand Up @@ -525,15 +525,15 @@ class Configeditor extends React.Component {
}
setTimeout(() => {
let sufex = new Date().getTime();
let tag = [{ title: window.aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: 'normal' + '-' + sufex }];
let tag = [{ title: window.aliwareIntl.get('com.alibaba.nacos.page.configeditor.official'), key: `normal-${sufex}` }];
self.setState({
tag: tag,
checkedBeta: false,
activeKey: 'normal' + sufex,
hasbeta: false

});
self.changeTab('normal' + '-' + sufex);
self.changeTab(`normal-${sufex}`);
});

self.refs['success'].openDialog(_payload);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class ConfigurationManagement extends React.Component {
self.setState({
dataSource: data.pageItems,
total: data.totalCount,
currentPage: data.pagesAvailable
currentPage: data.pageNumber
});
if (clearSelect) {
self.setState({
Expand Down Expand Up @@ -441,7 +441,6 @@ class ConfigurationManagement extends React.Component {
</div>;
}
changePage(value) {
console.log(this.state, 'ss');
this.setState({
currentPage: value
});
Expand Down Expand Up @@ -935,26 +934,7 @@ class ConfigurationManagement extends React.Component {
</FormItem>
<FormItem label={""}>
<Button type={"primary"} style={{ marginRight: 10 }} onClick={this.selectAll.bind(this)} data-spm-click={"gostr=/aliyun;locaid=dashsearch"}>{window.aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.query')}</Button>

{/* <Button type="primary"
style={this.inApp ? {display:"none"}:{float: 'right', marginLeft: 10 }}
onClick={this.doBatch.bind(this, "import")}
data-spm-click="gostr=/aliyun;locaid=dashaddnew">{window.aliwareIntl.get('nacos.page.configurationManagement.import')}</Button>
<Button type="primary"
onClick={this.chooseEnv.bind(this)}
style={{ float: 'right', marginLeft: 10 }}
data-spm-click="gostr=/aliyun;locaid=dashdaoru">
<Icon type="edit" size={'small'} />{window.aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.new_listing')}</Button> */}
</FormItem>
{/* <FormItem style={this.inApp ? {display:"none"}:{ verticalAlign: "middle", marginTop: 8, marginLeft: 10 }}>
<Dropdown trigger={<span style={{ color: '#33cde5', fontSize: 12 }}>{window.aliwareIntl.get('nacos.page.configurationManagement.batch_management')}<Icon type="arrow-down-filling" size={'xs'} /></span>} triggerType="click" >
<Menu onClick={this.doBatch.bind(this)}>
<Menu.Item key="export">{window.aliwareIntl.get('nacos.page.configurationManagement.export')}</Menu.Item>
<Menu.Item key="clone">{window.aliwareIntl.get('nacos.page.configurationManagement.clone')}</Menu.Item>
<Menu.Item key="delete">{window.aliwareIntl.get('com.alibaba.nacos.page.configurationManagement.delete')}</Menu.Item>
</Menu>
</Dropdown>
</FormItem> */}
<FormItem style={this.inApp ? { display: "none" } : { verticalAlign: "middle", marginTop: 8, marginLeft: 10 }}>
<div style={{ color: '#33cde5', fontSize: 12, cursor: 'pointer' }} onClick={this.changeAdvancedQuery}>
<span style={{ marginRight: 5 }}>{window.aliwareIntl.get("nacos.page.configurationManagement.advanced_query9") /*高级查询*/}</span><Icon type={this.state.isAdvancedQuery ? 'arrow-up-filling' : 'arrow-down-filling'} size={'xs'} />
Expand Down

0 comments on commit b352f61

Please sign in to comment.