<!DOCTYPE html>
<html lang="en">

<head>
	<link rel="stylesheet" href="../testcdn/a05ee437b7ade39c78f8.css" data-n-p="">
	<%- include("partials/preloader.ejs", {now: "debug"}) %>
	<%

	let seconds = Math.round(rawUptime % 60);

	if (seconds > 59) seconds = Math.round(seconds % 60);

	let minutes = Math.floor(rawUptime / 60);
	let hours = Math.floor(minutes / 60);
	let days = Math.floor(hours / 24);

	minutes = minutes % 60;
	hours = hours % 24;

	let filterUptime = `${days}d, ${hours}h, ${minutes}m, ${seconds}s`;
	if (!days) filterUptime = `${hours}h, ${minutes}m, ${seconds}s`;
	if (!hours) filterUptime = `${minutes}m, ${seconds}s`;
	if (!minutes) filterUptime = `${seconds}s`;

	let modified = 0;

	const info = []
	const versions = []
	if (modified !== 0) modded = "true"
	else modded = "false"

	let information = [
		{name: "Theme", value: "Soft UI Theme"},
		{name: "Modified", value: `${modded}`},
		{name: "Uptime", value: `${filterUptime}`},
		{name: "Permissions", value: config.requiredPermissions},
		{name: "Redirect URI", value: `${config.redirectUri?.includes("/discord/callback")}`}
	]

	let modules = [
		{name: "Node JS", version: `${nodeVersion.split("v")[1]}`},
		{name: "Discord JS", version: `${discordVersion}`, npm: "discord.js"},
		{name: "Discord Dashboard", version: `${dbdVersion}`, npm: "discord-dashboard"},
		{name: "Theme", version: `${themeVersion}`, npm: "soft-ui"},
	]

	const settings = config.settings

	let debug = {information, modules, versions, settings, themeConfig}

	var data = "text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(debug));
	%>
	<%- themeConfig?.customHtml %>
