diff --git a/src/actions/types.ts b/src/actions/types.ts index 32e4d45..64def37 100644 --- a/src/actions/types.ts +++ b/src/actions/types.ts @@ -21,7 +21,6 @@ export interface RootState { } export interface Organization { - id: number name: string @@ -44,7 +43,6 @@ export interface Organization { owner?: User newOwner?: User - } export interface User { @@ -65,3 +63,79 @@ export interface IConfig { key: string } } +export interface Repository { + id: number + + name: string + + description?: string + + logo?: string + + /** true: 公开, false: 私有 */ + visibility?: boolean + + creatorId?: number + + ownerId?: number + + organizationid?: number + + memberIds?: number[] + + members?: User[] + + owner?: User + + newOwner?: User + + collaborators?: Repository[] + + collaboratorIds?: string[] + + collaboratorIdstring?: string +} + +export interface Module { + id: number + + name: string + + description?: string + + repositoryid?: number + + creatorId?: number + + priority: number + + repository?: Repository + + repositoryId?: number +} + +export interface Interface { + id: number + + name: string + + url: string + + method: string + + description?: string + + moduleId?: number + + creatorId?: number + + lockerid?: number + + locker?: User + + repositoryId?: number + + repository?: Repository + + status?: number +} diff --git a/src/assets/components.sass b/src/assets/components.sass index c19738c..c57e4ad 100644 --- a/src/assets/components.sass +++ b/src/assets/components.sass @@ -152,4 +152,199 @@ table.table padding: 1.25rem; button:focus - outline: none; \ No newline at end of file + outline: none; + +.dropup, .dropright, .dropdown, .dropleft + position: relative + +.dropdown-toggle + white-space: nowrap + &::after + display: inline-block + margin-left: 0.255em + vertical-align: 0.255em + content: "" + border-top: 0.3em solid + border-right: 0.3em solid transparent + border-bottom: 0 + border-left: 0.3em solid transparent + &:empty::after + margin-left: 0 + +.dropdown-menu + position: absolute + top: 100% + left: 0 + z-index: 1000 + display: none + float: left + min-width: 10rem + padding: 0.5rem 0 + margin: 0.125rem 0 0 + font-size: 1rem + color: #212529 + text-align: left + list-style: none + background-color: #fff + background-clip: padding-box + border: 1px solid rgba(0, 0, 0, 0.15) + border-radius: 0.25rem + +.dropdown-menu-left + right: auto + left: 0 + +.dropdown-menu-right + right: 0 + left: auto + +@media (min-width: 576px) + .dropdown-menu-sm-left + right: auto + left: 0 + .dropdown-menu-sm-right + right: 0 + left: auto + +@media (min-width: 768px) + .dropdown-menu-md-left + right: auto + left: 0 + .dropdown-menu-md-right + right: 0 + left: auto + +@media (min-width: 992px) + .dropdown-menu-lg-left + right: auto + left: 0 + .dropdown-menu-lg-right + right: 0 + left: auto + +@media (min-width: 1200px) + .dropdown-menu-xl-left + right: auto + left: 0 + .dropdown-menu-xl-right + right: 0 + left: auto + +.dropup + .dropdown-menu + top: auto + bottom: 100% + margin-top: 0 + margin-bottom: 0.125rem + .dropdown-toggle + &::after + display: inline-block + margin-left: 0.255em + vertical-align: 0.255em + content: "" + border-top: 0 + border-right: 0.3em solid transparent + border-bottom: 0.3em solid + border-left: 0.3em solid transparent + &:empty::after + margin-left: 0 + +.dropright + .dropdown-menu + top: 0 + right: auto + left: 100% + margin-top: 0 + margin-left: 0.125rem + .dropdown-toggle + &::after + display: inline-block + margin-left: 0.255em + vertical-align: 0.255em + content: "" + border-top: 0.3em solid transparent + border-right: 0 + border-bottom: 0.3em solid transparent + border-left: 0.3em solid + &:empty::after + margin-left: 0 + &::after + vertical-align: 0 + +.dropleft + .dropdown-menu + top: 0 + right: 100% + left: auto + margin-top: 0 + margin-right: 0.125rem + .dropdown-toggle + &::after + display: inline-block + margin-left: 0.255em + vertical-align: 0.255em + content: "" + display: none + &::before + display: inline-block + margin-right: 0.255em + vertical-align: 0.255em + content: "" + border-top: 0.3em solid transparent + border-right: 0.3em solid + border-bottom: 0.3em solid transparent + &:empty::after + margin-left: 0 + &::before + vertical-align: 0 + +.dropdown-menu + &[x-placement^="top"], &[x-placement^="right"], &[x-placement^="bottom"], &[x-placement^="left"] + right: auto + bottom: auto + +.dropdown-divider + height: 0 + margin: 0.5rem 0 + overflow: hidden + border-top: 1px solid #e9ecef + +.dropdown-item + display: block + width: 100% + padding: 0.25rem 1.5rem + clear: both + font-weight: 400 + color: #212529 + text-align: inherit + white-space: nowrap + background-color: transparent + border: 0 + &:hover, &:focus + color: #16181b + text-decoration: none + background-color: #f8f9fa + &.active, &:active + color: #fff + text-decoration: none + background-color: #007bff + &.disabled, &:disabled + color: #6c757d + pointer-events: none + background-color: transparent + +.dropdown-menu.show + display: block + +.dropdown-header + display: block + padding: 0.5rem 1.5rem + margin-bottom: 0 + font-size: 0.875rem + color: #6c757d + white-space: nowrap + +.dropdown-item-text + display: block + padding: 0.25rem 1.5rem + color: #212529 \ No newline at end of file diff --git a/src/assets/index.sass b/src/assets/index.sass index da6e4d4..0a622a9 100644 --- a/src/assets/index.sass +++ b/src/assets/index.sass @@ -8,81 +8,192 @@ @import "./shortcuts.sass" html - font-size: 62.5%; // 10 ÷ 16 × 100% = 62.5% + font-size: 62.5% // 10 ÷ 16 × 100% = 62.5% +html + font-family: sans-serif + line-height: 1.15 + -webkit-text-size-adjust: 100% + -webkit-tap-highlight-color: transparent + +*, :after, :before + box-sizing: border-box + +.clearfix:after + display: block + clear: both + content: "" + +img, svg + vertical-align: middle body - font-size: 1.2rem; - line-height: 1.5; - font-family: $font-family; - -webkit-font-smoothing: antialiased; + font-size: 1.2rem + line-height: 1.5 + font-family: $font-family + -webkit-font-smoothing: antialiased + margin: 0 + font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji + font-weight: 400 + line-height: 1.5 + color: #212529 + text-align: left + background-color: #fff html, body - height: 100%; + height: 100% #root - height: 100%; + height: 100% > .Routes - display: flex; - flex-direction: column; - min-height: 100%; + display: flex + flex-direction: column + min-height: 100% > .body - flex-grow: 1; - display: flex; - flex-direction: column; + flex-grow: 1 + display: flex + flex-direction: column > .Spin - align-items: center; - justify-content: center; + align-items: center + justify-content: center > * // 内容区域 - flex-grow: 1; - display: flex; - flex-direction: column; + flex-grow: 1 + display: flex + flex-direction: column > .body - flex-grow: 1; + flex-grow: 1 button, input, optgroup, select, textarea - font-size: 1.2rem; - font-family: $font-family; - -webkit-font-smoothing: antialiased; + font-size: 1.2rem + font-family: $font-family + -webkit-font-smoothing: antialiased // * -// transition: color .15s ease-out, background-color .15s ease-out, opacity .15s ease-out; +// transition: color .15s ease-out, background-color .15s ease-out, opacity .15s ease-out a &, &:hover, &:focus, &:active, &:visited - outline: 0; - text-decoration: none; + color: $brand + outline: 0 + text-decoration: none &[disabled], &.disabled - pointer-events: none; - cursor: not-allowed; + pointer-events: none + cursor: not-allowed a.text-decoration &:hover - border-bottom: 1px solid $brand; + border-bottom: 1px solid $brand pre - margin: 0; - padding: 0.5rem 0.75rem; - border: 1px solid $border; - border-radius: 0.4rem; - background-color: $bg; - white-space: pre-wrap; + margin: 0 + padding: 0.5rem 0.75rem + border: 1px solid $border + border-radius: 0.4rem + background-color: $bg + white-space: pre-wrap .btn-top - position: fixed; - right: 150px; - bottom: -1px; - width: 90px; - height: 50px; - text-align: center; - vertical-align: middle; - padding: 16px; - z-index: 99999; - background-color: #ffffff; - border: 1px solid #DDDDDD; - border-radius: 16px; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; + position: fixed + right: 150px + bottom: -1px + width: 90px + height: 50px + text-align: center + vertical-align: middle + padding: 16px + z-index: 99999 + background-color: #ffffff + border: 1px solid #DDDDDD + border-radius: 16px + border-bottom-left-radius: 0 + border-bottom-right-radius: 0 .mr8 - margin-right: 8px; \ No newline at end of file + margin-right: 8px + +.row + display: flex + flex-wrap: wrap + margin-right: -15px + margin-left: -15px + + +.card + position: relative + display: flex + flex-direction: column + min-width: 0 + word-wrap: break-word + background-color: #fff + background-clip: border-box + border: 1px solid rgba(0, 0, 0, 0.125) + border-radius: .25rem + +.card-header + padding: .75rem 1.25rem + margin-bottom: 0 + background-color: rgba(0,0,0,.03) + border-bottom: 1px solid rgba(0,0,0,.125) + +.distribute-2-3 + flex-basis: 66.666666% + max-width: 66.666666% + + +.distribute-1-3 + flex-basis: 33.333333% + max-width: 33.333333% + +.badge-secondary + color: #fff + background-color: #6c757d + +.badge + display: inline-block + padding: .25em .4em + font-size: 75% + font-weight: 700 + line-height: 1 + text-align: center + white-space: nowrap + vertical-align: baseline + border-radius: .25rem + -webkit-transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out + transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out + +code + font-size: 87.5% + color: #e83e8c + word-break: break-word + +.alert + position: relative + padding: .75rem 1.25rem + margin-bottom: 1rem + border: 1px solid transparent + border-radius: .25rem + margin-bottom: 0 + .title + margin-right: 1rem + .icon + font-size: 1.4rem + margin-right: .5rem + .msg + font-weight: bold + margin-right: 1rem + .itf + a + margin-right: 1rem + &.alert-warning + color: #856404 + background-color: #fff3cd + border-color: #ffeeba + &.alert-danger + color: #721c24 + background-color: #f8d7da + border-color: #f5c6cb + &.alert-info + color: #0c5460 + background-color: #d1ecf1 + border-color: #bee5eb + diff --git a/src/assets/shortcuts.sass b/src/assets/shortcuts.sass index fb01a37..8c10cd2 100644 --- a/src/assets/shortcuts.sass +++ b/src/assets/shortcuts.sass @@ -7,6 +7,9 @@ .hide display: none !important; +.float-right + float: right; + // ---------------------------------------- // 功能 // ---------------------------------------- diff --git a/src/components/api/API.tsx b/src/components/api/API.tsx index 0e27d0e..9105727 100644 --- a/src/components/api/API.tsx +++ b/src/components/api/API.tsx @@ -1,7 +1,7 @@ import React from 'react' import { serve } from '../../relatives/services/constant' import './API.css' -import { Paper } from '@material-ui/core' +import { Paper, Button } from '@material-ui/core' const ExampleJQuery = () => (
@@ -82,8 +82,9 @@ class API extends React.Component {