Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Sunny_yiyi
Swagger Ui
提交
fc3ed30f
S
Swagger Ui
项目概览
Sunny_yiyi
/
Swagger Ui
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Swagger Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
fc3ed30f
编写于
6月 11, 2020
作者:
T
tomdegoede
提交者:
GitHub
6月 10, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improvement: Move inline styles to SCSS instead (#5578)
* fix: convert propStyle to propClass
上级
67627d75
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
282 addition
and
70 deletion
+282
-70
src/core/components/array-model.jsx
src/core/components/array-model.jsx
+2
-2
src/core/components/auth/error.jsx
src/core/components/auth/error.jsx
+2
-2
src/core/components/curl.jsx
src/core/components/curl.jsx
+1
-1
src/core/components/errors.jsx
src/core/components/errors.jsx
+4
-4
src/core/components/headers.jsx
src/core/components/headers.jsx
+2
-2
src/core/components/layout-utils.jsx
src/core/components/layout-utils.jsx
+6
-2
src/core/components/layouts/base.jsx
src/core/components/layouts/base.jsx
+1
-1
src/core/components/model-collapse.jsx
src/core/components/model-collapse.jsx
+2
-2
src/core/components/model.jsx
src/core/components/model.jsx
+1
-5
src/core/components/object-model.jsx
src/core/components/object-model.jsx
+17
-11
src/core/components/online-validator-badge.jsx
src/core/components/online-validator-badge.jsx
+1
-1
src/core/components/overview.jsx
src/core/components/overview.jsx
+1
-1
src/core/components/parameter-row.jsx
src/core/components/parameter-row.jsx
+1
-1
src/core/components/primitive-model.jsx
src/core/components/primitive-model.jsx
+5
-5
src/core/components/property.jsx
src/core/components/property.jsx
+3
-3
src/core/components/response-body.jsx
src/core/components/response-body.jsx
+1
-1
src/core/components/svg-assets.jsx
src/core/components/svg-assets.jsx
+1
-5
src/core/containers/filter.jsx
src/core/containers/filter.jsx
+5
-5
src/core/plugins/oas3/components/operation-link.jsx
src/core/plugins/oas3/components/operation-link.jsx
+2
-2
src/core/plugins/oas3/components/request-body.jsx
src/core/plugins/oas3/components/request-body.jsx
+1
-1
src/core/plugins/oas3/wrap-components/version-stamp.jsx
src/core/plugins/oas3/wrap-components/version-stamp.jsx
+1
-1
src/core/plugins/view/root-injects.jsx
src/core/plugins/view/root-injects.jsx
+3
-4
src/core/utils.js
src/core/utils.js
+3
-3
src/plugins/topbar/topbar.jsx
src/plugins/topbar/topbar.jsx
+5
-5
src/style/_authorize.scss
src/style/_authorize.scss
+12
-0
src/style/_errors.scss
src/style/_errors.scss
+16
-0
src/style/_information.scss
src/style/_information.scss
+13
-0
src/style/_layout.scss
src/style/_layout.scss
+87
-0
src/style/_models.scss
src/style/_models.scss
+72
-0
src/style/_table.scss
src/style/_table.scss
+11
-0
未找到文件。
src/core/components/array-model.jsx
浏览文件 @
fc3ed30f
...
...
@@ -2,7 +2,7 @@ import React, { Component } from "react"
import
PropTypes
from
"
prop-types
"
import
ImPropTypes
from
"
react-immutable-proptypes
"
const
prop
Style
=
{
color
:
"
#999
"
,
fontStyle
:
"
italic
"
}
const
prop
Class
=
"
property
"
export
default
class
ArrayModel
extends
Component
{
static
propTypes
=
{
...
...
@@ -44,7 +44,7 @@ export default class ArrayModel extends Component {
<
ModelCollapse
title
=
{
titleEl
}
expanded
=
{
depth
<=
expandDepth
}
collapsedContent
=
"[...]"
>
[
{
properties
.
size
?
properties
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Style
=
{
propStyle
}
/>)
:
null
properties
.
size
?
properties
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Class
=
{
propClass
}
/>)
:
null
}
{
!
description
?
(
properties
.
size
?
<
div
className
=
"markdown"
></
div
>
:
null
)
:
...
...
src/core/components/auth/error.jsx
浏览文件 @
fc3ed30f
...
...
@@ -15,8 +15,8 @@ export default class AuthError extends React.Component {
let
source
=
error
.
get
(
"
source
"
)
return
(
<
div
className
=
"errors"
style
=
{
{
backgroundColor
:
"
#ffeeee
"
,
color
:
"
red
"
,
margin
:
"
1em
"
}
}
>
<
b
style
=
{
{
textTransform
:
"
capitalize
"
,
marginRight
:
"
1em
"
}
}
>
{
source
}
{
level
}
</
b
>
<
div
className
=
"errors"
>
<
b
>
{
source
}
{
level
}
</
b
>
<
span
>
{
message
}
</
span
>
</
div
>
)
...
...
src/core/components/curl.jsx
浏览文件 @
fc3ed30f
...
...
@@ -20,7 +20,7 @@ export default class Curl extends React.Component {
<
div
>
<
h4
>
Curl
</
h4
>
<
div
className
=
"copy-paste"
>
<
textarea
onFocus
=
{
this
.
handleFocus
}
readOnly
=
{
true
}
className
=
"curl"
style
=
{
{
whiteSpace
:
"
normal
"
}
}
value
=
{
curl
}
></
textarea
>
<
textarea
onFocus
=
{
this
.
handleFocus
}
readOnly
=
{
true
}
className
=
"curl"
value
=
{
curl
}
></
textarea
>
</
div
>
</
div
>
)
...
...
src/core/components/errors.jsx
浏览文件 @
fc3ed30f
...
...
@@ -72,10 +72,10 @@ const ThrownErrorItem = ( { error, jumpToLine } ) => {
<
h4
>
{
(
error
.
get
(
"
source
"
)
&&
error
.
get
(
"
level
"
))
?
toTitleCase
(
error
.
get
(
"
source
"
))
+
"
"
+
error
.
get
(
"
level
"
)
:
""
}
{
error
.
get
(
"
path
"
)
?
<
small
>
at
{
error
.
get
(
"
path
"
)
}
</
small
>:
null
}
</
h4
>
<
span
style
=
{
{
whiteSpace
:
"
pre-line
"
,
"
maxWidth
"
:
"
100%
"
}
}
>
<
span
className
=
"message thrown"
>
{
error
.
get
(
"
message
"
)
}
</
span
>
<
div
style
=
{
{
"
text-decoration
"
:
"
underline
"
,
"
cursor
"
:
"
pointer
"
}
}
>
<
div
className
=
"error-line"
>
{
errorLine
&&
jumpToLine
?
<
a
onClick
=
{
jumpToLine
.
bind
(
null
,
errorLine
)
}
>
Jump to line
{
errorLine
}
</
a
>
:
null
}
</
div
>
</
div
>
...
...
@@ -102,8 +102,8 @@ const SpecErrorItem = ( { error, jumpToLine } ) => {
{
!
error
?
null
:
<
div
>
<
h4
>
{
toTitleCase
(
error
.
get
(
"
source
"
))
+
"
"
+
error
.
get
(
"
level
"
)
}
{
locationMessage
}
</
h4
>
<
span
style
=
{
{
whiteSpace
:
"
pre-line
"
}
}
>
{
error
.
get
(
"
message
"
)
}
</
span
>
<
div
style
=
{
{
"
text-decoration
"
:
"
underline
"
,
"
cursor
"
:
"
pointer
"
}
}
>
<
span
className
=
"message"
>
{
error
.
get
(
"
message
"
)
}
</
span
>
<
div
className
=
"error-line"
>
{
jumpToLine
?
(
<
a
onClick
=
{
jumpToLine
.
bind
(
null
,
error
.
get
(
"
line
"
))
}
>
Jump to line
{
error
.
get
(
"
line
"
)
}
</
a
>
)
:
null
}
...
...
src/core/components/headers.jsx
浏览文件 @
fc3ed30f
...
...
@@ -2,7 +2,7 @@ import React from "react"
import
PropTypes
from
"
prop-types
"
import
Im
from
"
immutable
"
const
prop
Style
=
{
color
:
"
#999
"
,
fontStyle
:
"
italic
"
}
const
prop
Class
=
"
header-example
"
export
default
class
Headers
extends
React
.
Component
{
static
propTypes
=
{
...
...
@@ -46,7 +46,7 @@ export default class Headers extends React.Component {
<
td
className
=
"header-col"
>
{
!
description
?
null
:
<
Markdown
source
=
{
description
}
/>
}
</
td
>
<
td
className
=
"header-col"
>
{
type
}
{
schemaExample
?
<
Property
propKey
=
{
"
Example
"
}
propVal
=
{
schemaExample
}
prop
Style
=
{
propStyle
}
/>
:
null
}
</
td
>
<
td
className
=
"header-col"
>
{
type
}
{
schemaExample
?
<
Property
propKey
=
{
"
Example
"
}
propVal
=
{
schemaExample
}
prop
Class
=
{
propClass
}
/>
:
null
}
</
td
>
</
tr
>)
}).
toArray
()
}
...
...
src/core/components/layout-utils.jsx
浏览文件 @
fc3ed30f
...
...
@@ -73,10 +73,14 @@ export class Col extends React.Component {
}
}
if
(
hide
)
{
classesAr
.
push
(
"
hidden
"
)
}
let
classes
=
xclass
(
rest
.
className
,
...
classesAr
)
return
(
<
section
{
...
rest
}
style
=
{
{
display
:
hide
?
"
none
"
:
null
}
}
className
=
{
classes
}
/>
<
section
{
...
rest
}
className
=
{
classes
}
/>
)
}
...
...
@@ -213,7 +217,7 @@ Link.propTypes = {
className
:
PropTypes
.
string
}
const
NoMargin
=
({
children
})
=>
<
div
style
=
{
{
height
:
"
auto
"
,
border
:
"
none
"
,
margin
:
0
,
padding
:
0
}
}
>
{
children
}
</
div
>
const
NoMargin
=
({
children
})
=>
<
div
className
=
"no-margin"
>
{
children
}
</
div
>
NoMargin
.
propTypes
=
{
children
:
PropTypes
.
node
...
...
src/core/components/layouts/base.jsx
浏览文件 @
fc3ed30f
...
...
@@ -57,7 +57,7 @@ export default class BaseLayout extends React.Component {
if
(
loadingStatus
===
"
failedConfig
"
)
{
const
lastErr
=
errSelectors
.
lastError
()
const
lastErrMsg
=
lastErr
?
lastErr
.
get
(
"
message
"
)
:
""
loadingMessage
=
<
div
className
=
"info
"
style
=
{
{
maxWidth
:
"
880px
"
,
marginLeft
:
"
auto
"
,
marginRight
:
"
auto
"
,
textAlign
:
"
center
"
}
}
>
loadingMessage
=
<
div
className
=
"info
failed-config"
>
<
div
className
=
"loading-container"
>
<
h4
className
=
"title"
>
Failed to load remote configuration.
</
h4
>
<
p
>
{
lastErrMsg
}
</
p
>
...
...
src/core/components/model-collapse.jsx
浏览文件 @
fc3ed30f
...
...
@@ -71,8 +71,8 @@ export default class ModelCollapse extends Component {
return
(
<
span
className
=
{
classes
||
""
}
>
{
title
&&
<
span
onClick
=
{
this
.
toggleCollapsed
}
style
=
{
{
"
cursor
"
:
"
pointer
"
}
}
>
{
title
}
</
span
>
}
<
span
onClick
=
{
this
.
toggleCollapsed
}
style
=
{
{
"
cursor
"
:
"
pointer
"
}
}
>
{
title
&&
<
span
onClick
=
{
this
.
toggleCollapsed
}
className
=
"pointer"
>
{
title
}
</
span
>
}
<
span
onClick
=
{
this
.
toggleCollapsed
}
className
=
"pointer"
>
<
span
className
=
{
"
model-toggle
"
+
(
this
.
state
.
expanded
?
""
:
"
collapsed
"
)
}
></
span
>
</
span
>
{
this
.
state
.
expanded
?
this
.
props
.
children
:
this
.
state
.
collapsedContent
}
...
...
src/core/components/model.jsx
浏览文件 @
fc3ed30f
...
...
@@ -53,11 +53,7 @@ export default class Model extends ImmutablePureComponent {
if
(
!
schema
)
{
return
<
span
className
=
"model model-title"
>
<
span
className
=
"model-title__text"
>
{
displayName
||
name
}
</
span
>
<
img
src
=
{
require
(
"
core/../img/rolling-load.svg
"
)
}
height
=
{
"
20px
"
}
width
=
{
"
20px
"
}
style
=
{
{
marginLeft
:
"
1em
"
,
position
:
"
relative
"
,
bottom
:
"
0px
"
}
}
/>
<
img
src
=
{
require
(
"
core/../img/rolling-load.svg
"
)
}
height
=
{
"
20px
"
}
width
=
{
"
20px
"
}
/>
</
span
>
}
...
...
src/core/components/object-model.jsx
浏览文件 @
fc3ed30f
...
...
@@ -79,8 +79,8 @@ export default class ObjectModel extends Component {
{
<
table
className
=
"model"
><
tbody
>
{
!
description
?
null
:
<
tr
style
=
{
{
color
:
"
#666
"
,
fontWeight
:
"
normal
"
}
}
>
<
td
style
=
{
{
fontWeight
:
"
bold
"
}
}
>
description:
</
td
>
!
description
?
null
:
<
tr
className
=
"description"
>
<
td
>
description:
</
td
>
<
td
>
<
Markdown
source
=
{
description
}
/>
</
td
>
...
...
@@ -91,16 +91,22 @@ export default class ObjectModel extends Component {
([
key
,
value
])
=>
{
let
isDeprecated
=
isOAS3
()
&&
value
.
get
(
"
deprecated
"
)
let
isRequired
=
List
.
isList
(
requiredProperties
)
&&
requiredProperties
.
contains
(
key
)
let
propertyStyle
=
{
verticalAlign
:
"
top
"
,
paddingRight
:
"
0.2em
"
}
if
(
isRequired
)
{
propertyStyle
.
fontWeight
=
"
bold
"
let
classNames
=
[
"
property-row
"
]
if
(
isDeprecated
)
{
classNames
.
push
(
"
deprecated
"
)
}
if
(
isRequired
)
{
classNames
.
push
(
"
required
"
)
}
return
(<
tr
key
=
{
key
}
className
=
{
isDeprecated
&&
"
deprecated
"
}
>
<
td
style
=
{
propertyStyle
}
>
{
key
}{
isRequired
&&
<
span
style
=
{
{
color
:
"
red
"
}
}
>
*
</
span
>
}
return
(<
tr
key
=
{
key
}
className
=
{
classNames
.
join
(
"
"
)
}
>
<
td
>
{
key
}{
isRequired
&&
<
span
className
=
"star"
>
*
</
span
>
}
</
td
>
<
td
style
=
{
{
verticalAlign
:
"
top
"
}
}
>
<
td
>
<
Model
key
=
{
`object-
${
name
}
-
${
key
}
_
${
value
}
`
}
{
...
otherProps
}
required
=
{
isRequired
}
getComponent
=
{
getComponent
}
...
...
@@ -126,11 +132,11 @@ export default class ObjectModel extends Component {
const
normalizedValue
=
!
value
?
null
:
value
.
toJS
?
value
.
toJS
()
:
value
return
(<
tr
key
=
{
key
}
style
=
{
{
color
:
"
#777
"
}
}
>
return
(<
tr
key
=
{
key
}
className
=
"extension"
>
<
td
>
{
key
}
</
td
>
<
td
style
=
{
{
verticalAlign
:
"
top
"
}
}
>
<
td
>
{
JSON
.
stringify
(
normalizedValue
)
}
</
td
>
</
tr
>)
...
...
src/core/components/online-validator-badge.jsx
浏览文件 @
fc3ed30f
...
...
@@ -53,7 +53,7 @@ export default class OnlineValidatorBadge extends React.Component {
return
null
}
return
(<
span
style
=
{
{
float
:
"
right
"
}
}
>
return
(<
span
className
=
"float-right"
>
<
a
target
=
"_blank"
rel
=
"noopener noreferrer"
href
=
{
`
${
sanitizedValidatorUrl
}
/debug?url=
${
encodeURIComponent
(
this
.
state
.
url
)
}
`
}
>
<
ValidatorImage
src
=
{
`
${
sanitizedValidatorUrl
}
?url=
${
encodeURIComponent
(
this
.
state
.
url
)
}
`
}
alt
=
"Online validator badge"
/>
</
a
>
...
...
src/core/components/overview.jsx
浏览文件 @
fc3ed30f
...
...
@@ -97,7 +97,7 @@ export class OperationLink extends React.Component {
let
{
id
,
method
,
shown
,
href
}
=
this
.
props
return
(
<
Link
href
=
{
href
}
style
=
{
{
fontWeight
:
shown
?
"
bold
"
:
"
normal
"
}
}
onClick
=
{
this
.
onClick
}
className
=
"block opblock-link"
>
<
Link
href
=
{
href
}
onClick
=
{
this
.
onClick
}
className
=
{
`block opblock-link
${
shown
?
"
shown
"
:
""
}
`
}
>
<
div
>
<
small
className
=
{
`bold-label-
${
method
}
`
}
>
{
method
.
toUpperCase
()
}
</
small
>
<
span
className
=
"bold-label"
>
{
id
}
</
span
>
...
...
src/core/components/parameter-row.jsx
浏览文件 @
fc3ed30f
...
...
@@ -262,7 +262,7 @@ export default class ParameterRow extends Component {
<
td
className
=
"parameters-col_name"
>
<
div
className
=
{
required
?
"
parameter__name required
"
:
"
parameter__name
"
}
>
{
param
.
get
(
"
name
"
)
}
{
!
required
?
null
:
<
span
style
=
{
{
color
:
"
red
"
}
}
>
*
</
span
>
}
{
!
required
?
null
:
<
span
>
*
</
span
>
}
</
div
>
<
div
className
=
"parameter__type"
>
{
type
}
...
...
src/core/components/primitive-model.jsx
浏览文件 @
fc3ed30f
...
...
@@ -2,7 +2,7 @@ import React, { Component } from "react"
import
PropTypes
from
"
prop-types
"
import
{
getExtensions
}
from
"
core/utils
"
const
prop
Style
=
{
color
:
"
#6b6b6b
"
,
fontStyle
:
"
italic
"
}
const
prop
Class
=
"
property primitive
"
export
default
class
Primitive
extends
Component
{
static
propTypes
=
{
...
...
@@ -44,19 +44,19 @@ export default class Primitive extends Component {
<
span
className
=
"prop-type"
>
{
type
}
</
span
>
{
format
&&
<
span
className
=
"prop-format"
>
($
{
format
}
)
</
span
>
}
{
properties
.
size
?
properties
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Style
=
{
propStyle
}
/>)
:
null
properties
.
size
?
properties
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Class
=
{
propClass
}
/>)
:
null
}
{
showExtensions
&&
extensions
.
size
?
extensions
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Style
=
{
propStyle
}
/>)
:
null
showExtensions
&&
extensions
.
size
?
extensions
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
Property
key
=
{
`
${
key
}
-
${
v
}
`
}
propKey
=
{
key
}
propVal
=
{
v
}
prop
Class
=
{
propClass
}
/>)
:
null
}
{
!
description
?
null
:
<
Markdown
source
=
{
description
}
/>
}
{
xml
&&
xml
.
size
?
(<
span
><
br
/><
span
style
=
{
propStyle
}
>
xml:
</
span
>
xml
&&
xml
.
size
?
(<
span
><
br
/><
span
className
=
{
propClass
}
>
xml:
</
span
>
{
xml
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
span
key
=
{
`
${
key
}
-
${
v
}
`
}
style
=
{
propStyle
}
><
br
/>
{
key
}
:
{
String
(
v
)
}
</
span
>).
toArray
()
xml
.
entrySeq
().
map
(
(
[
key
,
v
]
)
=>
<
span
key
=
{
`
${
key
}
-
${
v
}
`
}
className
=
{
propClass
}
><
br
/>
{
key
}
:
{
String
(
v
)
}
</
span
>).
toArray
()
}
</
span
>):
null
}
...
...
src/core/components/property.jsx
浏览文件 @
fc3ed30f
import
React
from
"
react
"
import
PropTypes
from
"
prop-types
"
export
const
Property
=
({
propKey
,
propVal
,
prop
Style
})
=>
{
export
const
Property
=
({
propKey
,
propVal
,
prop
Class
})
=>
{
return
(
<
span
style
=
{
propStyle
}
>
<
span
className
=
{
propClass
}
>
<
br
/>
{
propKey
}
:
{
String
(
propVal
)
}
</
span
>
)
}
Property
.
propTypes
=
{
propKey
:
PropTypes
.
string
,
propVal
:
PropTypes
.
any
,
prop
Style
:
PropTypes
.
object
prop
Class
:
PropTypes
.
string
}
export
default
Property
src/core/components/response-body.jsx
浏览文件 @
fc3ed30f
...
...
@@ -118,7 +118,7 @@ export default class ResponseBody extends React.PureComponent {
if
(
contentType
.
includes
(
"
svg
"
))
{
bodyEl
=
<
div
>
{
content
}
</
div
>
}
else
{
bodyEl
=
<
img
style
=
{
{
maxWidth
:
"
100%
"
}
}
src
=
{
window
.
URL
.
createObjectURL
(
content
)
}
/>
bodyEl
=
<
img
className
=
"full-width"
src
=
{
window
.
URL
.
createObjectURL
(
content
)
}
/>
}
// Audio
...
...
src/core/components/svg-assets.jsx
浏览文件 @
fc3ed30f
import
React
from
"
react
"
const
SvgAssets
=
()
=>
<
div
>
<
svg
xmlns
=
"http://www.w3.org/2000/svg"
xmlnsXlink
=
"http://www.w3.org/1999/xlink"
style
=
{
{
position
:
"
absolute
"
,
width
:
0
,
height
:
0
}
}
>
<
svg
xmlns
=
"http://www.w3.org/2000/svg"
xmlnsXlink
=
"http://www.w3.org/1999/xlink"
className
=
"svg-assets"
>
<
defs
>
<
symbol
viewBox
=
"0 0 20 20"
id
=
"unlocked"
>
<
path
d
=
"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"
></
path
>
...
...
src/core/containers/filter.jsx
浏览文件 @
fc3ed30f
...
...
@@ -23,18 +23,18 @@ export default class FilterContainer extends React.Component {
const
isFailed
=
specSelectors
.
loadingStatus
()
===
"
failed
"
const
filter
=
layoutSelectors
.
currentFilter
()
const
inputStyle
=
{}
if
(
isFailed
)
inputStyle
.
color
=
"
red
"
if
(
isLoading
)
inputStyle
.
color
=
"
#aaa
"
const
classNames
=
[
"
operation-filter-input
"
]
if
(
isFailed
)
classNames
.
push
(
"
failed
"
)
if
(
isLoading
)
classNames
.
push
(
"
loading
"
)
return
(
<
div
>
{
filter
===
null
||
filter
===
false
?
null
:
<
div
className
=
"filter-container"
>
<
Col
className
=
"filter wrapper"
mobile
=
{
12
}
>
<
input
className
=
"operation-filter-input"
placeholder
=
"Filter by tag"
type
=
"text"
<
input
className
=
{
classNames
.
join
(
"
"
)
}
placeholder
=
"Filter by tag"
type
=
"text"
onChange
=
{
this
.
onFilterChange
}
value
=
{
filter
===
true
||
filter
===
"
true
"
?
""
:
filter
}
disabled
=
{
isLoading
}
style
=
{
inputStyle
}
/>
disabled
=
{
isLoading
}
/>
</
Col
>
</
div
>
}
...
...
src/core/plugins/oas3/components/operation-link.jsx
浏览文件 @
fc3ed30f
...
...
@@ -12,8 +12,8 @@ class OperationLink extends Component {
let
parameters
=
link
.
get
(
"
parameters
"
)
&&
link
.
get
(
"
parameters
"
).
toJS
()
let
description
=
link
.
get
(
"
description
"
)
return
<
div
style
=
{
{
marginBottom
:
"
1.5em
"
}
}
>
<
div
style
=
{
{
marginBottom
:
"
.5em
"
}
}
>
return
<
div
className
=
"operation-link"
>
<
div
className
=
"description"
>
<
b
><
code
>
{
name
}
</
code
></
b
>
{
description
?
<
Markdown
source
=
{
description
}
></
Markdown
>
:
null
}
</
div
>
...
...
src/core/plugins/oas3/components/request-body.jsx
浏览文件 @
fc3ed30f
...
...
@@ -145,7 +145,7 @@ const RequestBody = ({
<
td
className
=
"parameters-col_name"
>
<
div
className
=
{
required
?
"
parameter__name required
"
:
"
parameter__name
"
}
>
{
key
}
{
!
required
?
null
:
<
span
style
=
{
{
color
:
"
red
"
}
}
>
*
</
span
>
}
{
!
required
?
null
:
<
span
>
*
</
span
>
}
</
div
>
<
div
className
=
"parameter__type"
>
{
type
}
...
...
src/core/plugins/oas3/wrap-components/version-stamp.jsx
浏览文件 @
fc3ed30f
...
...
@@ -6,7 +6,7 @@ export default OAS3ComponentWrapFactory((props) => {
return
<
span
>
<
Ori
{
...
props
}
/>
<
small
style
=
{
{
backgroundColor
:
"
#89bf04
"
}
}
>
<
small
className
=
"version-stamp"
>
<
pre
className
=
"version"
>
OAS3
</
pre
>
</
small
>
</
span
>
...
...
src/core/plugins/view/root-injects.jsx
浏览文件 @
fc3ed30f
...
...
@@ -76,10 +76,9 @@ const createClass = component => class extends Component {
}
}
const
Fallback
=
({
name
})
=>
<
div
style
=
{
{
// eslint-disable-line react/prop-types
padding
:
"
1em
"
,
"
color
"
:
"
#aaa
"
}
}
>
😱
<
i
>
Could not render
{
name
===
"
t
"
?
"
this component
"
:
name
}
, see the console.
</
i
></
div
>
const
Fallback
=
({
name
// eslint-disable-line react/prop-types
})
=>
<
div
className
=
"fallback"
>
😱
<
i
>
Could not render
{
name
===
"
t
"
?
"
this component
"
:
name
}
, see the console.
</
i
></
div
>
const
wrapRender
=
(
component
)
=>
{
const
isStateless
=
component
=>
!
(
component
.
prototype
&&
component
.
prototype
.
isReactComponent
)
...
...
src/core/utils.js
浏览文件 @
fc3ed30f
...
...
@@ -307,15 +307,15 @@ export function highlight (el) {
// (some types are highlighted similarly)
el
[
appendChild
](
node
=
_document
.
createElement
(
"
span
"
)
).
setAttribute
(
"
style
"
,
[
).
setAttribute
(
"
class
"
,
[
// 0: not formatted
"
color: #555; font-weight: bold;
"
,
"
token-not-formatted
"
,
// 1: keywords
""
,
// 2: punctuation
""
,
// 3: strings and regexps
"
color: #555;
"
,
"
token-string
"
,
// 4: comments
""
][
...
...
src/plugins/topbar/topbar.jsx
浏览文件 @
fc3ed30f
...
...
@@ -104,10 +104,10 @@ export default class Topbar extends React.Component {
let
isLoading
=
specSelectors
.
loadingStatus
()
===
"
loading
"
let
isFailed
=
specSelectors
.
loadingStatus
()
===
"
failed
"
let
inputStyle
=
{}
if
(
isFailed
)
inputStyle
.
color
=
"
red
"
if
(
isLoading
)
inputStyle
.
color
=
"
#aaa
"
const
classNames
=
[
"
download-url-input
"
]
if
(
isFailed
)
classNames
.
push
(
"
failed
"
)
if
(
isLoading
)
classNames
.
push
(
"
loading
"
)
const
{
urls
}
=
getConfigs
()
let
control
=
[]
let
formOnSubmit
=
null
...
...
@@ -128,7 +128,7 @@ export default class Topbar extends React.Component {
}
else
{
formOnSubmit
=
this
.
downloadUrl
control
.
push
(<
input
className
=
"download-url-input"
type
=
"text"
onChange
=
{
this
.
onUrlChange
}
value
=
{
this
.
state
.
url
}
disabled
=
{
isLoading
}
style
=
{
inputStyle
}
/>)
control
.
push
(<
input
className
=
{
classNames
.
join
(
"
"
)
}
type
=
"text"
onChange
=
{
this
.
onUrlChange
}
value
=
{
this
.
state
.
url
}
disabled
=
{
isLoading
}
/>)
control
.
push
(<
Button
className
=
"download-url-button"
onClick
=
{
this
.
downloadUrl
}
>
Explore
</
Button
>)
}
...
...
src/style/_authorize.scss
浏览文件 @
fc3ed30f
...
...
@@ -65,7 +65,19 @@
border-radius
:
4px
;
background-color
:
#ffeeee
;
color
:
red
;
margin
:
1em
;
@include
text_code
();
b
{
text-transform
:
capitalize
;
margin-right
:
1em
;
}
}
}
...
...
src/style/_errors.scss
浏览文件 @
fc3ed30f
...
...
@@ -29,6 +29,22 @@
{
color
:
$errors-wrapper-errors-small-font-color
;
}
.message
{
white-space
:
pre-line
;
&
.thrown
{
max-width
:
100%
;
}
}
.error-line
{
text-decoration
:
underline
;
cursor
:
pointer
;
}
}
hgroup
...
...
src/style/_information.scss
浏览文件 @
fc3ed30f
...
...
@@ -2,6 +2,14 @@
{
margin
:
50px
0
;
&
.failed-config
{
max-width
:
880px
;
margin-left
:
auto
;
margin-right
:
auto
;
text-align
:
center
}
hgroup
.main
{
margin
:
0
0
20px
0
;
...
...
@@ -78,6 +86,11 @@
border-radius
:
57px
;
background
:
$info-title-small-background-color
;
&
.version-stamp
{
background-color
:
#89bf04
;
}
pre
{
...
...
src/style/_layout.scss
浏览文件 @
fc3ed30f
...
...
@@ -419,6 +419,19 @@
}
}
.filter
,
.download-url-wrapper
{
.failed
{
color
:
red
;
}
.loading
{
color
:
#aaa
;
}
}
.model-example
{
margin-top
:
1em
;
}
...
...
@@ -553,6 +566,11 @@
@include
text_body
();
}
.curl
{
white-space
:
normal
;
}
}
.response-col_status
...
...
@@ -583,6 +601,16 @@
@include
text_code
(
$response-col-links-font-color
);
}
.operation-link
{
margin-bottom
:
1
.5em
;
.description
{
margin-bottom
:
0
.5em
;
}
}
}
.opblock-body
...
...
@@ -793,6 +821,35 @@
}
}
.hidden
{
display
:
none
;
}
.no-margin
{
height
:
auto
;
border
:
none
;
margin
:
0
;
padding
:
0
;
}
.float-right
{
float
:
right
;
}
img
.full-width
{
width
:
100%
;
}
.svg-assets
{
position
:
absolute
;
width
:
0
;
height
:
0
;
}
section
{
...
...
@@ -815,6 +872,12 @@ a.nostyle {
}
}
.fallback
{
padding
:
1em
;
color
:
#aaa
;
}
.version-pragma
{
height
:
100%
;
padding
:
5em
0px
;
...
...
@@ -841,3 +904,27 @@ a.nostyle {
}
}
}
.opblock-link
{
font-weight
:
normal
;
&
.shown
{
font-weight
:
bold
;
}
}
span
{
&
.token-string
{
color
:
#555
;
}
&
.token-not-formatted
{
color
:
#555
;
font-weight
:
bold
;
}
}
src/style/_models.scss
浏览文件 @
fc3ed30f
...
...
@@ -97,8 +97,68 @@
{
margin
:
0
0
1em
0
;
}
.property
{
color
:
#999
;
font-style
:
italic
;
&
.primitive
{
color
:
#6b6b6b
;
}
}
}
table
.model
{
tr
{
&
.description
{
color
:
#666
;
font-weight
:
normal
;
td
:first-child
{
font-weight
:
bold
;
}
}
&
.property-row
{
&
.required
td
:first-child
{
font-weight
:
bold
;
}
td
{
vertical-align
:
top
;
&
:first-child
{
padding-right
:
0
.2em
;
}
}
.star
{
color
:
red
;
}
}
&
.extension
{
color
:
#777
;
td
:last-child
{
vertical-align
:
top
;
}
}
}
}
section
.models
{
...
...
@@ -107,6 +167,11 @@ section.models
border
:
1px
solid
rgba
(
$section-models-border-color
,
.3
);
border-radius
:
4px
;
.pointer
{
cursor
:
pointer
;
}
&
.is-open
{
padding
:
0
0
20px
;
...
...
@@ -229,6 +294,13 @@ section.models
font-size
:
16px
;
@include
text_headline
(
$section-models-model-title-font-color
);
img
{
margin-left
:
1em
;
position
:
relative
;
bottom
:
0px
;
}
}
.model-deprecated-warning
...
...
src/style/_table.scss
浏览文件 @
fc3ed30f
...
...
@@ -38,6 +38,12 @@ table
@include
text_code
();
}
.header-example
{
color
:
#999
;
font-style
:
italic
;
}
}
tbody
...
...
@@ -112,6 +118,11 @@ table
{
font-weight
:
bold
;
span
{
color
:
red
;
}
&
:after
{
font-size
:
10px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录