-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
397 additions
and
65 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
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,11 @@ | ||
import {Action} from '@/static/modules/actions/types'; | ||
import actionNames from '@/static/modules/action-names'; | ||
|
||
type SetGuiServerConnectionStatusAction = Action<typeof actionNames.SET_GUI_SERVER_CONNECTION_STATUS, { | ||
isConnected: boolean; | ||
wasDisconnected?: boolean; | ||
}>; | ||
export const setGuiServerConnectionStatus = (payload: SetGuiServerConnectionStatusAction['payload']): SetGuiServerConnectionStatusAction => | ||
({type: actionNames.SET_GUI_SERVER_CONNECTION_STATUS, payload}); | ||
|
||
export type GuiServerConnectionAction = SetGuiServerConnectionStatusAction; |
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
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,21 @@ | ||
import {State} from '@/static/new-ui/types/store'; | ||
import {SomeAction} from '@/static/modules/actions/types'; | ||
import actionNames from '@/static/modules/action-names'; | ||
import {applyStateUpdate} from '@/static/modules/utils'; | ||
|
||
export default (state: State, action: SomeAction): State => { | ||
switch (action.type) { | ||
case actionNames.SET_GUI_SERVER_CONNECTION_STATUS: { | ||
return applyStateUpdate(state, { | ||
app: { | ||
guiServerConnection: { | ||
isConnected: action.payload.isConnected, | ||
wasDisconnected: action.payload.wasDisconnected | ||
} | ||
} | ||
}); | ||
} | ||
default: | ||
return state; | ||
} | ||
}; |
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
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,14 @@ | ||
.container { | ||
background-color: #fff; | ||
padding: 20px; | ||
width: 440px; | ||
height: 100%; | ||
overflow-x: scroll; | ||
|
||
--g-text-body-font-weight: 450; | ||
--g-text-body-short-font-size: 15px; | ||
} | ||
|
||
.divider { | ||
margin: 12px 0 20px 0; | ||
} |
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,19 @@ | ||
import {Divider} from '@gravity-ui/uikit'; | ||
import classNames from 'classnames'; | ||
import React, {ReactNode} from 'react'; | ||
|
||
import styles from './index.module.css'; | ||
|
||
interface AsidePanelProps { | ||
title: string; | ||
children?: ReactNode; | ||
className?: string; | ||
} | ||
|
||
export function AsidePanel(props: AsidePanelProps): ReactNode { | ||
return <div className={classNames(styles.container, props.className)}> | ||
<h2 className={classNames('text-display-1')}>{props.title}</h2> | ||
<Divider className={styles.divider} orientation={'horizontal'} /> | ||
{props.children} | ||
</div>; | ||
} |
66 changes: 66 additions & 0 deletions
66
lib/static/new-ui/components/InfoPanel/DataSourceItem.module.css
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,66 @@ | ||
.data-source-item { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 12px 4px; | ||
gap: 28px; | ||
} | ||
|
||
.data-source-title-container { | ||
display: flex; | ||
gap: 8px; | ||
overflow: hidden; | ||
} | ||
|
||
.data-source-icon { | ||
flex-shrink: 0; | ||
color: var(--g-color-private-black-450-solid); | ||
} | ||
|
||
.data-source-status { | ||
font-family: monospace; | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
|
||
.data-source-status-circle { | ||
width: 6px; | ||
height: 6px; | ||
border-radius: 100vh; | ||
} | ||
|
||
.data-source-status-circle-offline { | ||
box-shadow: 0 0 0 4px var(--g-color-private-red-50); | ||
background-color: var(--g-color-private-red-600-solid); | ||
} | ||
|
||
@keyframes pulse { | ||
0% { | ||
box-shadow: 0 0 0 0 var(--pulse-color-from); | ||
} | ||
|
||
100% { | ||
box-shadow: 0 0 0 4px var(--pulse-color-to); | ||
} | ||
} | ||
|
||
.data-source-status-circle-online { | ||
--pulse-color-from: var(--g-color-private-green-500); | ||
--pulse-color-to: rgba(255 255 255 / 0); | ||
animation: pulse 2s ease infinite; | ||
background-color: var(--g-color-private-green-550-solid); | ||
} | ||
|
||
.title { | ||
white-space: nowrap; | ||
display: inline-block; | ||
} | ||
|
||
.ellipsis { | ||
display: inline-block; | ||
vertical-align: bottom; | ||
white-space: nowrap; | ||
max-width: var(--max-width); | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} |
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,34 @@ | ||
import {Icon, IconProps} from '@gravity-ui/uikit'; | ||
import classNames from 'classnames'; | ||
import React, {ReactNode} from 'react'; | ||
|
||
import styles from './DataSourceItem.module.css'; | ||
|
||
interface DataSourceItemProps { | ||
icon: IconProps['data']; | ||
title: string; | ||
success: boolean; | ||
statusCode?: number | string; | ||
url?: string; | ||
} | ||
|
||
export function DataSourceItem(props: DataSourceItemProps): ReactNode { | ||
const urlTitle = props.url?.replace(/^https?:\/\//, ''); | ||
|
||
return <div className={styles.dataSourceItem}> | ||
<div className={styles.dataSourceTitleContainer}> | ||
<Icon data={props.icon} className={styles.dataSourceIcon}/> | ||
{props.url && urlTitle ? | ||
// Here we want to place ellipsis in the middle of the long url, e.g. example.com/lo...ng/1234.sqlite | ||
<a href={props.url} className={styles.title} title={props.title}> | ||
<span className={styles.ellipsis} style={{'--max-width': '130px'} as React.CSSProperties}>{urlTitle.slice(0, -24)}</span> | ||
{urlTitle.slice(-24)} | ||
</a> : | ||
<span className={styles.ellipsis}>{props.title}</span>} | ||
</div> | ||
<div className={styles.dataSourceStatus}><span>{props.success ? 'OK' : (props.statusCode && typeof props.statusCode === 'number' ? `E${props.statusCode}` : 'ERR')}</span> | ||
<div | ||
className={classNames(styles.dataSourceStatusCircle, props.success ? styles.dataSourceStatusCircleOnline : styles.dataSourceStatusCircleOffline)}></div> | ||
</div> | ||
</div>; | ||
} |
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,55 @@ | ||
.divider { | ||
margin: 20px 0; | ||
} | ||
|
||
.info-panel a:link, .info-panel a:visited { | ||
color: var(--color-link); | ||
} | ||
|
||
.info-panel a:hover { | ||
color: var(--color-link-hover); | ||
} | ||
|
||
.extra-items-list { | ||
padding-left: 24px; | ||
list-style: none; | ||
} | ||
|
||
.extra-items-list li { | ||
position: relative; | ||
margin-bottom: 12px; | ||
} | ||
|
||
.extra-items-list li::before { | ||
content: ''; | ||
height: 4px; | ||
width: 4px; | ||
border-radius: 100vh; | ||
background-color: #000; | ||
position: absolute; | ||
top: 50%; | ||
transform: translateY(-50%); | ||
left: -10px; | ||
} | ||
|
||
.extra-items-list a { | ||
display: inline-block; | ||
} | ||
|
||
.extra-items-list a::first-letter { | ||
text-transform: uppercase; | ||
} | ||
|
||
.data-source-heading { | ||
display: flex; | ||
justify-content: space-between; | ||
font-weight: 450; | ||
border-bottom: 1px solid var(--g-divider-color); | ||
padding-bottom: 8px; | ||
} | ||
|
||
.data-source-list { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
Oops, something went wrong.