516 lines
25 KiB
JavaScript
516 lines
25 KiB
JavaScript
"use strict";
|
|
exports.id = 5313;
|
|
exports.ids = [5313];
|
|
exports.modules = {
|
|
|
|
/***/ 8282:
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
// EXPORTS
|
|
__webpack_require__.d(__webpack_exports__, {
|
|
"Z": () => (/* binding */ SuAdminLayout)
|
|
});
|
|
|
|
// EXTERNAL MODULE: external "react/jsx-runtime"
|
|
var jsx_runtime_ = __webpack_require__(997);
|
|
// EXTERNAL MODULE: external "react"
|
|
var external_react_ = __webpack_require__(6689);
|
|
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
// EXTERNAL MODULE: external "next/head"
|
|
var head_ = __webpack_require__(968);
|
|
var head_default = /*#__PURE__*/__webpack_require__.n(head_);
|
|
// EXTERNAL MODULE: ./components/general/Logo.jsx
|
|
var Logo = __webpack_require__(4017);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/CottageTwoTone"
|
|
var CottageTwoTone_ = __webpack_require__(386);
|
|
var CottageTwoTone_default = /*#__PURE__*/__webpack_require__.n(CottageTwoTone_);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/PeopleAltTwoTone"
|
|
var PeopleAltTwoTone_ = __webpack_require__(8245);
|
|
var PeopleAltTwoTone_default = /*#__PURE__*/__webpack_require__.n(PeopleAltTwoTone_);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/ErrorTwoTone"
|
|
var ErrorTwoTone_ = __webpack_require__(6094);
|
|
var ErrorTwoTone_default = /*#__PURE__*/__webpack_require__.n(ErrorTwoTone_);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/BackupTwoTone"
|
|
var BackupTwoTone_ = __webpack_require__(9318);
|
|
var BackupTwoTone_default = /*#__PURE__*/__webpack_require__.n(BackupTwoTone_);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/DocumentScannerTwoTone"
|
|
var DocumentScannerTwoTone_ = __webpack_require__(6817);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/TerminalTwoTone"
|
|
var TerminalTwoTone_ = __webpack_require__(415);
|
|
var TerminalTwoTone_default = /*#__PURE__*/__webpack_require__.n(TerminalTwoTone_);
|
|
// EXTERNAL MODULE: external "@mui/icons-material/LockPersonTwoTone"
|
|
var LockPersonTwoTone_ = __webpack_require__(6547);
|
|
var LockPersonTwoTone_default = /*#__PURE__*/__webpack_require__.n(LockPersonTwoTone_);
|
|
;// CONCATENATED MODULE: ./layouts/components/SuAdminLayout/Aside.jsx
|
|
// @ts-check
|
|
/**
|
|
* ==============================================================================
|
|
* Imports
|
|
* ==============================================================================
|
|
*/ "use client";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
|
|
* ==============================================================================
|
|
* Main Component { Functional }
|
|
* ==============================================================================
|
|
* @param {object} props - React component props
|
|
*/ function Aside(props) {
|
|
/**
|
|
* Get Contexts
|
|
*
|
|
* @abstract { React.useContext }
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Javascript Variables
|
|
*
|
|
* @abstract Non hook variables and functions
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* React Hooks
|
|
*
|
|
* @abstract { useState, useEffect, useRef, etc ... }
|
|
*/ const [collapseAsideMobile, setCollapseAsideMobile] = external_react_default().useState(true);
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Function Return
|
|
*
|
|
* @abstract Main Function Return
|
|
*/ return /*#__PURE__*/ (0,jsx_runtime_.jsxs)("aside", {
|
|
className: "aside" + (collapseAsideMobile ? " mobile-collapsed" : " mobile-expanded"),
|
|
style: {
|
|
maxWidth: collapseAsideMobile ? "250px" : "300px",
|
|
zIndex: 800
|
|
},
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx(Logo/* default */.Z, {
|
|
adminAside: true,
|
|
collapseAsideMobile: collapseAsideMobile,
|
|
setCollapseAsideMobile: setCollapseAsideMobile
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("hr", {
|
|
className: "opacity-0 mt-4"
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "main-links" + (collapseAsideMobile ? " hidden lg:flex" : " "),
|
|
children: [
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su`,
|
|
"data-currentlink": `/su`,
|
|
"data-strictlink": "true",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((CottageTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Dashboard"
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su/users`,
|
|
"data-currentlink": `/su/users`,
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((PeopleAltTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Users"
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su/error-logs`,
|
|
"data-currentlink": `/su/error-logs`,
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((ErrorTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Error Logs"
|
|
})
|
|
]
|
|
}),
|
|
false && /*#__PURE__*/ 0,
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su/backups`,
|
|
"data-currentlink": `/su/backups`,
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((BackupTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Backups"
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su/console`,
|
|
"data-currentlink": `/su/console`,
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((TerminalTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Console"
|
|
})
|
|
]
|
|
}),
|
|
true && /*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: `/su/envar`,
|
|
"data-currentlink": `/su/envar`,
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx((LockPersonTwoTone_default()), {
|
|
className: "text-slate-400"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: "Env"
|
|
})
|
|
]
|
|
})
|
|
]
|
|
})
|
|
]
|
|
});
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
}
|
|
|
|
// EXTERNAL MODULE: ./components/general/ThemeSelector.jsx
|
|
var ThemeSelector = __webpack_require__(4981);
|
|
// EXTERNAL MODULE: external "lucide-react"
|
|
var external_lucide_react_ = __webpack_require__(2423);
|
|
;// CONCATENATED MODULE: ./layouts/components/SuAdminLayout/AdminHeader.jsx
|
|
// @ts-check
|
|
/**
|
|
* ==============================================================================
|
|
* Imports
|
|
* ==============================================================================
|
|
*/ "use client";
|
|
|
|
|
|
|
|
|
|
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
|
|
* ==============================================================================
|
|
* Main Component { Functional }
|
|
* ==============================================================================
|
|
* @param {object} props - React component props
|
|
* @param {import("@/package-shared/types").UserType} props.user
|
|
* @param {React.ReactNode} [props.extraHeaderContent]
|
|
*/ function AdminHeader({ user , extraHeaderContent }) {
|
|
/**
|
|
* Get Contexts
|
|
*
|
|
* @abstract { React.useContext }
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Javascript Variables
|
|
*
|
|
* @abstract Non hook variables and functions
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* React Hooks
|
|
*
|
|
* @abstract { useState, useEffect, useRef, etc ... }
|
|
*/ const [activeUser, setActiveUser] = external_react_default().useState(user ? user : null);
|
|
external_react_default().useEffect(()=>{
|
|
if (user?.logged_in_status) {
|
|
setActiveUser(user ? user : null);
|
|
}
|
|
}, [
|
|
user
|
|
]);
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Function Return
|
|
*
|
|
* @abstract Main Function Return
|
|
*/ return /*#__PURE__*/ jsx_runtime_.jsx("section", {
|
|
className: "overflow-visible w-full px-0 md:px-8 py-0 flex justify-center bg-white dark:bg-slate-800 shadow-lg gap-4 dark:shadow-black/10 z-50 shadow-slate-900/5",
|
|
style: {
|
|
zIndex: 700,
|
|
border: "none"
|
|
},
|
|
children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "w-full items-center justify-between gap-4 md:gap-8",
|
|
children: [
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "hidden xl:flex flex-col items-stretch grow fixed xl:static top-0 right-0 px-4 xl:px-0 shadow-xl xl:shadow-none h-screen xl:h-auto overflow-auto xl:overflow-visible w-screen sl:w-auto bg-white xl:bg-transparent pb-10 xl:pb-0",
|
|
id: "main-nav-content-wrapper",
|
|
children: [
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "items-center mb-2 flex xl:hidden",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx("a", {
|
|
href: "/",
|
|
className: "hidden xl:flex",
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("img", {
|
|
src: "/images/logo-icon-alt-2.png",
|
|
alt: "Logo Icon",
|
|
width: 37
|
|
})
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("button", {
|
|
className: "outlined gray ml-auto",
|
|
onClick: (e)=>{
|
|
/** @type {any} */ const mainNavWrapper = document.getElementById("main-nav-content-wrapper");
|
|
mainNavWrapper?.classList.toggle("hidden");
|
|
},
|
|
style: {
|
|
border: "none"
|
|
},
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
className: "font-semibold text-4xl",
|
|
children: "✕"
|
|
})
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "gap-2 flex-col-reverse xl:flex-row gap-y-6 w-full xl:w-auto py-2",
|
|
children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "ml-auto dropdown-wrapper",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "bg-white rounded-full overflow-hidden",
|
|
style: {
|
|
width: "36px",
|
|
height: "36px"
|
|
},
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("img", {
|
|
src: "/images/user_images/user-preset-thumbnail.png",
|
|
alt: "User Image",
|
|
width: 35,
|
|
className: "w-full h-full object-cover"
|
|
})
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("b", {
|
|
children: "Super User"
|
|
})
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx(external_lucide_react_.ChevronDown, {
|
|
size: 20
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "dropdown",
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx("a", {
|
|
href: `/su/logout`,
|
|
children: "Logout"
|
|
})
|
|
})
|
|
]
|
|
})
|
|
})
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "ml-2",
|
|
children: /*#__PURE__*/ jsx_runtime_.jsx(ThemeSelector/* default */.Z, {})
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("button", {
|
|
className: "bg-transparent w-16 p-4 gap-1.5 flex xl:hidden flex-col hover:bg-transparent transition-all ml-auto",
|
|
onClick: (e)=>{
|
|
/** @type {any} */ const mainNavWrapper = document.getElementById("main-nav-content-wrapper");
|
|
mainNavWrapper?.classList.toggle("hidden");
|
|
},
|
|
style: {
|
|
minWidth: "50px",
|
|
backgroundColor: "transparent"
|
|
},
|
|
id: "main-header-hamburger-button",
|
|
"aria-label": "Mobile Hambutget Button",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"
|
|
})
|
|
]
|
|
})
|
|
]
|
|
})
|
|
});
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
}
|
|
|
|
// EXTERNAL MODULE: ./functions/frontend/updateNavLinks.js
|
|
var updateNavLinks = __webpack_require__(9678);
|
|
;// CONCATENATED MODULE: ./layouts/SuAdminLayout.jsx
|
|
// @ts-check
|
|
/**
|
|
* ==============================================================================
|
|
* Imports
|
|
* ==============================================================================
|
|
*/
|
|
|
|
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
|
|
|
|
|
|
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
|
|
* ==============================================================================
|
|
* Main Component { Functional }
|
|
* ==============================================================================
|
|
* @param {object} props - React Props
|
|
* @param {React.ReactNode} props.children - children component
|
|
* @param {React.ReactNode} [props.head] - head Items
|
|
* @param {import("@/package-shared/types").UserType} props.user - user object
|
|
*/ function SuAdminLayout({ children , head , user }) {
|
|
/**
|
|
* Get Contexts
|
|
*
|
|
* @abstract { React.useContext }
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Javascript Variables
|
|
*
|
|
* @abstract Non hook variables and functions
|
|
*/ ////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* React Hooks
|
|
*
|
|
* @abstract { useState, useEffect, useRef, etc ... }
|
|
*/ external_react_default().useEffect(()=>{
|
|
/** @type { NodeListOf<HTMLAnchorElement> } */ const links = document.querySelectorAll("aside .main-links a");
|
|
(0,updateNavLinks/* default */.Z)({
|
|
links: links
|
|
});
|
|
}, []);
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
/**
|
|
* Function Return
|
|
*
|
|
* @abstract Main Function Return
|
|
*/ return /*#__PURE__*/ (0,jsx_runtime_.jsxs)((external_react_default()).Fragment, {
|
|
children: [
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)((head_default()), {
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx("link", {
|
|
rel: "stylesheet",
|
|
href: "/styles/admin.css"
|
|
}),
|
|
head
|
|
]
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "admin w-full flex items-start gap-0",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx(Aside, {}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("main", {
|
|
className: "relative",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx(AdminHeader, {
|
|
user: user
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("div", {
|
|
className: "flex-col items-start gap-6 px-4 sl:px-8 py-8 bg-slate-50 dark:bg-slate-900",
|
|
children: children
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("footer", {
|
|
className: "flex justify-center w-full items-center p-4",
|
|
children: /*#__PURE__*/ (0,jsx_runtime_.jsxs)("div", {
|
|
className: "max-w-6xl w-full justify-center flex-wrap",
|
|
children: [
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("a", {
|
|
href: "/",
|
|
className: "flex items-center gap-2",
|
|
children: [
|
|
/*#__PURE__*/ jsx_runtime_.jsx("img", {
|
|
src: "/images/logo-icon-alt-2.png",
|
|
alt: "Datasquirel Logo",
|
|
width: 30
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
className: "text-lg font-bold",
|
|
children: "Datasquirel"
|
|
})
|
|
]
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
className: "opacity-25",
|
|
children: "|"
|
|
}),
|
|
/*#__PURE__*/ (0,jsx_runtime_.jsxs)("span", {
|
|
className: "text-sm text-slate-400 dark:text-slate-600 text-center",
|
|
children: [
|
|
new Date().getFullYear(),
|
|
" \xa9 Datasquirel. All rights reserved."
|
|
]
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
className: "opacity-25",
|
|
children: "|"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("a", {
|
|
href: "/docs",
|
|
children: "Docs"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("span", {
|
|
className: "opacity-25",
|
|
children: "|"
|
|
}),
|
|
/*#__PURE__*/ jsx_runtime_.jsx("a", {
|
|
href: "/terms",
|
|
children: "Terms"
|
|
})
|
|
]
|
|
})
|
|
})
|
|
]
|
|
})
|
|
]
|
|
})
|
|
]
|
|
});
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
};
|
|
; |