From 4458b8587871587ae671cd9cbcc88758f148ec5a Mon Sep 17 00:00:00 2001 From: Rob Ellison Date: Thu, 27 Jul 2023 11:14:48 +0000 Subject: [PATCH] feat: revert etherpad landing page --- pages/etherpad/index.js | 371 +++++++++++++++++++++++++++++----------- 1 file changed, 275 insertions(+), 96 deletions(-) diff --git a/pages/etherpad/index.js b/pages/etherpad/index.js index a0821860..df9d8f8b 100644 --- a/pages/etherpad/index.js +++ b/pages/etherpad/index.js @@ -1,34 +1,26 @@ -import * as React from "react"; -import { useState, useEffect } from "react"; -import AppBar from "@mui/material/AppBar"; -import Box from "@mui/material/Box"; -import Button from "@mui/material/Button"; -import SlideshowIcon from "@mui/icons-material/Slideshow"; -import Card from "@mui/material/Card"; -import CardActions from "@mui/material/CardActions"; -import CardContent from "@mui/material/CardContent"; -import CssBaseline from "@mui/material/CssBaseline"; -import Grid from "@mui/material/Grid"; -import Stack from "@mui/material/Stack"; -import Toolbar from "@mui/material/Toolbar"; -import Typography from "@mui/material/Typography"; -import Container from "@mui/material/Container"; -import Link from "@mui/material/Link"; -import { ThemeProvider } from "@mui/material/styles"; -import { theme } from "../../constants/theme"; - -function Copyright() { - return ( - - {"Copyright © "} - - airwalkreply.com - {" "} - {new Date().getFullYear()} - {"."} - - ); -} +import * as React from 'react'; +import { useState, useEffect, } from 'react'; +import { TopBar } from '@/components/dashboard'; +import Box from '@mui/material/Box'; +import Button from '@mui/material/Button'; +import SlideshowIcon from '@mui/icons-material/Slideshow'; +import Card from '@mui/material/Card'; +import CardActions from '@mui/material/CardActions'; +import CardContent from '@mui/material/CardContent'; +import CssBaseline from '@mui/material/CssBaseline'; +import Grid from '@mui/material/Grid'; +import Stack from '@mui/material/Stack'; +import Toolbar from '@mui/material/Toolbar'; +import Typography from '@mui/material/Typography'; +import Container from '@mui/material/Container'; +import { Skeleton, FormControl, Link, Dialog, DialogTitle, DialogContent, ButtonGroup, DialogContentText, Select, MenuItem, DialogActions, TextField, Table, TableBody, TableCell, TableContainer, TableHead, TableRow } from '@mui/material'; +import { ThemeProvider } from '@mui/material/styles'; +import { baseTheme } from '../../constants/baseTheme'; +import * as matter from 'gray-matter'; +import { v4 as uuidv4 } from 'uuid'; +import { dirname, basename } from 'path'; + +import { NewPadDialog } from '@/components/etherpad'; function Pad({ endpoint, padID, title }) { return ( @@ -45,7 +37,7 @@ function Pad({ endpoint, padID, title }) { /> */} - Etherpad + {title} @@ -54,10 +46,10 @@ function Pad({ endpoint, padID, title }) { {/* */} {/* */} - - + + + Import Pad + + + Enter the Pad ID to import: + + setPadId(event.target.value)} /> + + + + + Field + Value + + + + {padMetadata && padMetadata.map((row) => ( + + {row.key} + {row.value} + + ))} + +
+
+
+ + + + +
+ - + {/* End hero unit */} + {airviewPads ? ( + ) : ( + <> +

loading........

+ + + )} - - {padList || - ["Etherpad Error"].map((pad, i) => ( - - ))} -
- {/* Footer */} - - - - {/* End footer */} + ); } + function PadView(pads) { const [environment, setEnvironment] = useState(""); useEffect(() => { - const fetchData = async () => { + const fetchData = async () =>{ const resp = await fetch("/api/environment"); const data = await resp.json(); - console.log(data); - setEnvironment(data); - }; - fetchData(); - }, []); + console.log(data) + setEnvironment(data) + } + fetchData() + },[]); // console.log('PadView:pads: ', pads) const collections = Object.entries(pads.pads).map(([key, value]) => { return { - [key]: Object.values(value), + [key]: Object.values(value) }; }); @@ -213,12 +395,9 @@ function PadView(pads) {

{capitalizeFirstLetter(category)}

+ {elements.map((element, index) => ( - + ))}
@@ -229,4 +408,4 @@ function PadView(pads) { const capitalizeFirstLetter = (string) => { return string.charAt(0).toUpperCase() + string.slice(1); -}; +}; \ No newline at end of file