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 pull request #56 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
- Loading branch information
Showing
15 changed files
with
197 additions
and
29 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 |
---|---|---|
@@ -1 +1 @@ | ||
5.9.3 | ||
6.0.2 |
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,24 @@ | ||
import PropTypes from 'prop-types' | ||
|
||
export function CellBytes({ cell }) { | ||
return (cell / 1024 ** 3).toFixed(2) | ||
} | ||
|
||
CellBytes.propTypes = { | ||
propName: PropTypes.string, | ||
cell: PropTypes.object, | ||
} | ||
|
||
export function CellBytesToPercentage({ row, value, dividedBy }) { | ||
return Math.round((row[value] / row[dividedBy]) * 100 * 10) / 10 | ||
} | ||
|
||
CellBytesToPercentage.propTypes = { | ||
propName: PropTypes.string, | ||
cell: PropTypes.object, | ||
} | ||
|
||
export const cellBytesFormatter = () => (row, index, column, id) => { | ||
const cell = column.selector(row) | ||
return CellBytes({ cell }) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import React, { useState } from 'react' | ||
import { CCol, CRow } from '@coreui/react' | ||
import { useSelector } from 'react-redux' | ||
|
||
import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app' | ||
|
||
import { CippPage, CippPageList } from 'src/components/layout' | ||
import { CellTip, cellGenericFormatter } from 'src/components/tables/CellGenericFormat' | ||
import 'react-datepicker/dist/react-datepicker.css' | ||
import { CellBadge, cellBadgeFormatter, cellDateFormatter } from 'src/components/tables' | ||
import { TitleButton } from 'src/components/buttons' | ||
|
||
const ExtensionSync = () => { | ||
const [ExecuteGetRequest, getResults] = useLazyGenericGetRequestQuery() | ||
const tenantDomain = useSelector((state) => state.app.currentTenant.defaultDomainName) | ||
const [refreshState, setRefreshState] = useState(false) | ||
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() | ||
|
||
const columns = [ | ||
{ | ||
name: 'Tenant', | ||
selector: (row) => row['Tenant'], | ||
sortable: true, | ||
cell: cellGenericFormatter(), | ||
exportSelector: 'Tenants', | ||
}, | ||
{ | ||
name: 'Sync Type', | ||
selector: (row) => row['SyncType'], | ||
sortable: true, | ||
cell: cellBadgeFormatter({ color: 'info' }), | ||
exportSelector: 'SyncType', | ||
}, | ||
{ | ||
name: 'Task', | ||
selector: (row) => row['Name'], | ||
sortable: true, | ||
cell: cellGenericFormatter(), | ||
exportSelector: 'Name', | ||
}, | ||
{ | ||
name: 'Scheduled Time', | ||
selector: (row) => row['ScheduledTime'], | ||
sortable: true, | ||
cell: cellDateFormatter({ format: 'short' }), | ||
exportSelector: 'ScheduledTime', | ||
}, | ||
{ | ||
name: 'Last Run', | ||
selector: (row) => row['ExecutedTime'], | ||
sortable: true, | ||
cell: cellDateFormatter({ format: 'short' }), | ||
exportSelector: 'ExecutedTime', | ||
}, | ||
{ | ||
name: 'Repeats every', | ||
selector: (row) => row['RepeatsEvery'], | ||
sortable: true, | ||
cell: (row) => CellTip(row['RepeatsEvery']), | ||
exportSelector: 'RepeatsEvery', | ||
}, | ||
{ | ||
name: 'Results', | ||
selector: (row) => row['Results'], | ||
sortable: true, | ||
cell: cellGenericFormatter(), | ||
exportSelector: 'Results', | ||
}, | ||
] | ||
|
||
return ( | ||
<CippPage title={`Extension Sync`} tenantSelector={false}> | ||
<> | ||
<CRow> | ||
<CCol> | ||
<CippPageList | ||
key={refreshState} | ||
capabilities={{ | ||
allTenants: true, | ||
helpContext: 'https://google.com', | ||
}} | ||
title="Extension Sync" | ||
tenantSelector={false} | ||
datatable={{ | ||
columns, | ||
reportName: `Extension Sync Report`, | ||
path: `/api/ListExtensionSync`, | ||
}} | ||
/> | ||
</CCol> | ||
</CRow> | ||
</> | ||
</CippPage> | ||
) | ||
} | ||
|
||
export default ExtensionSync |
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
Oops, something went wrong.