2021-11-09 19:54:48 +08:00
|
|
|
import styled from 'styled-components';
|
2023-03-20 21:08:35 +08:00
|
|
|
import ModalSimple from '/imports/ui/components/common/modal/simple/component';
|
2021-11-09 19:54:48 +08:00
|
|
|
import {
|
|
|
|
colorOffWhite,
|
|
|
|
colorGrayDark,
|
2021-10-19 04:52:59 +08:00
|
|
|
colorGrayLightest,
|
|
|
|
colorPrimary,
|
2022-10-28 22:10:07 +08:00
|
|
|
colorWhite,
|
2022-12-14 04:37:14 +08:00
|
|
|
btnPrimaryActiveBg,
|
2022-09-15 09:16:27 +08:00
|
|
|
colorDanger,
|
2021-11-09 19:54:48 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import {
|
|
|
|
smPaddingX,
|
|
|
|
smPaddingY,
|
2022-10-28 22:10:07 +08:00
|
|
|
mdPaddingY,
|
2021-11-09 19:54:48 +08:00
|
|
|
lgPaddingY,
|
|
|
|
titlePositionLeft,
|
2021-10-19 04:52:59 +08:00
|
|
|
mdPaddingX,
|
|
|
|
borderSizeLarge,
|
|
|
|
jumboPaddingY,
|
2021-11-09 19:54:48 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import {
|
|
|
|
fontSizeSmall,
|
2021-10-19 04:52:59 +08:00
|
|
|
fontSizeXL,
|
2021-11-09 19:54:48 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/typography';
|
2021-11-23 20:05:02 +08:00
|
|
|
import {
|
|
|
|
hasPhoneDimentions,
|
|
|
|
mediumDown,
|
|
|
|
hasPhoneWidth,
|
2022-10-28 22:10:07 +08:00
|
|
|
smallOnly,
|
2021-11-23 20:05:02 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/breakpoints';
|
2022-06-10 22:50:35 +08:00
|
|
|
import {
|
|
|
|
ScrollboxVertical,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/scrollable';
|
2022-10-28 22:10:07 +08:00
|
|
|
import {
|
|
|
|
Tab, Tabs, TabList, TabPanel,
|
|
|
|
} from 'react-tabs';
|
2021-11-09 19:54:48 +08:00
|
|
|
|
2023-07-15 03:47:40 +08:00
|
|
|
const Item = styled.li`
|
2021-11-09 19:54:48 +08:00
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
height: 4rem;
|
2021-10-19 04:52:59 +08:00
|
|
|
border-bottom: 1px solid ${colorGrayLightest};
|
2021-11-09 19:54:48 +08:00
|
|
|
|
2021-10-19 04:52:59 +08:00
|
|
|
${({ last }) => last && `
|
|
|
|
border: none;
|
2021-11-09 19:54:48 +08:00
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Left = styled.div`
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Name = styled.div`
|
2021-10-19 04:52:59 +08:00
|
|
|
display: flex;
|
|
|
|
width: 27.5%;
|
2021-11-09 19:54:48 +08:00
|
|
|
height: 100%;
|
|
|
|
align-items: center;
|
2021-10-19 04:52:59 +08:00
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
|
|
@media ${hasPhoneDimentions} {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const FullName = styled(Name)`
|
|
|
|
width: 100%;
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
2022-09-15 09:16:27 +08:00
|
|
|
const ClientNotRespondingText = styled.div`
|
|
|
|
display: flex;
|
|
|
|
width: 27.5%;
|
|
|
|
height: 100%;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: flex-start;
|
|
|
|
color: ${colorDanger};
|
|
|
|
|
|
|
|
@media ${hasPhoneDimentions} {
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
2021-11-09 19:54:48 +08:00
|
|
|
const Text = styled.div`
|
|
|
|
padding-left: .5rem;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
${({ offline }) => offline && `
|
2021-10-19 04:52:59 +08:00
|
|
|
font-style: italic;
|
2021-11-09 19:54:48 +08:00
|
|
|
`}
|
2021-10-19 04:52:59 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
padding: 0;
|
|
|
|
padding-right: .5rem;
|
|
|
|
}
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const Avatar = styled.div`
|
|
|
|
display: flex;
|
|
|
|
height: 100%;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Icon = styled.div`
|
|
|
|
width: 2.05rem;
|
|
|
|
height: 2.05rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Right = styled.div`
|
|
|
|
display: flex;
|
|
|
|
width: 5rem;
|
|
|
|
height: 100%;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Time = styled.div`
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-10-19 04:52:59 +08:00
|
|
|
justify-content: flex-end;
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
2022-06-10 22:50:35 +08:00
|
|
|
const NetworkDataContainer = styled(ScrollboxVertical)`
|
2021-11-09 19:54:48 +08:00
|
|
|
width: 100%;
|
2021-10-19 04:52:59 +08:00
|
|
|
height: 100%;
|
2021-11-09 19:54:48 +08:00
|
|
|
display: flex;
|
2022-06-10 22:50:35 +08:00
|
|
|
flex-wrap: nowrap;
|
|
|
|
overflow: auto;
|
|
|
|
scroll-snap-type: x mandatory;
|
2022-11-19 03:54:00 +08:00
|
|
|
padding-bottom: 1.25rem;
|
2022-06-10 22:50:35 +08:00
|
|
|
|
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
|
|
background: rgba(0,0,0,.5);
|
|
|
|
}
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
2022-12-06 20:37:26 +08:00
|
|
|
|
2021-11-23 20:05:02 +08:00
|
|
|
@media ${mediumDown} {
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const NetworkData = styled.div`
|
|
|
|
font-size: ${fontSizeSmall};
|
2021-10-19 04:52:59 +08:00
|
|
|
|
|
|
|
${({ invisible }) => invisible && `
|
|
|
|
visibility: hidden;
|
|
|
|
`}
|
|
|
|
|
2021-11-23 20:05:02 +08:00
|
|
|
& :first-child {
|
2021-10-19 04:52:59 +08:00
|
|
|
font-weight: 600;
|
|
|
|
}
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const CopyContainer = styled.div`
|
|
|
|
width: 100%;
|
2021-10-19 04:52:59 +08:00
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
|
|
|
border: none;
|
|
|
|
border-top: 1px solid ${colorOffWhite};
|
|
|
|
padding: ${jumboPaddingY} 0 0;
|
2021-11-09 19:54:48 +08:00
|
|
|
`;
|
|
|
|
|
2023-03-20 21:08:35 +08:00
|
|
|
const ConnectionStatusModal = styled(ModalSimple)`
|
2022-10-28 01:54:34 +08:00
|
|
|
padding: 1rem;
|
2022-11-19 03:54:00 +08:00
|
|
|
height: 28rem;
|
2021-11-09 19:54:48 +08:00
|
|
|
|
|
|
|
`;
|
|
|
|
|
2021-10-19 04:52:59 +08:00
|
|
|
const Container = styled.div`
|
|
|
|
padding: 0 calc(${mdPaddingX} / 2 + ${borderSizeLarge});
|
|
|
|
`;
|
|
|
|
|
2021-11-09 19:54:48 +08:00
|
|
|
const Header = styled.div`
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: none;
|
|
|
|
line-height: ${titlePositionLeft};
|
|
|
|
margin-bottom: ${lgPaddingY};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Title = styled.h2`
|
|
|
|
color: ${colorGrayDark};
|
2021-10-19 04:52:59 +08:00
|
|
|
font-weight: 500;
|
|
|
|
font-size: ${fontSizeXL};
|
|
|
|
text-align: left;
|
|
|
|
margin: 0;
|
2021-11-09 19:54:48 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2021-10-19 04:52:59 +08:00
|
|
|
text-align: right;
|
2021-11-09 19:54:48 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Content = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Wrapper = styled.div`
|
|
|
|
display: block;
|
|
|
|
width: 100%;
|
|
|
|
max-height: 16rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Status = styled.div`
|
|
|
|
display: flex;
|
|
|
|
width: 6rem;
|
|
|
|
height: 100%;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Copy = styled.span`
|
|
|
|
cursor: pointer;
|
2021-10-19 04:52:59 +08:00
|
|
|
color: ${colorPrimary};
|
2021-11-09 19:54:48 +08:00
|
|
|
|
2021-10-19 04:52:59 +08:00
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
2021-11-09 19:54:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
${({ disabled }) => disabled && `
|
|
|
|
cursor: not-allowed !important;
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
2022-06-10 22:50:35 +08:00
|
|
|
const HelperWrapper = styled.div`
|
|
|
|
min-width: 12.5rem;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
@media ${mediumDown} {
|
|
|
|
flex: none;
|
|
|
|
width: 100%;
|
|
|
|
scroll-snap-align: start;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-10-19 04:52:59 +08:00
|
|
|
const Helper = styled.div`
|
|
|
|
width: 12.5rem;
|
|
|
|
height: 100%;
|
|
|
|
border-radius: .5rem;
|
|
|
|
background-color: ${colorOffWhite};
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
2022-10-28 22:10:07 +08:00
|
|
|
padding: .5rem;
|
2021-10-19 04:52:59 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const NetworkDataContent = styled.div`
|
|
|
|
margin: 0;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
|
|
|
flex-grow: 1;
|
2021-11-23 20:05:02 +08:00
|
|
|
|
|
|
|
@media ${mediumDown} {
|
2022-06-10 22:50:35 +08:00
|
|
|
flex: none;
|
|
|
|
width: 100%;
|
|
|
|
scroll-snap-align: start;
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
2021-10-19 04:52:59 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const DataColumn = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
2021-11-23 20:05:02 +08:00
|
|
|
@media ${hasPhoneWidth} {
|
2021-10-19 04:52:59 +08:00
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
const ConnectionTabs = styled(Tabs)`
|
2021-10-19 04:52:59 +08:00
|
|
|
display: flex;
|
2022-10-28 22:10:07 +08:00
|
|
|
flex-flow: column;
|
|
|
|
justify-content: flex-start;
|
2021-10-19 04:52:59 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
width: 100%;
|
|
|
|
flex-flow: column;
|
|
|
|
}
|
2021-10-19 04:52:59 +08:00
|
|
|
`;
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
const ConnectionTabList = styled(TabList)`
|
2021-10-19 04:52:59 +08:00
|
|
|
display: flex;
|
2022-10-28 22:10:07 +08:00
|
|
|
flex-flow: row;
|
|
|
|
margin: 0;
|
|
|
|
margin-bottom: .5rem;
|
2021-10-19 04:52:59 +08:00
|
|
|
border: none;
|
2022-10-28 22:10:07 +08:00
|
|
|
padding: 0;
|
|
|
|
width: calc(100% / 3);
|
2021-10-19 04:52:59 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
width: 100%;
|
|
|
|
flex-flow: row;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
justify-content: center;
|
2021-10-19 04:52:59 +08:00
|
|
|
}
|
2022-10-28 22:10:07 +08:00
|
|
|
`;
|
2021-10-19 04:52:59 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
const ConnectionTabPanel = styled(TabPanel)`
|
|
|
|
display: none;
|
|
|
|
margin: 0 0 0 1rem;
|
|
|
|
height: 13rem;
|
2021-10-19 04:52:59 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
2022-10-28 22:10:07 +08:00
|
|
|
margin: 0 1rem 0 0;
|
2021-10-19 04:52:59 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
&.is-selected {
|
2021-11-23 20:05:02 +08:00
|
|
|
display: flex;
|
2022-11-19 03:54:00 +08:00
|
|
|
flex-flow: column;
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
|
2023-07-15 03:47:40 +08:00
|
|
|
& ul {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
width: 100%;
|
2021-11-23 20:05:02 +08:00
|
|
|
margin: 0;
|
2022-10-28 22:10:07 +08:00
|
|
|
padding-left: 1rem;
|
|
|
|
padding-right: 1rem;
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
const ConnectionTabSelector = styled(Tab)`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: row;
|
|
|
|
font-size: 0.9rem;
|
|
|
|
flex: 0 0 auto;
|
|
|
|
justify-content: flex-start;
|
|
|
|
border: none !important;
|
|
|
|
padding: ${mdPaddingY} ${mdPaddingX};
|
2021-11-23 20:05:02 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
border-radius: .2rem;
|
2021-11-23 20:05:02 +08:00
|
|
|
cursor: pointer;
|
2022-10-28 22:10:07 +08:00
|
|
|
margin-bottom: ${smPaddingY};
|
|
|
|
align-items: center;
|
|
|
|
flex-grow: 0;
|
|
|
|
min-width: 0;
|
2021-11-23 20:05:02 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
& > span {
|
|
|
|
min-width: 0;
|
|
|
|
display: inline-block;
|
2021-10-19 04:52:59 +08:00
|
|
|
white-space: nowrap;
|
2022-10-28 22:10:07 +08:00
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
max-width: 100%;
|
|
|
|
margin: 0 ${smPaddingX} 0 0;
|
|
|
|
& > i {
|
|
|
|
display: none;
|
|
|
|
}
|
2021-11-23 20:05:02 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: 0 0 0 ${smPaddingX};
|
|
|
|
}
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
span {
|
|
|
|
border-bottom: 2px solid ${colorWhite};
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
&.is-selected {
|
|
|
|
border: none;
|
|
|
|
color: ${colorPrimary};
|
2021-11-23 20:05:02 +08:00
|
|
|
|
2022-10-28 22:10:07 +08:00
|
|
|
span {
|
2022-12-14 04:37:14 +08:00
|
|
|
border-bottom: 2px solid ${btnPrimaryActiveBg};
|
2021-10-19 04:52:59 +08:00
|
|
|
}
|
2021-11-23 20:05:02 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-11-09 19:54:48 +08:00
|
|
|
export default {
|
|
|
|
Item,
|
|
|
|
Left,
|
|
|
|
Name,
|
|
|
|
Text,
|
|
|
|
Avatar,
|
|
|
|
Icon,
|
|
|
|
Right,
|
|
|
|
Time,
|
|
|
|
NetworkDataContainer,
|
|
|
|
NetworkData,
|
|
|
|
CopyContainer,
|
|
|
|
ConnectionStatusModal,
|
2022-09-15 09:16:27 +08:00
|
|
|
ClientNotRespondingText,
|
2021-11-09 19:54:48 +08:00
|
|
|
Container,
|
|
|
|
Header,
|
|
|
|
Title,
|
|
|
|
Content,
|
|
|
|
Wrapper,
|
|
|
|
Status,
|
|
|
|
Copy,
|
2021-10-19 04:52:59 +08:00
|
|
|
Helper,
|
|
|
|
NetworkDataContent,
|
|
|
|
FullName,
|
|
|
|
DataColumn,
|
2022-06-10 22:50:35 +08:00
|
|
|
HelperWrapper,
|
2022-10-28 22:10:07 +08:00
|
|
|
ConnectionTabs,
|
|
|
|
ConnectionTabList,
|
|
|
|
ConnectionTabSelector,
|
|
|
|
ConnectionTabPanel,
|
2021-11-09 19:54:48 +08:00
|
|
|
};
|