</head>
<body class="g-sidenav-show bg-gray-100" id="scroll">
<%- include("partials/preload.ejs") %>
<%- include("partials/sidebar.ejs", {config: config, now:"debug"}) %>
<div class="main-content position-relative bg-gray-100 max-height-vh-100 h-100">
	<!-- Navbar -->
	<%- include("partials/navbar.ejs", {now:"debug"}) %>
	<!-- End Navbar -->
	<div class="container-fluid py-4">
		<div class="modal fade" id="exampleModalSignUp" tabindex="-1" role="dialog"
			 aria-labelledby="exampleModalSignTitle" aria-hidden="true">
			<div class="modal-dialog modal-dialog-centered modal-sm" role="document">
				<div class="modal-content">
					<div class="modal-body p-0">
						<div class="card card-plain">
							<div class="card-header pb-0 text-left">
								<h4 class="font-weight-bolder text-primary text-gradient">Download Log file.</h4>
								<p class="mb-0"
								   style="text-align: center;">This log contains the dashboard"s Theme Config and all options with any personal information redacted.</p>
							</div>
							<div class="card-body pb-3" id="form1">
								<form role="form text-left">
									<div class="text-center">
										<%
										//new date
										const date = new Date();
										//convert unix to string
										const dateString = date.toString();
										//split date string
										const dateSplit = dateString.split(" ");
										//get date
										const dateFinal = dateSplit[2] + "-" + dateSplit[1] + "-" + dateSplit[3];
										//get time
										const timeFinal = dateSplit[4];
										//split by space and join by -
										const timeFinal2 = timeFinal.replace(/[&\/\\#, +()$~%."":*?<>{}]/g, "-");
										%>
										<a href="data:<%- data %>"
										   download="Log_SoftUI_<%- timeFinal2 %>_<%- dateFinal %>.json"
										   class="btn bg-gradient-primary">download JSON</a>
									</div>
								</form>
							</div>
							<div class="card-footer text-center pt-0 px-sm-4 px-1">
								Paste this in the <a
										href="https://discord.com/channels/803034737261936670/803036935785414717"
										target="_blank" class="text-dark font-weight-bolder">#😖»get-help</a> channel.
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="row">
				<div class="col-lg-12">
					<div class="row">
						<div class="col-xl-6">
							<div class="row  pb-4">
								<div class="col-md-6">
									<div class="card">
										<div class="card-header mx-4 p-3 text-center">
											<div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
												<i class="fab fa-node-js opacity-10" aria-hidden="true"></i>
											</div>
										</div>
										<div class="card-body pt-0 p-3 text-center">
											<h6 class="text-center mb-0">Node JS</h6>
											<span class="text-xs">Version</span>
											<hr class="horizontal dark my-3">
											<h5 class="mb-0"><%- nodeVersion.split("v")[1] %></h5>
										</div>
									</div>
								</div>
								<div class="col-md-6 mt-md-0 mt-4">
									<div class="card">
										<div class="card-header mx-4 p-3 text-center">
											<div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
												<i class="fab fa-discord opacity-10" aria-hidden="true"></i>
											</div>
										</div>
										<div class="card-body pt-0 p-3 text-center">
											<h6 class="text-center mb-0">Discord.JS</h6>
											<span class="text-xs">Version</span>
											<hr class="horizontal dark my-3">
											<h5 class="mb-0"><%- discordVersion %></h5>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="col-xl-6">
							<style>
								.fab {
									color: rgb(232, 230, 227) !important;
								}

								.fas {
									color: rgb(232, 230, 227) !important;
								}
							</style>
							<div class="row">
								<div class="col-md-6 mb-4">
									<div class="card">
										<div class="card-header mx-4 p-3 text-center">
											<div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
												<i class="fas fa-landmark opacity-10" aria-hidden="true"></i>
											</div>
										</div>
										<div class="card-body pt-0 p-3 text-center">
											<h6 class="text-center mb-0">Discord Dashboard</h6>
											<span class="text-xs">Version</span>
											<hr class="horizontal dark my-3">
											<h5 class="mb-0"><%- dbdVersion %></h5>
										</div>
									</div>
								</div>
								<div class="col-md-6 mt-md-0 mt-4 mb-4">
									<div class="card">
										<div class="card-header mx-4 p-3 text-center">
											<div class="icon icon-shape icon-lg bg-gradient-primary shadow text-center border-radius-lg">
												<i class="fas fa-cloud opacity-10" aria-hidden="true"></i>
											</div>
										</div>
										<div class="card-body pt-0 p-3 text-center">
											<h6 class="text-center mb-0">Theme</h6>
											<span class="text-xs">Version</span>
											<hr class="horizontal dark my-3">
											<h5 class="mb-0"><%- themeVersion %></h5>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 mb-lg-0 mb-4">
							<div class="card">
								<div class="card-header pb-0 p-3">
									<div class="row">
										<div class="col-6 d-flex align-items-center">
											<h6 class="mb-0">Dashboard Logs</h6>
										</div>
									</div>
								</div>
								<div class="card-body p-3">
									<div class="row">
										<div class="col-md-12 mb-md-0 mb-4">
											<div data-bs-toggle="modal" style="cursor: pointer;"
												 data-bs-target="#exampleModalSignUp"
												 class="alert alert-primary text-white font-weight-bold text-center"
												 role="alert">
												Download Logs
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 mb-lg-0 mb-4">
							<div class="card">
								<div class="card-header pb-0 p-3">
									<div class="row">
										<div class="col-6 d-flex align-items-center">
											<h6 class="mb-0">Theme Modification</h6>
										</div>
									</div>
								</div>
								<div class="card-body p-3">
									<div class="row">
										<div class="col-md-12 mb-md-0 mb-4">
											<% if(modified !== 0){ %>
												<div class="alert alert-danger text-white font-weight-bold"
													 role="alert">
													This theme has been modified!
												</div>
											<% } else{ %>
												<div class="alert alert-success text-white font-weight-bold"
													 role="alert">
													This theme has not been modified!
												</div>
											<% } %>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="col-md-4 mb-lg-0 mb-4">
							<div class="card">
								<div class="card-header pb-0 p-3">
									<div class="row">
										<div class="col-6 d-flex align-items-center">
											<h6 class="mb-0">Dashboard Information</h6>
										</div>
										<div style="text-align: right;" class="col-6 align-items-right">
											<a style="text-align: right;">Uptime: <%- filterUptime %></a>
										</div>
									</div>
								</div>
								<div class="card-body p-3">
									<div class="row">
										<div class="col-md-12 mb-md-0 mb-4">
											<div class="alert alert-warning text-white font-weight-bold" role="alert">
												License type: <span style="text-transform: capitalize;">No License</span>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12 mt-4">
						<div class="col-12 col-lg-12 mb-4">
							<div class="card ">
								<div class="card-header pb-0 p-3">
									<div class="d-flex justify-content-between">
										<h6 class="mb-2">Partial Information</h6>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="row">
			</div>
			<%- include("partials/footer.ejs") %>
		</div>
		</main>
	</div>
	<%- include("partials/scripts.ejs", {now: "debug"}) %>
</body>

</html>