mirror of
https://github.com/YMFE/yapi.git
synced 2025-02-23 13:59:28 +08:00
feat: merge master
This commit is contained in:
commit
efe0879e66
15
CHANGELOG.md
15
CHANGELOG.md
@ -1,5 +1,16 @@
|
||||
### Todo
|
||||
* 修复接口更新时,如果 requestType 是 json,自动增加header "content-type/json"
|
||||
### v1.4.2
|
||||
* 优化数据导入对 headers 处理,如果 requestType 是 json,自动增加header "content-type/json"
|
||||
|
||||
### v1.4.1
|
||||
|
||||
* 支持任何人都可以添加分组,只有管理员才能修改项目是否公开
|
||||
* 支持 mongodb 集群
|
||||
|
||||
#### Bug Fixed
|
||||
* 修改 mock严格模式,GET带有 JSON BODY 导致的验证问题
|
||||
* 对 queryPath 改动导致的bug,支持通过 xxx?controller=name 等 query 参数区分路径
|
||||
* 因 tui-editor 需要安装github 依赖,导致部分机器无法部署成功的问题
|
||||
|
||||
|
||||
### v1.3.23
|
||||
|
||||
|
@ -21,8 +21,7 @@ const changeHeight = {
|
||||
state => {
|
||||
return {
|
||||
loginData: state.user,
|
||||
isLDAP: state.user.isLDAP,
|
||||
canRegister: state.user.canRegister
|
||||
isLDAP: state.user.isLDAP
|
||||
};
|
||||
},
|
||||
{
|
||||
@ -44,8 +43,7 @@ class Login extends Component {
|
||||
history: PropTypes.object,
|
||||
loginActions: PropTypes.func,
|
||||
loginLdapActions: PropTypes.func,
|
||||
isLDAP: PropTypes.bool,
|
||||
canRegister: PropTypes.bool
|
||||
isLDAP: PropTypes.bool
|
||||
};
|
||||
|
||||
handleSubmit = e => {
|
||||
@ -81,7 +79,8 @@ class Login extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator, canRegister } = this.props.form;
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
|
||||
const { isLDAP } = this.props;
|
||||
|
||||
const emailRule =
|
||||
@ -99,7 +98,7 @@ class Login extends Component {
|
||||
<FormItem>
|
||||
<RadioGroup defaultValue="ldap" onChange={this.handleFormLayoutChange}>
|
||||
<Radio value="ldap">LDAP</Radio>
|
||||
<Radio value="normal" disabled={!canRegister}>普通登录</Radio>
|
||||
<Radio value="normal">普通登录</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
)}
|
||||
|
@ -9,7 +9,7 @@ const TabPane = Tabs.TabPane;
|
||||
|
||||
@connect(state => ({
|
||||
loginWrapActiveKey: state.user.loginWrapActiveKey,
|
||||
canRegister: state.canRegister
|
||||
canRegister: state.user.canRegister
|
||||
}))
|
||||
export default class LoginWrap extends Component {
|
||||
constructor(props) {
|
||||
@ -23,7 +23,7 @@ export default class LoginWrap extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loginWrapActiveKey } = this.props;
|
||||
const { loginWrapActiveKey, canRegister } = this.props;
|
||||
{/** show only login when register is disabled */}
|
||||
return (
|
||||
<Tabs
|
||||
@ -34,7 +34,7 @@ export default class LoginWrap extends Component {
|
||||
<TabPane tab="登录" key="1">
|
||||
<LoginForm />
|
||||
</TabPane>
|
||||
<TabPane tab="注册" key="2">
|
||||
<TabPane tab="注册" key="2" disabled={!canRegister}>
|
||||
<RegForm />
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
|
@ -19,8 +19,8 @@ const ReqBodySchema = jSchema({ lang: 'zh_CN', mock: MOCK_SOURCE });
|
||||
const TabPane = Tabs.TabPane;
|
||||
|
||||
|
||||
require('common/tui-editor/dist/tui-editor.css'); // editor ui
|
||||
require('common/tui-editor/dist/tui-editor-contents.css'); // editor content
|
||||
require('common/tui-editor/dist/tui-editor.min.css'); // editor ui
|
||||
require('common/tui-editor/dist/tui-editor-contents.min.css'); // editor content
|
||||
require('./editor.css');
|
||||
|
||||
|
||||
|
@ -331,11 +331,13 @@ class InterfaceMenu extends Component {
|
||||
}
|
||||
};
|
||||
// 数据过滤
|
||||
filterList = (list, arr) => {
|
||||
filterList = list => {
|
||||
let that = this;
|
||||
let arr = [];
|
||||
let menuList = produce(list, draftList => {
|
||||
draftList.filter(item => {
|
||||
let interfaceFilter = false;
|
||||
// arr = [];
|
||||
if (item.name.indexOf(that.state.filter) === -1) {
|
||||
item.list = item.list.filter(inter => {
|
||||
if (
|
||||
@ -356,7 +358,7 @@ class InterfaceMenu extends Component {
|
||||
});
|
||||
});
|
||||
|
||||
return menuList;
|
||||
return { menuList, arr };
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -458,7 +460,6 @@ class InterfaceMenu extends Component {
|
||||
};
|
||||
|
||||
const itemInterfaceCreate = item => {
|
||||
|
||||
return (
|
||||
<TreeNode
|
||||
title={
|
||||
@ -507,12 +508,13 @@ class InterfaceMenu extends Component {
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
let currentKes = defaultExpandedKeys();
|
||||
let menuList;
|
||||
if (this.state.filter) {
|
||||
let arr = [];
|
||||
menuList = this.filterList(this.state.list, arr);
|
||||
let res = this.filterList(this.state.list);
|
||||
menuList = res.menuList;
|
||||
currentKes.expands = res.arr;
|
||||
} else {
|
||||
menuList = this.state.list;
|
||||
}
|
||||
@ -546,7 +548,8 @@ class InterfaceMenu extends Component {
|
||||
}}
|
||||
to={'/project/' + matchParams.id + '/interface/api'}
|
||||
>
|
||||
<Icon type="folder" style={{ marginRight: 5 }} />全部接口
|
||||
<Icon type="folder" style={{ marginRight: 5 }} />
|
||||
全部接口
|
||||
</Link>
|
||||
}
|
||||
key="root"
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
.tui-editor-contents h1 {
|
||||
font-size: 45px;
|
||||
line-height: 1.5;
|
||||
@ -33,7 +32,6 @@
|
||||
color: #333;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
@ -134,8 +132,6 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* BASICS */
|
||||
|
||||
.CodeMirror {
|
||||
@ -155,7 +151,8 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
padding: 0 4px; /* Horizontal padding of content */
|
||||
}
|
||||
|
||||
.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
background-color: white; /* The little square between H and V scrollbars */
|
||||
}
|
||||
|
||||
@ -166,7 +163,7 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
background-color: #f7f7f7;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.CodeMirror-linenumbers {}
|
||||
|
||||
.CodeMirror-linenumber {
|
||||
padding: 0 3px 0 5px;
|
||||
min-width: 20px;
|
||||
@ -175,8 +172,12 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.CodeMirror-guttermarker { color: black; }
|
||||
.CodeMirror-guttermarker-subtle { color: #999; }
|
||||
.CodeMirror-guttermarker {
|
||||
color: black;
|
||||
}
|
||||
.CodeMirror-guttermarker-subtle {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* CURSOR */
|
||||
|
||||
@ -212,81 +213,168 @@ github.com style (c) Vasily Polovnyov <vast@whiteants.net>
|
||||
background-color: #7e7;
|
||||
}
|
||||
@-moz-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
@keyframes blink {
|
||||
0% {}
|
||||
50% { background-color: transparent; }
|
||||
100% {}
|
||||
0% {
|
||||
}
|
||||
50% {
|
||||
background-color: transparent;
|
||||
}
|
||||
100% {
|
||||
}
|
||||
}
|
||||
|
||||
/* Can style cursor different in overwrite (non-insert) mode */
|
||||
.CodeMirror-overwrite .CodeMirror-cursor {}
|
||||
/* .CodeMirror-overwrite .CodeMirror-cursor {
|
||||
} */
|
||||
|
||||
.cm-tab { display: inline-block; text-decoration: inherit; }
|
||||
.cm-tab {
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
.CodeMirror-rulers {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: -50px; bottom: -20px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: -50px;
|
||||
bottom: -20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.CodeMirror-ruler {
|
||||
border-left: 1px solid #ccc;
|
||||
top: 0; bottom: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
/* DEFAULT THEME */
|
||||
|
||||
.cm-s-default .cm-header {color: blue;}
|
||||
.cm-s-default .cm-quote {color: #090;}
|
||||
.cm-negative {color: #d44;}
|
||||
.cm-positive {color: #292;}
|
||||
.cm-header, .cm-strong {font-weight: bold;}
|
||||
.cm-em {font-style: italic;}
|
||||
.cm-link {text-decoration: underline;}
|
||||
.cm-strikethrough {text-decoration: line-through;}
|
||||
.cm-s-default .cm-header {
|
||||
color: blue;
|
||||
}
|
||||
.cm-s-default .cm-quote {
|
||||
color: #090;
|
||||
}
|
||||
.cm-negative {
|
||||
color: #d44;
|
||||
}
|
||||
.cm-positive {
|
||||
color: #292;
|
||||
}
|
||||
.cm-header,
|
||||
.cm-strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
.cm-em {
|
||||
font-style: italic;
|
||||
}
|
||||
.cm-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.cm-strikethrough {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-keyword {color: #708;}
|
||||
.cm-s-default .cm-atom {color: #219;}
|
||||
.cm-s-default .cm-number {color: #164;}
|
||||
.cm-s-default .cm-def {color: #00f;}
|
||||
.cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-keyword {
|
||||
color: #708;
|
||||
}
|
||||
.cm-s-default .cm-atom {
|
||||
color: #219;
|
||||
}
|
||||
.cm-s-default .cm-number {
|
||||
color: #164;
|
||||
}
|
||||
.cm-s-default .cm-def {
|
||||
color: #00f;
|
||||
}
|
||||
/* .cm-s-default .cm-variable,
|
||||
.cm-s-default .cm-punctuation,
|
||||
.cm-s-default .cm-property,
|
||||
.cm-s-default .cm-operator {}
|
||||
.cm-s-default .cm-variable-2 {color: #05a;}
|
||||
.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
|
||||
.cm-s-default .cm-comment {color: #a50;}
|
||||
.cm-s-default .cm-string {color: #a11;}
|
||||
.cm-s-default .cm-string-2 {color: #f50;}
|
||||
.cm-s-default .cm-meta {color: #555;}
|
||||
.cm-s-default .cm-qualifier {color: #555;}
|
||||
.cm-s-default .cm-builtin {color: #30a;}
|
||||
.cm-s-default .cm-bracket {color: #997;}
|
||||
.cm-s-default .cm-tag {color: #170;}
|
||||
.cm-s-default .cm-attribute {color: #00c;}
|
||||
.cm-s-default .cm-hr {color: #999;}
|
||||
.cm-s-default .cm-link {color: #00c;}
|
||||
.cm-s-default .cm-operator {
|
||||
} */
|
||||
.cm-s-default .cm-variable-2 {
|
||||
color: #05a;
|
||||
}
|
||||
.cm-s-default .cm-variable-3,
|
||||
.cm-s-default .cm-type {
|
||||
color: #085;
|
||||
}
|
||||
.cm-s-default .cm-comment {
|
||||
color: #a50;
|
||||
}
|
||||
.cm-s-default .cm-string {
|
||||
color: #a11;
|
||||
}
|
||||
.cm-s-default .cm-string-2 {
|
||||
color: #f50;
|
||||
}
|
||||
.cm-s-default .cm-meta {
|
||||
color: #555;
|
||||
}
|
||||
.cm-s-default .cm-qualifier {
|
||||
color: #555;
|
||||
}
|
||||
.cm-s-default .cm-builtin {
|
||||
color: #30a;
|
||||
}
|
||||
.cm-s-default .cm-bracket {
|
||||
color: #997;
|
||||
}
|
||||
.cm-s-default .cm-tag {
|
||||
color: #170;
|
||||
}
|
||||
.cm-s-default .cm-attribute {
|
||||
color: #00c;
|
||||
}
|
||||
.cm-s-default .cm-hr {
|
||||
color: #999;
|
||||
}
|
||||
.cm-s-default .cm-link {
|
||||
color: #00c;
|
||||
}
|
||||
|
||||
.cm-s-default .cm-error {color: #f00;}
|
||||
.cm-invalidchar {color: #f00;}
|
||||
.cm-s-default .cm-error {
|
||||
color: #f00;
|
||||
}
|
||||
.cm-invalidchar {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
.CodeMirror-composing { border-bottom: 2px solid; }
|
||||
.CodeMirror-composing {
|
||||
border-bottom: 2px solid;
|
||||
}
|
||||
|
||||
/* Default styles for common addons */
|
||||
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
|
||||
.CodeMirror-activeline-background {background: #e8f2ff;}
|
||||
div.CodeMirror span.CodeMirror-matchingbracket {
|
||||
color: #0b0;
|
||||
}
|
||||
div.CodeMirror span.CodeMirror-nonmatchingbracket {
|
||||
color: #a22;
|
||||
}
|
||||
.CodeMirror-matchingtag {
|
||||
background: rgba(255, 150, 0, 0.3);
|
||||
}
|
||||
.CodeMirror-activeline-background {
|
||||
background: #e8f2ff;
|
||||
}
|
||||
|
||||
/* STOP */
|
||||
|
||||
@ -303,7 +391,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
overflow: scroll !important; /* Things will break if this is overridden */
|
||||
/* 30px is the magic margin used to hide the element's real scrollbars */
|
||||
/* See overflow: hidden in .CodeMirror */
|
||||
margin-bottom: -30px; margin-right: -30px;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none; /* Prevent dragging from highlighting the element */
|
||||
@ -317,30 +406,39 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
/* The fake, visible scrollbars. Used to force redraw during scrolling
|
||||
before actual scrolling happens, thus preventing shaking and
|
||||
flickering artifacts. */
|
||||
.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
|
||||
.CodeMirror-vscrollbar,
|
||||
.CodeMirror-hscrollbar,
|
||||
.CodeMirror-scrollbar-filler,
|
||||
.CodeMirror-gutter-filler {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
display: none;
|
||||
}
|
||||
.CodeMirror-vscrollbar {
|
||||
right: 0; top: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.CodeMirror-hscrollbar {
|
||||
bottom: 0; left: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow-y: hidden;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.CodeMirror-scrollbar-filler {
|
||||
right: 0; bottom: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
.CodeMirror-gutter-filler {
|
||||
left: 0; bottom: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.CodeMirror-gutters {
|
||||
position: absolute; left: 0; top: 0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
min-height: 100%;
|
||||
z-index: 3;
|
||||
}
|
||||
@ -359,7 +457,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
}
|
||||
.CodeMirror-gutter-background {
|
||||
position: absolute;
|
||||
top: 0; bottom: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-elt {
|
||||
@ -367,8 +466,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
cursor: default;
|
||||
z-index: 4;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
|
||||
.CodeMirror-gutter-wrapper ::selection {
|
||||
background-color: transparent;
|
||||
}
|
||||
.CodeMirror-gutter-wrapper ::-moz-selection {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.CodeMirror-lines {
|
||||
cursor: text;
|
||||
@ -376,7 +479,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
}
|
||||
.CodeMirror pre {
|
||||
/* Reset some styles that the rest of the page might have set */
|
||||
-moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
|
||||
-moz-border-radius: 0;
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
border-width: 0;
|
||||
background: transparent;
|
||||
font-family: inherit;
|
||||
@ -401,7 +506,10 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
|
||||
.CodeMirror-linebackground {
|
||||
position: absolute;
|
||||
left: 0; right: 0; top: 0; bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
@ -411,9 +519,12 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
padding: 0.1px; /* Force widget margins to stay inside of the container */
|
||||
}
|
||||
|
||||
.CodeMirror-widget {}
|
||||
/* .CodeMirror-widget {
|
||||
} */
|
||||
|
||||
.CodeMirror-rtl pre { direction: rtl; }
|
||||
.CodeMirror-rtl pre {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.CodeMirror-code {
|
||||
outline: none;
|
||||
@ -441,7 +552,9 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
}
|
||||
.CodeMirror-measure pre { position: static; }
|
||||
.CodeMirror-measure pre {
|
||||
position: static;
|
||||
}
|
||||
|
||||
div.CodeMirror-cursors {
|
||||
visibility: hidden;
|
||||
@ -456,19 +569,35 @@ div.CodeMirror-dragcursors {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.CodeMirror-selected { background: #d9d9d9; }
|
||||
.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
|
||||
.CodeMirror-crosshair { cursor: crosshair; }
|
||||
.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; }
|
||||
.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
|
||||
.CodeMirror-selected {
|
||||
background: #d9d9d9;
|
||||
}
|
||||
.CodeMirror-focused .CodeMirror-selected {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
.CodeMirror-crosshair {
|
||||
cursor: crosshair;
|
||||
}
|
||||
.CodeMirror-line::selection,
|
||||
.CodeMirror-line > span::selection,
|
||||
.CodeMirror-line > span > span::selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
.CodeMirror-line::-moz-selection,
|
||||
.CodeMirror-line > span::-moz-selection,
|
||||
.CodeMirror-line > span > span::-moz-selection {
|
||||
background: #d7d4f0;
|
||||
}
|
||||
|
||||
.cm-searching {
|
||||
background-color: #ffa;
|
||||
background-color: rgba(255, 255, 0, .4);
|
||||
background-color: rgba(255, 255, 0, 0.4);
|
||||
}
|
||||
|
||||
/* Used to force a border model for a node */
|
||||
.cm-force-border { padding-right: .1px; }
|
||||
.cm-force-border {
|
||||
padding-right: 0.1px;
|
||||
}
|
||||
|
||||
@media print {
|
||||
/* Hide the cursor when printing */
|
||||
@ -478,7 +607,11 @@ div.CodeMirror-dragcursors {
|
||||
}
|
||||
|
||||
/* See issue #2901 */
|
||||
.cm-tab-wrap-hack:after { content: ''; }
|
||||
.cm-tab-wrap-hack:after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
/* Help users use markselection to safely style text background */
|
||||
span.CodeMirror-selectedtext { background: none; }
|
||||
span.CodeMirror-selectedtext {
|
||||
background: none;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class ProjectData extends Component {
|
||||
this.state = {
|
||||
selectCatid: '',
|
||||
menuList: [],
|
||||
curImportType: null,
|
||||
curImportType: 'swagger',
|
||||
curExportType: null,
|
||||
showLoading: false,
|
||||
dataSync: 'good',
|
||||
@ -336,6 +336,7 @@ class ProjectData extends Component {
|
||||
<div className="dataImportTile">
|
||||
<Select
|
||||
placeholder="请选择导入数据的方式"
|
||||
value={this.state.curImportType}
|
||||
onChange={this.handleImportType}
|
||||
>
|
||||
{Object.keys(importDataModule).map(name => {
|
||||
|
140671
common/tui-editor/dist/tui-editor-Editor-all.js
vendored
140671
common/tui-editor/dist/tui-editor-Editor-all.js
vendored
File diff suppressed because one or more lines are too long
79203
common/tui-editor/dist/tui-editor-Editor.js
vendored
79203
common/tui-editor/dist/tui-editor-Editor.js
vendored
File diff suppressed because one or more lines are too long
105943
common/tui-editor/dist/tui-editor-Viewer-all.js
vendored
105943
common/tui-editor/dist/tui-editor-Viewer-all.js
vendored
File diff suppressed because one or more lines are too long
45688
common/tui-editor/dist/tui-editor-Viewer.js
vendored
45688
common/tui-editor/dist/tui-editor-Viewer.js
vendored
File diff suppressed because one or more lines are too long
239
common/tui-editor/dist/tui-editor-contents.css
vendored
239
common/tui-editor/dist/tui-editor-contents.css
vendored
@ -1,239 +0,0 @@
|
||||
@charset "UTF-8";
|
||||
/**
|
||||
* @fileoverview style for content
|
||||
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com>
|
||||
*/
|
||||
|
||||
.CodeMirror {
|
||||
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
.tui-editor-contents *:not(table) {
|
||||
line-height: 160%;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.tui-editor-contents i,
|
||||
.tui-editor-contents cite,
|
||||
.tui-editor-contents em,
|
||||
.tui-editor-contents var,
|
||||
.tui-editor-contents address,
|
||||
.tui-editor-contents dfn {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.tui-editor-contents strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tui-editor-contents p {
|
||||
margin: 10px 0;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.tui-editor-contents > h1:first-of-type,
|
||||
.tui-editor-contents > div > div:first-of-type h1 {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.tui-editor-contents h1,
|
||||
.tui-editor-contents h2,
|
||||
.tui-editor-contents h3,
|
||||
.tui-editor-contents h5 {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tui-editor-contents h1 {
|
||||
font-size: 1.6rem;
|
||||
line-height: 28px;
|
||||
border-bottom: 3px double #999;
|
||||
margin: 52px 0 15px 0;
|
||||
padding-bottom: 7px;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.tui-editor-contents h2 {
|
||||
font-size: 1.3rem;
|
||||
line-height: 23px;
|
||||
border-bottom: 1px solid #dbdbdb;
|
||||
margin: 30px 0 13px 0;
|
||||
padding-bottom: 7px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tui-editor-contents h3,
|
||||
.tui-editor-contents h4 {
|
||||
font-size: 1.2rem;
|
||||
line-height: 18px;
|
||||
margin: 20px 0 2px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tui-editor-contents h5,
|
||||
.tui-editor-contents h6 {
|
||||
font-size: 1rem;
|
||||
line-height: 17px;
|
||||
margin: 10px 0 -4px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.tui-editor-contents blockquote {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents blockquote {
|
||||
border-left: 4px solid #dddddd;
|
||||
padding: 0 15px;
|
||||
color: #777777;
|
||||
}
|
||||
|
||||
.tui-editor-contents blockquote > :first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents blockquote > :last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents pre,
|
||||
.tui-editor-contents code {
|
||||
font-family: Consolas, Courier, "Apple SD 산돌고딕 Neo", -apple-system, "Lucida Grande", "Apple SD Gothic Neo", "맑은 고딕", "Malgun Gothic", "Segoe UI", "돋움", dotum, sans-serif;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents pre {
|
||||
margin: 2px 0 8px;
|
||||
padding: 18px;
|
||||
background-color: #f5f7f8;
|
||||
}
|
||||
|
||||
.tui-editor-contents code {
|
||||
color: #c1788b;
|
||||
padding: 4px 4px 2px 0;
|
||||
letter-spacing: -0.3px;
|
||||
}
|
||||
|
||||
.tui-editor-contents pre code {
|
||||
padding: 0;
|
||||
color: inherit;
|
||||
white-space: pre-wrap;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.tui-editor-contents pre.addon {
|
||||
border: 1px solid #e8ebed;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.tui-editor-contents img {
|
||||
margin: 4px 0 10px;
|
||||
box-sizing: border-box;
|
||||
vertical-align: top;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.tui-editor-contents table {
|
||||
margin: 2px 0 14px;
|
||||
color: #555;
|
||||
width: auto;
|
||||
border-collapse: collapse;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.tui-editor-contents table th,
|
||||
.tui-editor-contents table td {
|
||||
height: 32px;
|
||||
padding: 5px 14px 5px 12px;
|
||||
}
|
||||
|
||||
.tui-editor-contents table td {
|
||||
border: 1px solid #eaeaea;
|
||||
}
|
||||
|
||||
.tui-editor-contents table th {
|
||||
border: 1px solid #72777b;
|
||||
border-top: 0;
|
||||
background-color: #7b8184;
|
||||
font-weight: 300;
|
||||
color: #fff;
|
||||
padding-top: 6px;
|
||||
}
|
||||
|
||||
.tui-editor-contents ul,
|
||||
.tui-editor-contents menu,
|
||||
.tui-editor-contents ol,
|
||||
.tui-editor-contents dir {
|
||||
display: block;
|
||||
list-style-type: disc;
|
||||
padding-left: 17px;
|
||||
margin: 6px 0 10px;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.tui-editor-contents ol {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.tui-editor-contents ul ul,
|
||||
.tui-editor-contents ul ol,
|
||||
.tui-editor-contents ol ol,
|
||||
.tui-editor-contents ol ul {
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.tui-editor-contents ul li {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tui-editor-contents ul p, ol p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents ul li.task-list-item:before,
|
||||
.tui-editor-contents pre ul li:before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.tui-editor-contents hr {
|
||||
border-top: 1px solid #eee;
|
||||
margin: 16px 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents a {
|
||||
text-decoration: underline;
|
||||
color: #5286bc;
|
||||
}
|
||||
|
||||
.tui-editor-contents a:hover {
|
||||
color: #007cff;
|
||||
}
|
||||
|
||||
.tui-editor-contents {
|
||||
font-size: 13px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tui-editor-contents .task-list-item {
|
||||
border: 0;
|
||||
list-style: none;
|
||||
padding-left: 22px;
|
||||
margin-left: -22px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 16px 16px;
|
||||
background-position: 0 2px;
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAADdJREFUKBVjvHv37n8GMgALSI+SkhJJWu/du8fARJIOJMWjGpECA505GjjoIYLEB6dVUNojFQAA/1MJUFWet/4AAAAASUVORK5CYII=');
|
||||
}
|
||||
|
||||
.tui-editor-contents .task-list-item.checked {
|
||||
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAMpJREFUKBVjjJ/64D8DGYCJDD1gLbTVyM3OxJDiJMzAxcYIdyALnIWDAdJU7i/OICfCxsDMxMgwc88bwk5F1vTs/W+GFUffwY2H+1FBlI2hLliCQYCbGSyJrqlzwwuGj9//YWoMtRBgUBJnZ6gMEGeQFWaFOw9kE7omkG5GWDyCPF7mJ86gIMbO8P//fwZGRkYGXJpAGuFO/fbrP0PXppcMD179JKgJRSOIA9N8/NZXrM4DqYEBjOgAaYYFOUwRNhruVGyS+MTI1ggAx8NTGcUtFVQAAAAASUVORK5CYII=');
|
||||
}
|
||||
|
||||
.tui-editor-contents .task-list-item input[type='checkbox'],
|
||||
.tui-editor-contents .task-list-item .task-list-item-checkbox {
|
||||
margin-left: -17px;
|
||||
margin-right: 3.8px;
|
||||
margin-top: 3px;
|
||||
}
|
128022
common/tui-editor/dist/tui-editor-extChart.js
vendored
128022
common/tui-editor/dist/tui-editor-extChart.js
vendored
File diff suppressed because one or more lines are too long
82808
common/tui-editor/dist/tui-editor-extColorSyntax.js
vendored
82808
common/tui-editor/dist/tui-editor-extColorSyntax.js
vendored
File diff suppressed because one or more lines are too long
80329
common/tui-editor/dist/tui-editor-extScrollSync.js
vendored
80329
common/tui-editor/dist/tui-editor-extScrollSync.js
vendored
File diff suppressed because one or more lines are too long
82998
common/tui-editor/dist/tui-editor-extTable.js
vendored
82998
common/tui-editor/dist/tui-editor-extTable.js
vendored
File diff suppressed because one or more lines are too long
83347
common/tui-editor/dist/tui-editor-extUML.js
vendored
83347
common/tui-editor/dist/tui-editor-extUML.js
vendored
File diff suppressed because one or more lines are too long
1280
common/tui-editor/dist/tui-editor.css
vendored
1280
common/tui-editor/dist/tui-editor.css
vendored
File diff suppressed because it is too large
Load Diff
@ -98,7 +98,7 @@ class wikiController extends baseController {
|
||||
current: params.desc,
|
||||
old: result ? result.toObject().desc : ''
|
||||
};
|
||||
let wikiUrl = `http://${ctx.request.host}/project/${params.project_id}/wiki`;
|
||||
let wikiUrl = `${ctx.request.origin}/project/${params.project_id}/wiki`;
|
||||
|
||||
if (notice) {
|
||||
let diffView = showDiffMsg(jsondiffpatch, formattersHtml, logData);
|
||||
|
@ -2,8 +2,8 @@ import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Button, Checkbox } from 'antd';
|
||||
import Editor from 'common/tui-editor/dist/tui-editor-Editor-all.min.js';
|
||||
require('common/tui-editor/dist/tui-editor.css'); // editor ui
|
||||
require('common/tui-editor/dist/tui-editor-contents.css'); // editor content
|
||||
require('common/tui-editor/dist/tui-editor.min.css'); // editor ui
|
||||
require('common/tui-editor/dist/tui-editor-contents.min.css'); // editor content
|
||||
class WikiEditor extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
10745
package-lock.json
generated
10745
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -114,6 +114,7 @@
|
||||
"less": "^2.7.2",
|
||||
"less-loader": "^4.0.5",
|
||||
"markdown-it-include": "^1.0.0",
|
||||
"moment": "2.19.3",
|
||||
"node-sass": "^4.9.0",
|
||||
"nodemon": "^1.11.0",
|
||||
"prop-types": "^15.5.10",
|
||||
|
@ -675,6 +675,10 @@ class interfaceController extends baseController {
|
||||
};
|
||||
|
||||
this.catModel.get(interfaceData.catid).then(cate => {
|
||||
let diffView2 = showDiffMsg(jsondiffpatch, formattersHtml, logData);
|
||||
if (diffView2.length <= 0) {
|
||||
return; // 没有变化时,不写日志
|
||||
}
|
||||
yapi.commons.saveLog({
|
||||
content: `<a href="/user/profile/${this.getUid()}">${username}</a>
|
||||
更新了分类 <a href="/project/${cate.project_id}/interface/api/cat_${
|
||||
@ -707,10 +711,11 @@ class interfaceController extends baseController {
|
||||
);
|
||||
|
||||
let project = await this.projectModel.getBaseInfo(interfaceData.project_id);
|
||||
|
||||
let interfaceUrl = `http://${ctx.request.host}/project/${
|
||||
|
||||
let interfaceUrl = `${ctx.request.origin}/project/${
|
||||
interfaceData.project_id
|
||||
}/interface/api/${id}`;
|
||||
|
||||
yapi.commons.sendNotice(interfaceData.project_id, {
|
||||
title: `${username} 更新了接口`,
|
||||
content: `<html>
|
||||
|
@ -233,8 +233,8 @@ class openController extends baseController {
|
||||
};
|
||||
|
||||
if (ctx.params.email === true && reportsResult.message.failedNum !== 0) {
|
||||
let autoTestUrl = `http://${
|
||||
ctx.request.host
|
||||
let autoTestUrl = `${
|
||||
ctx.request.origin
|
||||
}/api/open/run_auto_test?id=${id}&token=${token}&mode=${ctx.params.mode}`;
|
||||
yapi.commons.sendNotice(projectId, {
|
||||
title: `YApi自动化测试报告`,
|
||||
|
@ -180,19 +180,19 @@ module.exports = async (ctx, next) => {
|
||||
try {
|
||||
newpath = path.substr(project.basepath.length);
|
||||
interfaceData = await interfaceInst.getByPath(project._id, newpath, ctx.method);
|
||||
|
||||
let queryPathInterfaceData = await interfaceInst.getByQueryPath(project._id, newpath, ctx.method);
|
||||
//处理query_path情况 url 中有 ?params=xxx
|
||||
if (!interfaceData || interfaceData.length === 0) {
|
||||
interfaceData = await interfaceInst.getByQueryPath(project._id, newpath, ctx.method);
|
||||
if (!interfaceData || interfaceData.length != queryPathInterfaceData.length) {
|
||||
|
||||
let i,
|
||||
l,
|
||||
j,
|
||||
len,
|
||||
curQuery,
|
||||
match = false;
|
||||
for (i = 0, l = interfaceData.length; i < l; i++) {
|
||||
for (i = 0, l = queryPathInterfaceData.length; i < l; i++) {
|
||||
match = false;
|
||||
let currentInterfaceData = interfaceData[i];
|
||||
let currentInterfaceData = queryPathInterfaceData[i];
|
||||
curQuery = currentInterfaceData.query_path;
|
||||
if (!curQuery || typeof curQuery !== 'object' || !curQuery.path) {
|
||||
continue;
|
||||
@ -210,9 +210,10 @@ module.exports = async (ctx, next) => {
|
||||
interfaceData = [currentInterfaceData];
|
||||
break;
|
||||
}
|
||||
if (i === l - 1) {
|
||||
interfaceData = [];
|
||||
}
|
||||
// if (i === l - 1) {
|
||||
// interfaceData = [];
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -657,7 +657,7 @@ exports.createWebAPIRequest = function(ops) {
|
||||
}
|
||||
);
|
||||
http_client.on('error', (e) => {
|
||||
reject({message: 'request error'});
|
||||
reject({message: `request error: ${e.message}`});
|
||||
});
|
||||
http_client.end();
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ function connect(callback) {
|
||||
mongoose.Promise = global.Promise;
|
||||
|
||||
let config = yapi.WEBCONFIG;
|
||||
let options = {useNewUrlParser: true };
|
||||
let options = {useNewUrlParser: true, useCreateIndex: true};
|
||||
|
||||
if (config.db.user) {
|
||||
options.user = config.db.user;
|
||||
|
@ -1 +1 @@
|
||||
window.WEBPACK_ASSETS = {"index.js":{"js":"index@0b1c5b1beb508ca8e9e2.js","css":"index@0b1c5b1beb508ca8e9e2.css"},"lib":{"js":"lib@a32214bd560d0e99b7de.js"},"lib2":{"js":"lib2@8fc8401eeec08b4915e2.js"},"lib3":{"js":"lib3@4dcb9678a6fbd32b87cd.js"},"manifest":{"js":"manifest@f2f4bd774d6c221b3d5f.js"}}
|
||||
window.WEBPACK_ASSETS = {"index.js":{"js":"index@ce28a28a5a8226f892ae.js","css":"index@ce28a28a5a8226f892ae.css"},"lib":{"js":"lib@0e0852606824ecb78d3c.js"},"lib2":{"js":"lib2@0267ce6bdb4dde0cc009.js"},"lib3":{"js":"lib3@a759258f7e6a95f1ee92.js"},"manifest":{"js":"manifest@f2f4bd774d6c221b3d5f.js"}}
|
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
static/prd/index@ce28a28a5a8226f892ae.css.gz
Normal file
BIN
static/prd/index@ce28a28a5a8226f892ae.css.gz
Normal file
Binary file not shown.
1
static/prd/index@ce28a28a5a8226f892ae.js
Normal file
1
static/prd/index@ce28a28a5a8226f892ae.js
Normal file
File diff suppressed because one or more lines are too long
BIN
static/prd/index@ce28a28a5a8226f892ae.js.gz
Normal file
BIN
static/prd/index@ce28a28a5a8226f892ae.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
static/prd/lib2@0267ce6bdb4dde0cc009.js.gz
Normal file
BIN
static/prd/lib2@0267ce6bdb4dde0cc009.js.gz
Normal file
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
1
static/prd/lib3@a759258f7e6a95f1ee92.js
Normal file
1
static/prd/lib3@a759258f7e6a95f1ee92.js
Normal file
File diff suppressed because one or more lines are too long
BIN
static/prd/lib3@a759258f7e6a95f1ee92.js.gz
Normal file
BIN
static/prd/lib3@a759258f7e6a95f1ee92.js.gz
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
BIN
static/prd/lib@0e0852606824ecb78d3c.js.gz
Normal file
BIN
static/prd/lib@0e0852606824ecb78d3c.js.gz
Normal file
Binary file not shown.
Binary file not shown.
@ -102,15 +102,10 @@ module.exports = {
|
||||
'react-dnd',
|
||||
'reactabular-table',
|
||||
'reactabular-dnd',
|
||||
'table-resolver',
|
||||
|
||||
'table-resolver'
|
||||
],
|
||||
lib2: ['brace', 'json5', 'url', 'axios'],
|
||||
lib3: [
|
||||
'mockjs',
|
||||
'moment',
|
||||
'recharts'
|
||||
]
|
||||
lib3: ['mockjs', 'moment', 'recharts']
|
||||
}
|
||||
},
|
||||
modifyWebpackConfig: function(baseConfig) {
|
||||
@ -170,8 +165,8 @@ module.exports = {
|
||||
limit: 8192,
|
||||
name: ['[path][name].[ext]?[sha256#base64:8]']
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
baseConfig.module.loaders.push({
|
||||
test: /\.(sass|scss)$/,
|
||||
loader: ykit.ExtractTextPlugin.extract(
|
||||
@ -203,12 +198,9 @@ module.exports = {
|
||||
);
|
||||
baseConfig.plugins.push(assetsPluginInstance);
|
||||
baseConfig.plugins.push(compressPlugin);
|
||||
baseConfig.plugins.push (
|
||||
new this.webpack.ContextReplacementPlugin (
|
||||
/moment[\\\/]locale$/,
|
||||
/^\.\/(zh-cn|en-gb)$/
|
||||
)
|
||||
)
|
||||
baseConfig.plugins.push(
|
||||
new this.webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(zh-cn|en-gb)$/)
|
||||
);
|
||||
}
|
||||
return baseConfig;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user