forked from KelvinTegelaar/CIPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'KelvinTegelaar:main' into master
- Loading branch information
Showing
60 changed files
with
5,475 additions
and
2,468 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1 @@ | ||
5.6.1 | ||
5.7.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
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,49 @@ | ||
import React from 'react' | ||
import { | ||
CAccordionBody, | ||
CAccordionHeader, | ||
CAccordionItem, | ||
CCard, | ||
CCardBody, | ||
CCardFooter, | ||
CCardHeader, | ||
CCardTitle, | ||
} from '@coreui/react' | ||
import Skeleton from 'react-loading-skeleton' | ||
import PropTypes from 'prop-types' | ||
|
||
export default function CippAccordionItem({ | ||
title, | ||
titleType = 'normal', | ||
CardButton, | ||
children, | ||
isFetching, | ||
}) { | ||
return ( | ||
<CAccordionItem> | ||
<CAccordionHeader>{title}</CAccordionHeader> | ||
<CAccordionBody> | ||
<CCard> | ||
<CCardHeader> | ||
<CCardTitle> | ||
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title} | ||
</CCardTitle> | ||
</CCardHeader> | ||
<CCardBody className="my-3"> | ||
{isFetching && <Skeleton />} | ||
{children} | ||
</CCardBody> | ||
<CCardFooter>{CardButton}</CCardFooter> | ||
</CCard> | ||
</CAccordionBody> | ||
</CAccordionItem> | ||
) | ||
} | ||
|
||
CippAccordionItem.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
titleType: PropTypes.string, | ||
CardButton: PropTypes.element.isRequired, | ||
children: PropTypes.element.isRequired, | ||
isFetching: PropTypes.bool.isRequired, | ||
} |
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,86 @@ | ||
import React from 'react' | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { CButton, CCard, CCardBody, CCardHeader, CCardTitle } from '@coreui/react' | ||
import { CChart } from '@coreui/react-chartjs' | ||
import { getStyle } from '@coreui/utils' | ||
import PropTypes from 'prop-types' | ||
|
||
export default function CippChartCard({ | ||
title, | ||
titleType = 'normal', | ||
ChartData, | ||
ChartLabels, | ||
ChartType = 'pie', | ||
LegendLocation = 'bottom', | ||
isFetching, | ||
refreshFunction, | ||
}) { | ||
return ( | ||
<CCard className="h-100 mb-3"> | ||
<CCardHeader> | ||
<CCardTitle> | ||
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title} | ||
{refreshFunction ? ( | ||
<CButton | ||
className="position-absolute top-0 end-0 mt-2 me-2" | ||
variant="ghost" | ||
onClick={refreshFunction} | ||
disabled={isFetching} | ||
> | ||
<FontAwesomeIcon icon="sync" spin={isFetching} /> | ||
</CButton> | ||
) : ( | ||
<CButton className="position-absolute top-0 end-0 mt-2 me-2" variant="ghost" disabled> | ||
<FontAwesomeIcon icon="sync" spin={isFetching} /> | ||
</CButton> | ||
)} | ||
</CCardTitle> | ||
</CCardHeader> | ||
<CCardBody> | ||
{ChartData && ( | ||
<CChart | ||
type={ChartType} | ||
data={{ | ||
labels: ChartLabels, | ||
datasets: [ | ||
{ | ||
label: title, | ||
backgroundColor: [ | ||
getStyle('--cyberdrain-warning'), | ||
getStyle('--cyberdrain-info'), | ||
getStyle('--cyberdrain-success'), | ||
getStyle('--cyberdrain-danger'), | ||
getStyle('--cyberdrain-primary'), | ||
getStyle('--cyberdrain-secondary'), | ||
], | ||
data: ChartData, | ||
borderWidth: 3, | ||
}, | ||
], | ||
}} | ||
options={{ | ||
plugins: { | ||
legend: { | ||
position: LegendLocation, | ||
labels: { | ||
color: getStyle('--cui-body-color'), | ||
}, | ||
}, | ||
}, | ||
}} | ||
/> | ||
)} | ||
</CCardBody> | ||
</CCard> | ||
) | ||
} | ||
CippChartCard.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
titleType: PropTypes.oneOf(['normal', 'big']), | ||
ChartData: PropTypes.array.isRequired, | ||
ChartLabels: PropTypes.array.isRequired, | ||
ChartType: PropTypes.oneOf(['pie', 'bar', 'line']), | ||
LegendLocation: PropTypes.oneOf(['top', 'bottom', 'left', 'right']), | ||
isFetching: PropTypes.bool, | ||
refreshFunction: PropTypes.func, | ||
} |
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,46 @@ | ||
import React from 'react' | ||
import { CCard, CCardBody, CCardFooter, CCardHeader, CCardTitle, CCol, CRow } from '@coreui/react' | ||
import Skeleton from 'react-loading-skeleton' | ||
import { CircularProgressbar } from 'react-circular-progressbar' | ||
import 'react-circular-progressbar/dist/styles.css' | ||
|
||
export default function CippPrettyCard({ | ||
title, | ||
titleType = 'normal', | ||
percentage, | ||
topLabel, | ||
smallLabel, | ||
ringcolor = '#f89226', | ||
isFetching, | ||
}) { | ||
return ( | ||
<CCard className="h-100 mb-3"> | ||
<CCardHeader> | ||
<CCardTitle> | ||
{titleType === 'big' ? <h3 className="underline mb-3">{title}</h3> : title} | ||
</CCardTitle> | ||
</CCardHeader> | ||
<CCardBody> | ||
{isFetching && <Skeleton />} | ||
{!isFetching && ( | ||
<CRow> | ||
<CCol> | ||
<div style={{ width: '50%', height: '50%' }}> | ||
<CircularProgressbar | ||
styles={{ path: { stroke: ringcolor }, text: { fill: ringcolor } }} | ||
strokeWidth={3} | ||
value={percentage} | ||
text={`${percentage}%`} | ||
/> | ||
</div> | ||
</CCol> | ||
<CCol className="m-2"> | ||
<h4>{topLabel}</h4> | ||
<small className="text-medium-emphasis">{smallLabel}</small> | ||
</CCol> | ||
</CRow> | ||
)} | ||
</CCardBody> | ||
</CCard> | ||
) | ||
} |
Oops, something went wrong.