Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ module.exports = {
"react",
"import"
],
settings: {
react: {
version: "16.2"
}
},
rules: {
"indent": ["off", 2],
"react/display-name": ["off"],
"react/jsx-indent": ["error", 2],
"react/no-deprecated": ["off"],
"comma-dangle": ["error", "never"],
"no-console": ["off"],
"import/no-unresolved": ["off"],
Expand All @@ -29,4 +35,3 @@ module.exports = {
// "react/no-unescaped-entities": 0
}
};

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ target/
*.diff
*.patch
*.tmp
.tmp_*.png

# system ignore
.DS_Store
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ YApi 是<strong>高效</strong>、<strong>易用</strong>、<strong>功能强大
* 类似 postman 的接口调试
* 自动化测试, 支持对 Response 断言
* MockServer 除支持普通的随机 mock 外,还增加了 Mock 期望功能,根据设置的请求过滤规则,返回期望数据
* 支持 postman, har, swagger 数据导入
* 支持 postman, har, OpenAPI/Swagger 数据导入
* 免费开源,内网部署,信息再也不怕泄露了

### 内网部署
Expand Down Expand Up @@ -127,4 +127,3 @@ YApi 是<strong>高效</strong>、<strong>易用</strong>、<strong>功能强大

### License
Apache License 2.0

4 changes: 2 additions & 2 deletions client/components/Breadcrumb/Breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';

