diff --git a/src/app/components/common/Spinner.jsx b/src/app/components/common/Spinner.jsx index cee974e5..550ee695 100644 --- a/src/app/components/common/Spinner.jsx +++ b/src/app/components/common/Spinner.jsx @@ -1,7 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import CircularProgress from '@mui/material/CircularProgress'; -import DatasetStyle from '../../../styles/Dataset'; +import DatasetStyle from '@/styles/Dataset'; + // const styles = theme => ({ // progress: { diff --git a/src/app/dataset/automate-dataset/page1.js b/src/app/dataset/automate-dataset/page1.js new file mode 100644 index 00000000..8f974adb --- /dev/null +++ b/src/app/dataset/automate-dataset/page1.js @@ -0,0 +1,37 @@ +import { Tabs,Tab ,Box} from "@mui/material"; +import { Card, FormControl, Grid, MenuItem, Select, ThemeProvider, InputLabel, Typography,Switch } from "@mui/material"; +import React, { useEffect, useState } from "react"; +import themeDefault from "../../../theme/theme"; +import DatasetStyle from "../../../styles/Dataset"; + +import InterAutomateDataset from "./InterAutomateDataset"; +import IntraAutomateDataset from "./IntraAutomateDataset"; + +const AutomateDatasets = () => { + const classes = DatasetStyle(); + + const [selectedTab, setSelectedTab] = useState(0); + + const handleTabChange = (event, newValue) => { + setSelectedTab(newValue); + }; + + + + return ( + + + + + + + {selectedTab === 0 && } + {selectedTab === 1 && } + + + + + ); +}; + +export default AutomateDatasets; \ No newline at end of file diff --git a/src/app/dataset/create-dataset/page1.js b/src/app/dataset/create-dataset/page1.js new file mode 100644 index 00000000..3c1c7e3c --- /dev/null +++ b/src/app/dataset/create-dataset/page1.js @@ -0,0 +1,311 @@ +"use client"; +import { + Box, + Card, + Grid, + Tab, + Tabs, + Typography, +} from "@mui/material"; +import React, { useEffect, useState } from "react"; +import { useParams } from "react-router-dom"; +import Button from "@/app/components/common/Button"; +import OutlinedTextField from "@/app/components/common/OutlinedTextField"; +import Spinner from "@/app/components/common/Spinner"; +import CustomizedSnackbars from "@/app/components/common/Snackbar"; +import DatasetStyle from "@/styles/Dataset"; +// import { useDispatch, useSelector } from "react-redux"; +// import APITransport from "../../../../redux/actions/apitransport/apitransport"; +// import CreateNewDatasetInstanceAPI from "../../../../redux/actions/api/Dataset/CreateNewDatasetInstance"; +// import GetDatasetTypeAPI from "../../../../redux/actions/api/Dataset/GetDatasetType" +import MenuItems from "@/app/components/common/MenuItems" +import { useRouter } from "next/navigation"; + +const CollectionProject = (props) => { + const { id } = useParams(); + const router = useRouter(); + const classes = DatasetStyle(); + const dispatch = useDispatch(); + const [instance_Name, setInstance_Name] = useState("") + const [parent_Instance_Id, setParent_Instance_Id] = useState(null) + const [instance_Description, setInstance_Description] = useState("") + const [organisation_Id, setOrganisation_Id] = useState("") + const [users, setUsers] = useState("") + const [datasettype, setDatasettype] = useState(""); + const [type, setType] = useState([]); + const [loading, setLoading] = useState(false); + const [snackbarState, setSnackbarState] = useState({ open: false, message: "", variant: "" }); + const [errors, setErrors] = useState({}); + + + const loggedInUserData = useSelector( + (state) => state.fetchLoggedInUserData.data + ); + + useEffect(() => { + setUsers([loggedInUserData.id]) + },) + + const handleCreate = () => { + setLoading(true); + setErrors({}); + const CreateDatasetInstance = { + instance_name: instance_Name, + parent_instance_id: parent_Instance_Id, + instance_description: instance_Description, + dataset_type: datasettype, + organisation_id: organisation_Id, + users: users, + } + const apiObj = new CreateNewDatasetInstanceAPI(CreateDatasetInstance); + fetch(apiObj.apiEndPoint(), { + method: "POST", + body: JSON.stringify(apiObj.getBody()), + headers: apiObj.getHeaders().headers, + }).then(async (res) => { + if (!res.ok) throw await res.json(); + else return await res.json(); + }).then((res) => { + setLoading(false); + router.push(`/datasets/${res.instance_id}`); + }).catch((err) => { + setErrors(err); + setSnackbarState({ open: true, message: "Failed to create dataset instance", variant: "error" }); + setLoading(false); + }); + } + + const datasetType = useSelector(state => state.GetDatasetType.data); + + const getProjectDetails = () => { + const projectObj = new GetDatasetTypeAPI(id); + dispatch(APITransport(projectObj)); + } + + useEffect(() => { + getProjectDetails(); + + }, []); + + useEffect(() => { + if (datasetType && datasetType.length > 0) { + let temp = []; + datasetType.forEach((element) => { + temp.push({ + + name: element, + value: element, + + }); + }); + setType(temp); + } + }, [datasetType]); + + const renderSnackBar = () => { + return ( + setSnackbarState({ open: false, message: "", variant: "" })} + anchorOrigin={{ vertical: "top", horizontal: "right" }} + variant={snackbarState.variant} + message={snackbarState.message} + /> + ); + }; + + console.log(loggedInUserData, "loggedInUserData") + return ( + <> + {/*
*/} + {/* + */} + + + {loading && } + + + + + + Create New Dataset Instance + + + + + Instance_Name *: + + + + setInstance_Name(e.target.value)} + required + helperText={errors.instance_name ? errors.instance_name : ""} + error={errors.instance_name ? true : false} + /> + + + + Parent_Instance_Id: + + + + setParent_Instance_Id(e.target.value)} + helperText={errors.parent_instance_id ? errors.parent_instance_id : ""} + error={errors.parent_instance_id ? true : false} + /> + + + + Instance_Description: + + + + setInstance_Description(e.target.value)} + helperText={errors.instance_description ? errors.instance_description : ""} + error={errors.instance_description ? true : false} + /> + + + + Dataset_Type *: + + + + setDatasettype(value)} + value={datasettype} + helperText={errors.dataset_type ? errors.dataset_type : ""} + error={errors.dataset_type ? true : false} + /> + + + + Organisation_Id *: + + + + setOrganisation_Id(e.target.value)} + helperText={errors.organisation_id ? errors.organisation_id : ""} + error={errors.organisation_id ? true : false} + /> + + + + User *: + + + + setUsers(e.target.value)} + helperText={errors.users ? errors.users : ""} + error={errors.users ? true : false} + /> + + + + @@ -105,14 +105,14 @@ export default function Home() {
Rate Model Performance
-
How does it work? It's simple yet extraordinary! Our chatbot draws responses from three distinct models, each with its unique capabilities. These models are meticulously crafted and fine-tuned to provide you with the most informative, engaging, and relevant conversations.
+
How does it work? It's simple yet extraordinary! Our chatbot draws responses from three distinct models, each with its unique capabilities. These models are meticulously crafted and fine-tuned to provide you with the most informative, engaging, and relevant conversations.
What is Anudesh?
-
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
ANUDESH - Developed at AI4Bharat Lab
diff --git a/src/app/organizations/AddWorkspaceDialog.js b/src/app/organizations/AddWorkspaceDialog.js new file mode 100644 index 00000000..ea3bd72b --- /dev/null +++ b/src/app/organizations/AddWorkspaceDialog.js @@ -0,0 +1,92 @@ +import { Button, CircularProgress, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, FormControlLabel, Switch, TextField } from '@mui/material' +import React, { useState } from 'react' +// import { useDispatch } from 'react-redux' +// import GetWorkspacesAPI from '../../../../redux/actions/api/Dashboard/GetWorkspaces' +// import CreateWorkspaceAPI from '../../../../redux/actions/api/WorkspaceDetails/CreateWorkspace' +// import APITransport from '../../../../redux/actions/apitransport/apitransport' +import CustomButton from '../components/common/Button' + +const AddWorkspaceDialog = ({ isOpen, dialogCloseHandler, orgId = 0 }) => { + const [workspaceName, setWorkspaceName] = useState('') + const [loading, setLoading] = useState(false); + // const dispatch = useDispatch(); + const [publicanalytics, setpublicanalytics] = useState(true) + + const handlepublicanalytics = async () => { + setLoading(true); + setpublicanalytics((publicanalytics) => !publicanalytics) + }; + + const addBtnClickHandler = async (event) => { + setWorkspaceName(''); + dialogCloseHandler(); + // if (!workspaceName) return; + + // setLoading(true); + // const createWorkspaceObj = new CreateWorkspaceAPI( + // orgId, + // workspaceName, + // publicanalytics + // ); + // const createWorkspaceRes = await fetch(createWorkspaceObj.apiEndPoint(), { + // method: "POST", + // body: JSON.stringify(createWorkspaceObj.getBody()), + // headers: createWorkspaceObj.getHeaders().headers, + // }); + + // const createWorkspaceRespData = await createWorkspaceRes.json(); + + // if (createWorkspaceRes.ok) { + // const workspaceObj = new GetWorkspacesAPI(1); + // dispatch(APITransport(workspaceObj)); + // return createWorkspaceRespData; + // } + setLoading(false) + } + + const handleUserDialogClose = () => { + setWorkspaceName(''); + dialogCloseHandler(); + } + + const handleTextField = (e) => { + setWorkspaceName(e.target.value) + } + + return ( + + Enter workspace details + + + } + labelPlacement="start" + label="Public Analytics" + checked={publicanalytics} + onChange={handlepublicanalytics} + /> + + + + + + ) + } + onClick={addBtnClickHandler} + size="small" + label="OK" + disabled={loading || !workspaceName} + /> + + + ) +} + +export default AddWorkspaceDialog \ No newline at end of file diff --git a/src/app/organizations/page.js b/src/app/organizations/page.js index 0833dfd4..2613eec3 100644 --- a/src/app/organizations/page.js +++ b/src/app/organizations/page.js @@ -1,17 +1,231 @@ 'use client'; -import DetailsViewPage from "../workspace/DetailsViewPage"; -import componentType from "../../config/PageType"; -// import { useSelector } from "react-redux"; - -const MyOrganization = () => { - // const organizationDetails = useSelector(state=>state.fetchLoggedInUserData.data.organization); - return ( - - ) +import { Button, Grid, Typography, Card, Tab, Tabs, Box} from "@mui/material" +import { useState } from 'react' +import DatasetStyle from "@/styles/Dataset"; +import MUIDataTable from "mui-datatables"; +import Link from "next/link"; +import AddWorkspaceDialog from "./AddWorkspaceDialog"; + +function TabPanel(props) { + const { children, value, index, ...other } = props; + + return ( + + ); } -export default MyOrganization; \ No newline at end of file +export default function Organization() { + + const [value, setValue] = useState(0); + const handleChange = (event, newValue) => { + setValue(newValue); + }; + const classes = DatasetStyle(); + const [addWorkspacesDialogOpen, setAddWorkspacesDialogOpen] = useState(false); + const CustomButton = ({ label, buttonVariant, color, disabled = false, ...rest }) => ( + + ); + const handleWorkspaceDialogClose = () => { + setAddWorkspacesDialogOpen(false); + }; + + const handleWorkspaceDialogOpen = () => { + setAddWorkspacesDialogOpen(true); + }; + + const columns = [ + { + name: "id", + label: "Id", + options: { + filter: false, + sort: false, + align: "center", + setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }), + } + }, + { + name: "Name", + label: "Name", + options: { + filter: false, + sort: false, + align: "center", + setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }), + } + }, + { + name: "Manager", + label: "Manager", + options: { + filter: false, + sort: false, + align: "center", + display: "true", + setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }), + } + }, + { + name: "Created By", + label: "Created By", + options: { + filter: false, + sort: false, + align: "center", + display: "true", + setCellHeaderProps: sort => ({ style: { height: "70px", padding: "16px" } }), + } + }, + { + name: "Actions", + label: "Actions", + options: { + filter: false, + sort: false, + } + }]; + + const options = { + textLabels: { + body: { + noMatch: "No records", + }, + toolbar: { + search: "Search", + viewColumns: "View Column", + }, + pagination: { rowsPerPage: "Rows per page" }, + options: { sortDirection: "desc" }, + }, + // customToolbar: fetchHeaderButton, + displaySelectToolbar: false, + fixedHeader: false, + filterType: "checkbox", + download: false, + print: false, + rowsPerPageOptions: [10, 25, 50, 100], + // rowsPerPage: PageInfo.count, + filter: false, + // page: PageInfo.page, + viewColumns: false, + selectableRows: "none", + search: false, + jumpToPage: true, + }; + + const workspaceData = [{ "id": 1, "workspace_name": "workspace 1", "managers": [{ "username": "manager 1" }, { "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 1" } }, + { "id": 2, "workspace_name": "workspace 2", "managers": [{ "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 2" } }, + { "id": 3, "workspace_name": "workspace 3", "managers": [{ "username": "manager 1" }, { "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 3" } }, + { "id": 4, "workspace_name": "workspace 4", "managers": [{ "username": "manager 1" }, { "username": "manager 3" }], "created_by": { "username": "Admin 4" } }, + { "id": 5, "workspace_name": "workspace 5", "managers": [{ "username": "manager 1" }, { "username": "manager 3" }], "created_by": { "username": "Admin 5" } }, + { "id": 6, "workspace_name": "workspace 6", "managers": [{ "username": "manager 2" }, { "username": "manager 3" }], "created_by": { "username": "Admin 6" } }] + + const pageSearch = () => { + return workspaceData.filter((el) => { + return el; + }) + + } + const data = workspaceData && workspaceData.length > 0 ? pageSearch().map((el, i) => { + return [ + el.id, + el.workspace_name, + el.managers.map((manager) => { + return manager.username + }).join(", "), + el.created_by && el.created_by.username, + + + + ] + }) : []; + + return ( + + + + AI4Bharat + + + + Created by : Anudesh + + + + + + + + + + + + + + {/* + + */} + + + + + ) +} \ No newline at end of file diff --git a/src/styles/Header.js b/src/styles/Header.js index 5a0532ce..ac12eabc 100644 --- a/src/styles/Header.js +++ b/src/styles/Header.js @@ -4,14 +4,14 @@ import { padding } from '@mui/system'; const headerStyle = makeStyles({ parentContainer: { // flexGrow : 1, - marginBottom : window.innerHeight*0.13, - width : window.innerWidth*0.98, + // marginBottom : window.innerHeight*0.13, + // width : window.innerWidth*0.98, }, AudioparentContainers:{ - marginBottom : window.innerHeight*0.1, - width : window.innerWidth*0.98, + // marginBottom : window.innerHeight*0.1, + // width : window.innerWidth*0.98, }, appBar: { // backgroundColor: "#ffffff",