-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #521 from traPtitech/dashboard/tmp-view
temporary view of dashboard
- Loading branch information
Showing
19 changed files
with
921 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { styled } from '@macaron-css/solid' | ||
import { vars } from '/@/theme' | ||
import { providerToIcon } from '/@/libs/application' | ||
import { A } from '@solidjs/router' | ||
import { Button } from '/@/components/Button' | ||
import { JSXElement } from 'solid-js' | ||
import { CenterInline } from '/@/libs/layout' | ||
|
||
const AppTitleContainer = styled('div', { | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: '14px', | ||
alignContent: 'center', | ||
|
||
marginTop: '48px', | ||
fontSize: '32px', | ||
fontWeight: 'bold', | ||
color: vars.text.black1, | ||
}, | ||
}) | ||
|
||
const AppTitle = styled('div', { | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: '8px', | ||
}, | ||
}) | ||
|
||
const AppNavContainer = styled('div', { | ||
base: { | ||
marginTop: '20px', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: '20px', | ||
} | ||
}) | ||
|
||
export interface AppNavProps { | ||
repoName: string | ||
appName: string | ||
appID: string | ||
} | ||
|
||
export const AppNav = (props: AppNavProps): JSXElement => { | ||
return ( | ||
<> | ||
<AppTitleContainer> | ||
<CenterInline>{providerToIcon('GitHub', 36)}</CenterInline> | ||
<AppTitle> | ||
<div>{props.repoName}</div> | ||
<div>/</div> | ||
<div>{props.appName}</div> | ||
</AppTitle> | ||
</AppTitleContainer> | ||
<AppNavContainer> | ||
<A href={`/apps/${props.appID}`}> | ||
<Button color='black1' size='large'>General</Button> | ||
</A> | ||
<A href={`/apps/${props.appID}/builds`}> | ||
<Button color='black1' size='large'>Builds</Button> | ||
</A> | ||
</AppNavContainer> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { JSXElement } from 'solid-js' | ||
import { AiFillCheckCircle, AiFillExclamationCircle, AiFillMinusCircle } from 'solid-icons/ai' | ||
import { vars } from '/@/theme' | ||
import { IoReloadCircle } from 'solid-icons/io' | ||
import { Build_BuildStatus } from '/@/api/neoshowcase/protobuf/gateway_pb' | ||
import { Dynamic } from 'solid-js/web' | ||
|
||
interface IconProps { | ||
size: number | ||
} | ||
const components: Record<Build_BuildStatus, (size: IconProps) => JSXElement> = { | ||
[Build_BuildStatus.QUEUED]: (props) => <AiFillMinusCircle size={props.size} color={vars.text.black4} />, | ||
[Build_BuildStatus.BUILDING]: (props) => <IoReloadCircle size={props.size} color={vars.icon.pending} />, | ||
[Build_BuildStatus.SUCCEEDED]: (props) => <AiFillCheckCircle size={props.size} color={vars.icon.success1} />, | ||
[Build_BuildStatus.FAILED]: (props) => <AiFillExclamationCircle size={props.size} color={vars.icon.error} />, | ||
[Build_BuildStatus.CANCELLED]: (props) => <AiFillExclamationCircle size={props.size} color={vars.text.black4} />, | ||
[Build_BuildStatus.SKIPPED]: (props) => <AiFillExclamationCircle size={props.size} color={vars.text.black4} />, | ||
} | ||
|
||
interface Props { | ||
state: Build_BuildStatus | ||
size?: number | ||
} | ||
|
||
export const BuildStatusIcon = (props: Props): JSXElement => { | ||
return ( | ||
<Dynamic component={components[props.state]} size={props.size ?? 20} /> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { styled } from '@macaron-css/solid' | ||
import { vars } from '/@/theme' | ||
import { JSXElement } from 'solid-js' | ||
|
||
const Container = styled('div', { | ||
base: { | ||
display: 'flex', | ||
borderRadius: '4px', | ||
}, | ||
variants: { | ||
cursor: { | ||
none: {}, | ||
pointer: { | ||
cursor: 'pointer', | ||
}, | ||
}, | ||
color: { | ||
black1: { | ||
backgroundColor: vars.bg.black1, | ||
}, | ||
}, | ||
size: { | ||
large: { | ||
minWidth: '180px', | ||
height: '44px', | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
const Text = styled('div', { | ||
base: { | ||
margin: 'auto', | ||
}, | ||
variants: { | ||
color: { | ||
black1: { | ||
color: vars.text.white1, | ||
}, | ||
}, | ||
size: { | ||
large: { | ||
fontSize: '16px', | ||
fontWeight: 'bold', | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
export interface Props { | ||
children: JSXElement | ||
color: 'black1' | ||
size: 'large' | ||
onclick?: () => void | ||
} | ||
|
||
export const Button = (props: Props) => { | ||
return ( | ||
<Container | ||
color={props.color} | ||
size={props.size} | ||
cursor={props.onclick !== undefined ? 'pointer' : 'none'} | ||
onclick={props.onclick} | ||
> | ||
<Text color={props.color} size={props.size}> | ||
{props.children} | ||
</Text> | ||
</Container> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { styled } from '@macaron-css/solid' | ||
import { vars } from '/@/theme' | ||
|
||
export const CardsContainer = styled('div', { | ||
base: { | ||
marginTop: '24px', | ||
display: 'flex', | ||
flexDirection: 'row', | ||
flexWrap: 'wrap', | ||
gap: '40px', | ||
}, | ||
}) | ||
|
||
export const Card = styled('div', { | ||
base: { | ||
minWidth: '320px', | ||
borderRadius: '4px', | ||
border: `1px solid ${vars.bg.white4}`, | ||
background: vars.bg.white1, | ||
padding: '24px 36px', | ||
|
||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '24px', | ||
}, | ||
}) | ||
|
||
export const CardTitle = styled('div', { | ||
base: { | ||
fontSize: '24px', | ||
fontWeight: 600, | ||
}, | ||
}) | ||
|
||
export const CardItems = styled('div', { | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
gap: '20px', | ||
}, | ||
}) | ||
|
||
export const CardItem = styled('div', { | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
gap: '8px', | ||
}, | ||
}) | ||
|
||
export const CardItemTitle = styled('div', { | ||
base: { | ||
fontSize: '16px', | ||
color: vars.text.black3, | ||
}, | ||
}) | ||
|
||
export const CardItemContent = styled('div', { | ||
base: { | ||
marginLeft: 'auto', | ||
fontSize: '16px', | ||
color: vars.text.black1, | ||
|
||
display: 'flex', | ||
flexDirection: 'row', | ||
alignItems: 'center', | ||
gap: '4px', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { styled } from '@macaron-css/solid' | ||
import { vars } from '/@/theme' | ||
|
||
export const LogContainer = styled('div', { | ||
base: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
|
||
backgroundColor: vars.bg.black1, | ||
padding: '10px', | ||
color: vars.text.white1, | ||
borderRadius: '4px', | ||
|
||
maxHeight: '500px', | ||
overflowY: 'scroll', | ||
}, | ||
variants: { | ||
overflowX: { | ||
wrap: { | ||
whiteSpace: 'pre-wrap', | ||
overflowWrap: 'anywhere', | ||
}, | ||
scroll: { | ||
whiteSpace: 'nowrap', | ||
overflowX: 'scroll', | ||
} | ||
} | ||
}, | ||
defaultVariants: { | ||
overflowX: 'wrap', | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
import { JSXElement } from 'solid-js' | ||
import { JSXElement, Match, Switch } from 'solid-js' | ||
import { AiFillCheckCircle, AiFillMinusCircle } from 'solid-icons/ai' | ||
import { vars } from '/@/theme' | ||
import { IoReloadCircle } from 'solid-icons/io' | ||
import { ApplicationState } from '/@/libs/application' | ||
import { Dynamic } from 'solid-js/web' | ||
|
||
interface IconProps { | ||
size: number | ||
} | ||
const components: Record<ApplicationState, (props: IconProps) => JSXElement> = { | ||
Idle: (props) => <AiFillMinusCircle size={props.size} color={vars.text.black4} />, | ||
Deploying: (props) => <IoReloadCircle size={props.size} color={vars.icon.pending} />, | ||
Running: (props) => <AiFillCheckCircle size={props.size} color={vars.icon.success1} />, | ||
Static: (props) => <AiFillCheckCircle size={props.size} color={vars.icon.success2} />, | ||
} | ||
|
||
interface Props { | ||
state: ApplicationState | ||
size?: number | ||
} | ||
|
||
export const StatusIcon = (props: Props): JSXElement => { | ||
const size = () => props.size ?? 20 | ||
switch (props.state) { | ||
case ApplicationState.Idle: | ||
return <AiFillMinusCircle size={size()} color={vars.text.black4} /> | ||
case ApplicationState.Deploying: | ||
return <IoReloadCircle size={size()} color={vars.icon.pending} /> | ||
case ApplicationState.Running: | ||
return <AiFillCheckCircle size={size()} color={vars.icon.success1} /> | ||
case ApplicationState.Static: | ||
return <AiFillCheckCircle size={size()} color={vars.icon.success2} /> | ||
} | ||
return ( | ||
<Dynamic component={components[props.state]} size={props.size ?? 20} /> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.