.breadcrumb-container {
.ant-breadcrumb {
Expand All @@ -12,7 +12,7 @@
.ant-breadcrumb a {
color: #fff;
&:hover {
color: $color-blue
color: mixin.$color-blue
}
}
.ant-breadcrumb > span:last-child {
Expand Down
8 changes: 4 additions & 4 deletions client/components/Footer/Footer.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@import '../../styles/common.scss';
@import '../../styles/mixin.scss';
@use '../../styles/common.scss';
@use '../../styles/mixin.scss';

.footer-wrapper{
height: 2.4rem;
width: 100%;
background-color: $color-bg-dark;
background-color: mixin.$color-bg-dark;
overflow: hidden;
position: relative;
z-index: 0;
Expand All @@ -30,7 +30,7 @@
line-height: .3rem;
transition: color .2s;
&:hover {
color: $color-bg-gray;
color: mixin.$color-bg-gray;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions client/components/Header/Header.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';

.nav-tooltip {
color: red;
Expand Down Expand Up @@ -35,7 +35,7 @@
display: block;
}
.logo-name {
color: $color-white;
color: mixin.$color-white;
font-size: .24rem;
font-weight: 300;
margin-left: .38rem;
Expand Down
4 changes: 3 additions & 1 deletion client/components/Loading/Loading.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:math";

$ball-color:#30a1f2;
$ball-size:.15rem;
$ball-margin:.02rem;
Expand All @@ -20,7 +22,7 @@ $loader-radius:.25rem;
@mixin ball-spin-fade-loader($n:8,$start:1){
@for $i from $start through $n {
> div:nth-child(#{$i}) {
$quarter: ($loader-radius/2) + ($loader-radius/5.5);
$quarter: ($loader-radius*0.5) + math.div($loader-radius, 5.5);

@if $i == 1 {
top: $loader-radius;
Expand Down
2 changes: 1 addition & 1 deletion client/components/Postman/Postman.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const {
handleContentType,
crossRequest,
checkNameIsExistInArray
} = require('common/postmanLib.js');
} = require('common/postmanLib.browser.js');

const plugin = require('client/plugin.js');

Expand Down
6 changes: 3 additions & 3 deletions client/components/Postman/Postman.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';
.postman {


Expand Down Expand Up @@ -95,10 +95,10 @@
border-radius: 2px;
}
.res-code.success {
background-color: $color-antd-green;
background-color: mixin.$color-antd-green;
}
.res-code.fail {
background-color: $color-antd-red;
background-color: mixin.$color-antd-red;
}

// 容器:左侧是header 右侧是body
Expand Down
4 changes: 2 additions & 2 deletions client/components/ProjectCard/ProjectCard.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';
.card-container {
position: relative;
user-select: none;
Expand All @@ -12,7 +12,7 @@
transform: translateY(-4px);
}
.m-card .ant-card-body {
background-color: $color-bg-gray;
background-color: mixin.$color-bg-gray;
box-shadow: 0 4px 8px rgba(50, 50, 93, 0.11), 0 4px 6px rgba(0, 0, 0, 0.08);
}
.card-btns .icon {
Expand Down
4 changes: 3 additions & 1 deletion client/components/SchemaTable/SchemaTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const messageMap = {
itemType: 'item 类型',
format: 'format',
itemFormat: 'format',
mock: 'mock'
mock: 'mock',
nullable: '可为空',
const: '常量值'
};

const columns = [
Expand Down
2 changes: 1 addition & 1 deletion client/components/Subnav/Subnav.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/common.scss';
@use '../../styles/common.scss';

.m-subnav {
margin-bottom: .24rem;
Expand Down
2 changes: 1 addition & 1 deletion client/containers/AddProject/Addproject.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/common.scss';
@use '../../styles/common.scss';

.m-container {
margin: .24rem auto !important;
Expand Down
4 changes: 2 additions & 2 deletions client/containers/Follows/Follows.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../../styles/common.scss';
@import '../../styles/mixin.scss';
@use '../../styles/common.scss';
@use '../../styles/mixin.scss';


.follow-box{
Expand Down
4 changes: 2 additions & 2 deletions client/containers/Group/Group.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';

.g-doc {
@include row-width-limit;
@include mixin.row-width-limit;
margin: 0 auto .24rem;
}
.news-box .news-timeline .ant-timeline-item .ant-timeline-item-content{
Expand Down
26 changes: 13 additions & 13 deletions client/containers/Group/GroupList/GroupList.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@import '../../../styles/mixin.scss';
@use '../../../styles/mixin.scss';

.group-bar {
min-height: 5rem;
.curr-group {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
SimSun, sans-serif;
background-color: $color-bg-dark;
color: $color-white;
background-color: mixin.$color-bg-dark;
color: mixin.$color-white;
padding: .24rem .24rem 0;
.curr-group-name {
color: $color-white;
color: mixin.$color-white;
font-size: .22rem;
display: flex;
justify-content: space-between;
Expand Down Expand Up @@ -59,7 +59,7 @@
}
}
.curr-group-desc {
color: $color-white-secondary;
color: mixin.$color-white-secondary;
font-size: 13px;
max-height: 54px;
margin-top: .16rem;
Expand All @@ -73,33 +73,33 @@
font-size: 14px;
margin-left: .08rem;
cursor: pointer;
border: 1px solid $color-white;
border: 1px solid mixin.$color-white;
padding: 6px 12px;
border-radius: 4px;
transition: all .2s;
}
.delete-group:hover, .edit-group:hover {
background-color: $color-blue;
border: 1px solid $color-blue;
background-color: mixin.$color-blue;
border: 1px solid mixin.$color-blue;
}
}
.group-operate {
padding: 16px 24px;
display: flex;
justify-content: space-around;
background-color: $color-bg-dark;
background-color: mixin.$color-bg-dark;
.search {
flex-grow: 1;
}
.ant-input {
color: $color-white;
background-color: $color-bg-dark;
color: mixin.$color-white;
background-color: mixin.$color-bg-dark;
}
.ant-input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: $color-white-secondary;
color: mixin.$color-white-secondary;
}
.ant-input-suffix {
color: $color-white;
color: mixin.$color-white;
}
}
.group-list {
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Group/MemberList/MemberList.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/mixin.scss';
@use '../../../styles/mixin.scss';

.m-panel{
background-color: #fff;
Expand Down
20 changes: 10 additions & 10 deletions client/containers/Home/Home.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';

$color-white : #fff;
mixin.$color-white : #fff;
$color-blue-lighter : #f1f5ff;
$color-blue-grey-lighter : #f7fafc;
$color-grey-lighter : #F7F7F7;
$color-blue-light: #5dade2;
$color-black-lighter: #404040;
$color-text-dark: #2e2e5a;
mixin.$color-text-dark: #2e2e5a;
$color-text-light: #6d7c90;
$color-bg-lightblue: #c6e2ff;
.g-body {
Expand Down Expand Up @@ -152,7 +152,7 @@ $color-bg-lightblue: #c6e2ff;
}
}
.login-form{
color: $color-white;
color: mixin.$color-white;
}
.main-one-left{
padding-right: .15rem;
Expand Down Expand Up @@ -196,12 +196,12 @@ $color-bg-lightblue: #c6e2ff;
background-color: $color-blue-lighter;
}
&:nth-child(even){
background-color: $color-white;
background-color: mixin.$color-white;
}
}
.feat-part{
padding: 1.5rem 0;
background-color: $color-white;
background-color: mixin.$color-white;
}
.section-feature {
min-height: 6rem;
Expand All @@ -223,7 +223,7 @@ $color-bg-lightblue: #c6e2ff;
width: 1.2rem;
border-radius: 100%;
margin-bottom: .2rem;
color: $color-white;
color: mixin.$color-white;
i {
line-height: 1.2rem;
font-size: .6rem;
Expand Down Expand Up @@ -310,7 +310,7 @@ $color-bg-lightblue: #c6e2ff;
text-align: center;
-webkit-font-smoothing: antialiased;
.title {
color: $color-text-dark;
color: mixin.$color-text-dark;
line-height: .32rem;
margin-bottom: .08rem;
font-size: .24rem;
Expand All @@ -334,7 +334,7 @@ $color-bg-lightblue: #c6e2ff;
margin-bottom: .24rem;
}
.title {
color: $color-text-dark;
color: mixin.$color-text-dark;
font-size: .2rem;
}
.desc {
Expand Down Expand Up @@ -364,7 +364,7 @@ $color-bg-lightblue: #c6e2ff;
}
.ant-card-head-title {
font-size: .17rem;
color: $color-text-dark;
color: mixin.$color-text-dark;
}
.ant-card-body {
text-align: left;
Expand Down
2 changes: 1 addition & 1 deletion client/containers/Login/Login.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../styles/common.scss';
@use '../../styles/common.scss';

// .login-body {
// background-color: #fff;
Expand Down
4 changes: 2 additions & 2 deletions client/containers/News/News.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import '../../styles/mixin.scss';
@use '../../styles/mixin.scss';

.news-box {
@include row-width-limit;
@include mixin.row-width-limit;

display: -webkit-box;
-webkit-box-flex: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const {
crossRequest,
handleCurrDomain,
checkNameIsExistInArray
} = require('common/postmanLib.js');
} = require('common/postmanLib.browser.js');
const { handleParamsValue, json_parse, ArrayToObject } = require('common/utils.js');
import CaseEnv from 'client/components/CaseEnv';
import Label from '../../../../components/Label/Label.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../../styles/mixin.scss';
@use '../../../../styles/mixin.scss';

.interface-edit{
padding: 24px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import AceEditor from 'client/components/AceEditor/AceEditor';
import axios from 'axios';
import { MOCK_SOURCE } from '../../../../constants/variable.js';
import Editor from 'common/tui-editor/dist/tui-editor-Editor-all.min.js';
const jSchema = require('json-schema-editor-visual');
const jSchema = require('json-schema-editor-visual/dist/main.js');
const ResBodySchema = jSchema({ lang: 'zh_CN', mock: MOCK_SOURCE });
const ReqBodySchema = jSchema({ lang: 'zh_CN', mock: MOCK_SOURCE });
const TabPane = Tabs.TabPane;
Expand Down
Loading