-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: retrieve cloud devices * wip: cloud device retrieve apis * wip: cloud device list ui * feat: add device image * fix: margin for text * fix: cloud device list
- Loading branch information
Showing
24 changed files
with
755 additions
and
179 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
3 changes: 3 additions & 0 deletions
3
packages/typescript-private/console/src/dto/cloud-device/cloud-device.dto.ts
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,3 @@ | ||
import { PageDtoBase } from '../pagination/page.dto'; | ||
|
||
export interface FindCloudDevicesDtoBase extends PageDtoBase {} |
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
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
36 changes: 36 additions & 0 deletions
36
projects/console-web-front/pages/dashboard/[orgId]/live-testing/[deviceId].tsx
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,36 @@ | ||
import { GetServerSideProps } from 'next'; | ||
import styled from 'styled-components'; | ||
|
||
import { NextPageWithLayout } from 'pages/_app'; | ||
import ManualTesting from 'src/components/studio/ManualTesting'; | ||
import { | ||
getCloudDeviceStudioTestingServerSideProps, | ||
getStudioTestingLayout, | ||
CloudStudioTestingPageProps, | ||
} from 'enterprise/pages/studio'; | ||
|
||
const CloudLiveTestingStudioPage: NextPageWithLayout<CloudStudioTestingPageProps> = ({ | ||
organization, | ||
me, | ||
deviceId, | ||
}) => { | ||
return ( | ||
<Box> | ||
<ManualTesting organization={organization} deviceId={deviceId} me={me} hideDeviceSelector /> | ||
</Box> | ||
); | ||
}; | ||
|
||
CloudLiveTestingStudioPage.getLayout = getStudioTestingLayout; | ||
|
||
export const getServerSideProps: GetServerSideProps<CloudStudioTestingPageProps> = | ||
getCloudDeviceStudioTestingServerSideProps; | ||
|
||
export default CloudLiveTestingStudioPage; | ||
|
||
const Box = styled.div` | ||
width: 100%; | ||
display: flex; | ||
align-items: flex-start; | ||
flex: 1; | ||
`; |
71 changes: 71 additions & 0 deletions
71
projects/console-web-front/pages/dashboard/[orgId]/live-testing/index.tsx
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,71 @@ | ||
import styled from 'styled-components'; | ||
import Head from 'next/head'; | ||
import { Divider } from 'antd'; | ||
|
||
import { NextPageWithLayout } from 'pages/_app'; | ||
import ConsoleLayout from 'src/components/layouts/ConsoleLayout'; | ||
import OrganizationSideBar from 'src/components/layouts/OrganizationSideBar'; | ||
import { getOrganizationPageServerSideProps, OrganizationServerSideProps } from 'src/ssr/organization'; | ||
import TableListView from '../../../../src/components/common/TableListView'; | ||
import RefreshButton from '../../../../src/components/buttons/RefreshButton'; | ||
import { flexRowSpaceBetweenStyle } from '../../../../src/styles/box'; | ||
import LiveChat from '../../../../src/components/external/livechat'; | ||
import LiveTestingCloudDeviceList from '../../../../src/components/cloud/LiveTestingCloudDeviceList'; | ||
|
||
const OrganizationLiveTestingPage: NextPageWithLayout<OrganizationServerSideProps> = ({ user, organization }) => { | ||
const hasUsingDevices = true; | ||
|
||
return ( | ||
<> | ||
<Head> | ||
<title>Live Testing - {organization.name} | Dogu</title> | ||
</Head> | ||
{hasUsingDevices && ( | ||
<> | ||
<TableListView | ||
top={ | ||
<FlexBox> | ||
<div></div> | ||
<RefreshButton /> | ||
</FlexBox> | ||
} | ||
table={<div>Using...</div>} | ||
/> | ||
<Divider /> | ||
</> | ||
)} | ||
<TableListView | ||
top={ | ||
<FlexBox> | ||
<div></div> | ||
<RefreshButton /> | ||
</FlexBox> | ||
} | ||
table={<LiveTestingCloudDeviceList />} | ||
/> | ||
<LiveChat | ||
user={{ | ||
name: user.name, | ||
email: user.email, | ||
organizationId: organization.organizationId, | ||
}} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
OrganizationLiveTestingPage.getLayout = (page) => { | ||
return ( | ||
<ConsoleLayout {...page.props} sidebar={<OrganizationSideBar />} titleI18nKey="organization:liveTestingPageTitle"> | ||
{page} | ||
</ConsoleLayout> | ||
); | ||
}; | ||
|
||
export const getServerSideProps = getOrganizationPageServerSideProps; | ||
|
||
export default OrganizationLiveTestingPage; | ||
|
||
const FlexBox = styled.div` | ||
${flexRowSpaceBetweenStyle} | ||
`; |
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,22 @@ | ||
import { DeviceBase } from '@dogu-private/console'; | ||
import { GetServerSidePropsContext } from 'next'; | ||
|
||
import api from '.'; | ||
import { EmptyTokenError, getServersideCookies } from '../utils/auth'; | ||
|
||
export const getCloudDeviceByIdInServerSide = async (context: GetServerSidePropsContext, deviceId: string) => { | ||
const { authToken } = getServersideCookies(context.req.cookies); | ||
|
||
if (authToken) { | ||
try { | ||
const response = await api.get<DeviceBase>(`/cloud-devices/${deviceId}`, { | ||
headers: { Authorization: `Bearer ${authToken}` }, | ||
}); | ||
return response.data; | ||
} catch (e) { | ||
return null; | ||
} | ||
} | ||
|
||
throw new EmptyTokenError(); | ||
}; |
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.