-
Notifications
You must be signed in to change notification settings - Fork 29
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 #34 from weaveworks/WGE32-style-apps
WGE32 Style Apps to look more like what we have in WE
- Loading branch information
Showing
15 changed files
with
147 additions
and
75 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,33 @@ | ||
import React, { FC } from 'react'; | ||
import { PageTemplate } from '../Layout/PageTemplate'; | ||
import { SectionHeader } from '../Layout/SectionHeader'; | ||
import { WGContentWrapper } from '../Layout/ContentWrapper'; | ||
import { ApplicationDetail, useApplications } from '@weaveworks/weave-gitops'; | ||
|
||
const WGApplicationDetail: FC = () => { | ||
const { applications } = useApplications(); | ||
const applicationsCount = applications.length; | ||
|
||
const queryParams = new URLSearchParams(window.location.search); | ||
const name = queryParams.get('name'); | ||
|
||
return ( | ||
<PageTemplate documentTitle="WeGO · Application Detail"> | ||
<SectionHeader | ||
path={[ | ||
{ | ||
label: 'Applications', | ||
url: '/applications', | ||
count: applicationsCount, | ||
}, | ||
{ label: `${name}` }, | ||
]} | ||
/> | ||
<WGContentWrapper> | ||
<ApplicationDetail name={name || ''} /> | ||
</WGContentWrapper> | ||
</PageTemplate> | ||
); | ||
}; | ||
|
||
export default WGApplicationDetail; |
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,20 +1,29 @@ | ||
import React, { FC } from 'react'; | ||
import { PageTemplate } from '../Layout/PageTemplate'; | ||
import useClusters from '../../contexts/Clusters'; | ||
import { SectionHeader } from '../Layout/SectionHeader'; | ||
import { ContentWrapper } from '../Layout/ContentWrapper'; | ||
import { WGContentWrapper } from '../Layout/ContentWrapper'; | ||
import { Applications, useApplications } from '@weaveworks/weave-gitops'; | ||
|
||
const TemplatesDashboard: FC = ({ children }) => { | ||
const clustersCount = useClusters().count; | ||
const WGApplicationsDashboard: FC = () => { | ||
const { applications } = useApplications(); | ||
const applicationsCount = applications.length; | ||
|
||
return ( | ||
<PageTemplate documentTitle="WeGO · Templates"> | ||
<PageTemplate documentTitle="WeGO · Applications"> | ||
<SectionHeader | ||
path={[{ label: 'Clusters', url: '/clusters', count: clustersCount }]} | ||
path={[ | ||
{ | ||
label: 'Applications', | ||
url: '/applications', | ||
count: applicationsCount, | ||
}, | ||
]} | ||
/> | ||
<ContentWrapper>{children}</ContentWrapper> | ||
<WGContentWrapper> | ||
<Applications /> | ||
</WGContentWrapper> | ||
</PageTemplate> | ||
); | ||
}; | ||
|
||
export default TemplatesDashboard; | ||
export default WGApplicationsDashboard; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ const large = spacing('large'); | |
|
||
export const contentCss = css` | ||
margin: ${medium} ${small} 0 ${small}; | ||
padding: ${large} ${medium} ${medium} ${medium}; | ||
padding: ${large} ${medium} ${medium} ${large}; | ||
background-color: white; | ||
border-radius: ${spacing('xs')}; | ||
`; | ||
|
@@ -27,9 +27,13 @@ export const Content = styled.div` | |
${contentCss} | ||
`; | ||
|
||
export const WGContent = styled.div` | ||
${contentCss} | ||
padding: 0 ${medium} ${medium} 0; | ||
`; | ||
|
||
const HelpLinkWrapper = styled.div` | ||
margin: 0 ${small}; | ||
padding: ${small} ${small}; | ||
padding-top: ${medium}; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-end; | ||
|
@@ -42,17 +46,33 @@ const HelpLinkWrapper = styled.div` | |
`; | ||
|
||
export const ContentWrapper: FC = ({ children }) => { | ||
const versions = useVersions(); | ||
const { versions } = useVersions(); | ||
return ( | ||
<> | ||
<Content>{children}</Content> | ||
<Content> | ||
{children} | ||
<HelpLinkWrapper> | ||
<div> | ||
Need help? Contact us at{' '} | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</div> | ||
<div>Version {versions.versions?.capiServer}</div> | ||
<div>Version {versions?.capiServer}</div> | ||
</HelpLinkWrapper> | ||
</Content> | ||
); | ||
}; | ||
|
||
export const WGContentWrapper: FC = ({ children }) => { | ||
const { versions } = useVersions(); | ||
return ( | ||
<WGContent> | ||
{children} | ||
<HelpLinkWrapper> | ||
<div> | ||
Need help? Contact us at | ||
<a href="mailto:[email protected]">[email protected]</a> | ||
</div> | ||
<div>Version {versions?.capiServer}</div> | ||
</HelpLinkWrapper> | ||
</> | ||
</WGContent> | ||
); | ||
}; |
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,18 +1,16 @@ | ||
import React, { FC } from 'react'; | ||
import Skeleton from '@material-ui/lab/Skeleton'; | ||
import styled from 'styled-components'; | ||
import theme from 'weaveworks-ui-components/lib/theme'; | ||
import { LoadingPage } from '@weaveworks/weave-gitops'; | ||
|
||
const LoaderWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
padding: ${theme.spacing.medium} 0; | ||
`; | ||
|
||
export const Loader: FC = () => { | ||
return ( | ||
<LoaderWrapper> | ||
<Skeleton variant="circle" width={40} height={40} /> | ||
<LoadingPage /> | ||
</LoaderWrapper> | ||
); | ||
}; |
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.