Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-09-22 17:18:32 +08:00
commit 398ad1cd4d
5 changed files with 70 additions and 28 deletions

View File

@ -14,11 +14,11 @@ import Breadcrumb from '../Breadcrumb/Breadcrumb.js'
const MenuUser = (props) => (
<Menu theme="dark" className="user-menu" >
<Menu.Item style={{"background":"#32363a"}} key="0">
<Link to={`/user/profile/${props.uid}`} onClick={props.relieveLink}><Icon type="user"/>个人中心</Link>
<Menu.Item style={{"background":"#32363a",color:"white"}} key="0">
<Link style={{color:"white"}} to={`/user/profile/${props.uid}`} onClick={props.relieveLink}><Icon type="user"/>个人中心</Link>
</Menu.Item>
<Menu.Item key="1">
<a onClick={props.logout}><Icon type="logout" />退出</a>
<Menu.Item key="1">
<a style={{color:"white"}} onClick={props.logout}><Icon type="logout" />退出</a>
</Menu.Item>
</Menu>
);

View File

@ -549,7 +549,7 @@ export default class Run extends Component {
}
</div>
<Card title={<Tooltip placement="top" title="在项目设置配置domain">请求部分&nbsp;<Icon type="question-circle-o" /></Tooltip>} noHovering className="req-part">
<Card title={<Tooltip placement="top" title="在 '设置->环境配置' 配置 domain">请求部分&nbsp;<Icon type="question-circle-o" /></Tooltip>} noHovering className="req-part">
<div className="url">
<InputGroup compact style={{ display: 'flex' }}>
@ -567,7 +567,13 @@ export default class Run extends Component {
<Input disabled value={path + search} onChange={this.changePath} spellCheck="false" style={{ flexBasis: 180, flexGrow: 1 }} />
</InputGroup>
<Tooltip placement="bottom" title="请求真实接口">
<Tooltip placement="bottom" title={(() => {
if (hasPlugin) {
return '发送请求'
} else {
return '请安装cross-request插件'
}
})()}>
<Button
disabled={!hasPlugin}
onClick={this.reqRealInterface}
@ -593,14 +599,14 @@ export default class Run extends Component {
<div key={index} className="key-value-wrap">
<Input disabled value={item.name} onChange={e => this.changePathParam(e, index, true)} className="key" />
<span className="eq-symbol">=</span>
<AutoComplete
<AutoComplete
value={item.value}
onChange={e => this.changePathParam(e, index)}
className="value"
dataSource={mockDataSource}
placeholder="参数值"
optionLabelProp="value"
/>
/>
<Icon style={{ display: 'none' }} type="delete" className="icon-btn" onClick={() => this.deletePathParam(index)} />
</div>
)
@ -673,7 +679,7 @@ export default class Run extends Component {
bodyForm.map((item, index) => {
return (
<div key={index} className="key-value-wrap">
<Input disabled value={item.name} onChange={e => this.changeBody(e, index, 'key')} className="key" />
<Input disabled value={item.name} onChange={e => this.changeBody(e, index, 'key')} className="key" />
<span>[</span>
<Select disabled value={item.type} onChange={e => this.changeBody(e, index, 'type')}>
<Option value="file">File</Option>

View File

@ -1,7 +1,7 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Icon, Modal, Alert, Input, message, Menu, Row, Col } from 'antd'
import { Icon, Modal, Alert, Input, message, Menu, Row, Col, Dropdown } from 'antd'
import { autobind } from 'core-decorators';
import axios from 'axios';
import { withRouter } from 'react-router-dom';
@ -225,27 +225,41 @@ export default class GroupList extends Component {
render() {
const { currGroup } = this.props;
const delmark = <Icon className="edit-group" type="edit" title="编辑分组" onClick={() => this.showModal(TYPE_EDIT)} />
const editmark = <Icon className="delete-group" onClick={() => { this.showConfirm() }} type="delete" title="删除分组" />
const addmark = <Icon className="edit-group" onClick={this.showModal} type="plus" title="添加分组" />
const delmark = <Menu.Item>
<span onClick={() => this.showModal(TYPE_EDIT)}>编辑分组</span>
</Menu.Item>
// <Icon className="edit-group" type="edit" title="编辑分组" onClick={() => this.showModal(TYPE_EDIT)} />
const editmark = <Menu.Item>
<span onClick={() => { this.showConfirm() }}>删除分组</span>
</Menu.Item>
// <Icon className="delete-group" onClick={() => { this.showConfirm() }} type="delete" title="删除分组" />
const addmark = <Menu.Item>
<span onClick={this.showModal}>添加分组</span>
</Menu.Item>
// <Icon className="edit-group" onClick={this.showModal} type="plus" title="添加分组" />
let menu = <Menu>
{
this.props.curUserRole === "admin" ? (editmark) : ''
}
{
this.props.curUserRole === "admin" || currGroup.role ==='owner' ? (delmark) : ''
}
{
this.props.curUserRole === 'admin' ? (addmark) : ''
}
</Menu>;
menu = currGroup.role ==='owner'?<a className="editSet"><Icon type="setting" onClick={() => this.showModal(TYPE_EDIT)} /></a>:<Dropdown overlay={menu}>
<a className="ant-dropdown-link" href="#">
<Icon type="setting" />
</a>
</Dropdown>;
return (
<div className="m-group">
<div className="group-bar">
<div className="curr-group">
<div className="curr-group-name">
<span className="name">{currGroup.group_name}</span>
<span className="operate">
{
this.props.curUserRole === "admin" ? (editmark) : ''
}
{
this.props.curUserRole === "admin" || currGroup.role ==='owner' ? (delmark) : ''
}
{
this.props.curUserRole === 'admin' ? (addmark) : ''
}
</span>
{ this.props.curUserRole === "admin" || currGroup.role ==='owner' ? (menu) : '' }
</div>
<div className="curr-group-desc">简介: {currGroup.group_desc}</div>
</div>

View File

@ -26,11 +26,26 @@
}
.name{
display: inline-block;
width: 117px;
// width: 117px;
margin-right: 20px;
overflow: hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.editSet{
color: rgba(255, 255, 255, 0.85);
&:hover{
color: #2395f1;
}
}
.ant-dropdown-link{
float: right;
display: block;
color: rgba(255, 255, 255, 0.85);
&:hover{
color: #2395f1;
}
}
.operate {
font-size: 0;
width: 150px;
@ -123,3 +138,10 @@
line-height: 28px;
}
}
.user-menu{
a{
&:hover{
color: #ccc;
}
}
}

View File

@ -74,7 +74,7 @@
}
.ant-timeline-item-content{
background-color: #ececec;
background-color: #fafafa;
float: left;
width: auto;
margin-left: 40px;
@ -88,7 +88,7 @@
.logMesHeade{
color: white;
padding: 16px 8px 8px 8px;
background-color: rgba(35, 149, 241, 0.88);
background-color: rgb(91, 104, 117);
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}