-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rob Ellison
committed
May 25, 2023
1 parent
3720d0a
commit b156a09
Showing
13 changed files
with
1,426 additions
and
269 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ yarn-error.log* | |
|
||
# Sentry Auth Token | ||
.sentryclirc | ||
components/dashboard-demo/ |
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,95 @@ | ||
|
||
|
||
// @mui material components | ||
import Card from "@mui/material/Card"; | ||
import Grid from "@mui/material/Grid"; | ||
import Icon from "@mui/material/Icon"; | ||
|
||
import Box from "@mui/material/Box"; | ||
import Typography from "@mui/material/Typography"; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
|
||
export function MiniStatisticsCard({ bgColor, color = 'primary', title, count, percentage = null, icon, direction = 'left' }) { | ||
// const [controller] = useArgonController(); | ||
// const { darkMode } = controller; | ||
const darkMode = false; | ||
const iconcolor = icon.color + '.main' | ||
|
||
return ( | ||
<Box | ||
sx={{ | ||
// bgcolor: 'background.paper', | ||
borderColor: 'error', //icon.color, | ||
boxShadow: 0, | ||
border: 1, | ||
borderRadius: 2, | ||
p: 2, | ||
// minWidth: 300, | ||
}} | ||
> | ||
<Grid container alignItems="center"> | ||
{direction === "left" ? ( | ||
<Grid item> | ||
<Box | ||
color={iconcolor} | ||
width="3rem" | ||
height="3rem" | ||
borderRadius="section" | ||
display="flex" | ||
justifyContent="center" | ||
alignItems="center" | ||
> | ||
{/* <Icon fontSize="small" color="inherit"> */} | ||
<FontAwesomeIcon icon={['fas', 'fa-' + icon.icon]} style={{ width: "40px", height: "40px" }} /> | ||
{/* </Icon> */} | ||
</Box> | ||
</Grid> | ||
) : null} | ||
<Grid item xs={8}> | ||
<Box ml={direction === "left" ? 2 : 0} lineHeight={1}> | ||
|
||
|
||
<Box sx={{ fontSize: 16, color: 'text.secondary' }}>{title}</Box> | ||
<Box sx={{ color: 'text.primary', fontSize: 34, fontWeight: 'medium' }}> | ||
{count} | ||
</Box> | ||
{percentage.value && <Box | ||
sx={{ | ||
color: iconcolor, | ||
display: 'inline', | ||
fontWeight: 'bold', | ||
mx: 0.5, | ||
fontSize: 14, | ||
}} | ||
> | ||
{percentage?.value} | ||
</Box>} | ||
<Box sx={{ color: iconcolor, display: 'inline', fontSize: 14 }}> | ||
{percentage?.text} | ||
</Box> | ||
</Box> | ||
</Grid> | ||
{direction === "right" ? ( | ||
<Grid item xs={4}> | ||
<Box | ||
color={color} | ||
width="3rem" | ||
height="3rem" | ||
marginLeft="auto" | ||
borderRadius="section" | ||
display="flex" | ||
justifyContent="center" | ||
alignItems="center" | ||
> | ||
{/* <Icon fontSize="small" color="inherit"> */} | ||
<FontAwesomeIcon icon={['fas', 'fa-' + icon.icon]} style={{ color: icon.color, width: "40px", height: "40px" }} /> | ||
{/* </Icon> */} | ||
</Box> | ||
</Grid> | ||
) : null} | ||
</Grid> | ||
</Box> | ||
); | ||
} | ||
|
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 @@ | ||
export { MiniStatisticsCard } from "./Cards/Stats"; |
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,84 @@ | ||
const https = require('https'); | ||
const fs = require('fs'); | ||
|
||
// Fetch the list of Azure services | ||
function fetchAzureServices() { | ||
return new Promise((resolve, reject) => { | ||
const options = { | ||
hostname: 'management.azure.com', | ||
path: '/providers?api-version=2020-01-01', | ||
method: 'GET' | ||
}; | ||
|
||
const req = https.request(options, res => { | ||
let data = ''; | ||
|
||
res.on('data', chunk => { | ||
data += chunk; | ||
}); | ||
|
||
res.on('end', () => { | ||
if (res.statusCode === 200) { | ||
const result = JSON.parse(data); | ||
|
||
if (result && result.value) { | ||
const azureServices = result.value.map(provider => { | ||
return provider.resourceTypes.map(resourceType => { | ||
return { | ||
name: resourceType.displayName, | ||
identifier: resourceType.resourceType, | ||
description: resourceType.description || '', | ||
}; | ||
}); | ||
}).flat(); | ||
|
||
resolve(azureServices); | ||
} else { | ||
reject(new Error('Invalid response format')); | ||
} | ||
} else { | ||
reject(new Error(`Failed to fetch Azure services. Status code: ${res.statusCode}`)); | ||
} | ||
}); | ||
}); | ||
|
||
req.on('error', error => { | ||
reject(error); | ||
}); | ||
|
||
req.end(); | ||
}); | ||
} | ||
|
||
// Create the file structure | ||
async function createFileStructure() { | ||
const azureServices = await fetchAzureServices(); | ||
|
||
azureServices.forEach(service => { | ||
const folderName = service.name.toLowerCase().replace(/ /g, '_'); | ||
const filePath = `${folderName}/index.mdx`; | ||
|
||
// Create the folder | ||
fs.mkdirSync(folderName, { recursive: true }); | ||
|
||
// Create the index.mdx file | ||
const frontmatter = `--- | ||
title: ${service.name} | ||
identifier: ${service.identifier} | ||
approved: false | ||
--- | ||
${service.description}`; | ||
|
||
fs.writeFileSync(filePath, frontmatter); | ||
|
||
console.log(`Created ${filePath}`); | ||
}); | ||
|
||
console.log('File structure generation completed.'); | ||
} | ||
|
||
// Run the script | ||
createFileStructure().catch(error => { | ||
console.error('An error occurred:', error); | ||
}); |
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,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
Oops, something went wrong.