Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shivanshsd8/9d152c06ffd32f64bb36e35fc6a7353b to your computer and use it in GitHub Desktop.
Save shivanshsd8/9d152c06ffd32f64bb36e35fc6a7353b to your computer and use it in GitHub Desktop.
<?php include 'node.php';
session_start();
$userName = $_SESSION['LoginName'];
$customerid=$_SESSION['username'];
include 'session_variables.php';
if ($_SESSION['clkSession'] == 1) { $custID = $_SESSION['customer123'];
$branchId = $_SESSION['branch123'];
$productId = $_SESSION['product123'];
$vaultid12 = $_SESSION['system123']; }
$path = "/rationalVault/data/";
$compath = $path.$company; $NEWDIR_NodeName = $path.$company."/".$custID."/".$branchId."/"."ProductID.xml";
$companyname=$_SESSION['companyname']; $client = $path.$company."/".$custID."/"."clientconnect.xml"; $show = readDataFromXml("/Activity/ActivityNumber",$client); $RemoteXml = $path."/".$company."/".$custID."/client_status.xml"; $RemoteStat = readDataFromXml("/ClientStatus/Client_Status", $RemoteXml); $configure = readDataFromXml("/Activity/configure", $client); $branchesxml = $compath."/".$custID."/Branches.xml"; $numberofbranches = readDataFromXml("/branchInfo/NumOfBranches",$branchesxml); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KubeSec</title>
<link rel="icon" type="image/svg+xml" href="/kubeLogo.png">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@10"></script>
<style>
* { font-family: 'Inter', sans-serif; }
.custom-green { color: #166534; }
.custom-green-bg { background-color: #166534; }
.custom-green-hover:hover { background-color: #14532d; }
.custom-green-border { border-color: #166534; }
.sidebar-gradient {
background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
border-right: 1px solid #e2e8f0;
}
.card-hover {
transition: all 0.3s ease;
border: 1px solid #e5e7eb;
}
.card-hover:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(22, 101, 52, 0.1);
border-color: #166534;
}
.nav-item {
transition: all 0.2s ease;
border-radius: 12px;
margin: 4px 0;
}
.nav-item:hover {
background-color: #f0fdf4;
color: #166534;
}
.nav-item.active {
background-color: #166534;
color: white;
}
.stats-card {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
border: 1px solid #e5e7eb;
}
.hero-pattern {
background-image: radial-gradient(circle at 25% 25%, #f0fdf4 0%, transparent 50%),
radial-gradient(circle at 75% 75%, #ecfdf5 0%, transparent 50%);
}
.feature-icon {
width: 60px;
height: 60px;
background: linear-gradient(135deg, #166534 0%, #15803d 100%);
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 24px;
}
/* Popup Styles */
.popup-overlay {
background-color: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(4px);
}
.popup-content {
background: white;
border-radius: 16px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.dashboard-grid {
display: grid;
grid-template-columns: 280px 1fr;
min-height: 100vh;
}
@media (max-width: 768px) {
.dashboard-grid {
grid-template-columns: 1fr;
}
.sidebar {
position: fixed;
left: -280px;
transition: left 0.3s ease;
z-index: 50;
height: 100vh;
}
.sidebar.open {
left: 0;
}
}
.status-online {
background-color: #10b981;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.metric-number {
font-size: 2.5rem;
font-weight: 700;
background: linear-gradient(135deg, #166534, #15803d);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
</head>
<body class="bg-gray-50">
<div class="dashboard-grid">
<!-- Sidebar -->
<div class="sidebar sidebar-gradient fixed md:relative w-80 md:w-auto h-full z-40">
<div class="p-6">
<!-- Logo -->
<div class="flex items-center mb-8">
<div class="w-12 h-12 custom-green-bg rounded-xl flex items-center justify-center mr-3">
<!-- <i class="fas fa-shield-alt text-white text-xl"></i> -->
<img src="./assets/neridio-CLfRM1Vr.png" alt="">
</div>
<div>
<h1 class="text-xl font-bold text-gray-800">KubeSec</h1>
<p class="text-sm text-gray-500">Security Dashboard</p>
</div>
</div>
<!-- Navigation -->
<nav class="space-y-2">
<div class="nav-item active px-4 py-3 cursor-pointer" id="overview">
<div class="flex items-center">
<i class="fas fa-chart-line w-5 mr-3"></i>
<span class="font-medium">Overview</span>
</div>
</div>
<div class="nav-item px-4 py-3 cursor-pointer" id="seconddashboard">
<div class="flex items-center">
<i class="fas fa-analytics w-5 mr-3"></i>
<span class="font-medium">Cyber Telemetry & Security Analytics</span>
</div>
</div>
<div class="nav-item px-4 py-3 cursor-pointer" id="cyberTelemetry">
<div class="flex items-center">
<i class="fas fa-cogs w-5 mr-3"></i>
<span class="font-medium">Add and Configure Automated Services</span>
</div>
</div>
<div class="nav-item px-4 py-3 cursor-pointer" id="thirddashboard">
<div class="flex items-center">
<i class="fas fa-shield-alt w-5 mr-3"></i>
<span class="font-medium">Manual Security Control</span>
</div>
</div>
<div class="nav-item px-4 py-3 cursor-pointer" id="fourthdashboard">
<div class="flex items-center">
<i class="fas fa-file-alt w-5 mr-3"></i>
<span class="font-medium">Auditing, Reporting, and Logs</span>
</div>
</div>
<div class="nav-item px-4 py-3 cursor-pointer" id="configandsoft">
<div class="flex items-center">
<i class="fas fa-download w-5 mr-3"></i>
<span class="font-medium">Config and Software Update</span>
</div>
</div>
</nav>
<!-- Contact Section -->
<div class="mt-12 pt-6 border-t border-gray-200">
<button class="w-full custom-green-bg text-white px-4 py-3 rounded-xl font-medium hover:bg-opacity-90 transition-all mb-4" onclick="toggleContactDialog()">
<i class="fas fa-headset mr-2"></i>
Contact Support
</button>
<button class="w-full text-custom-green border border-green-200 px-4 py-3 rounded-xl font-medium hover:bg-green-50 transition-all" onclick="redirectToNeridio()">
<i class="fas fa-external-link-alt mr-2"></i>
Learn More
</button>
</div>
</div>
</div>
<!-- Main Content -->
<div class="flex-1 flex flex-col">
<!-- Header -->
<header class="bg-white border-b border-gray-200 px-6 py-4">
<div class="flex items-center justify-between">
<div class="flex items-center">
<button class="md:hidden mr-4" onclick="toggleSidebar()">
<i class="fas fa-bars text-gray-600"></i>
</button>
<div>
<h1 class="text-2xl font-bold text-gray-800">SOC for Kubernetes</h1>
<p class="text-gray-500">Welcome back, secure your infrastructure</p>
</div>
</div>
<div class="flex items-center space-x-4">
<div class="flex items-center text-sm text-gray-600">
<div class="w-3 h-3 status-online rounded-full mr-2"></div>
System Online
</div>
<button class="w-10 h-10 custom-green-bg text-white rounded-full flex items-center justify-center font-semibold" onclick="showLogoutConfirmation()">
<?php echo strtoupper(substr($companyname, 0, 1)); ?>
</button>
</div>
</div>
</header>
<!-- Dashboard Content -->
<main class="flex-1 p-6 overflow-auto">
<!-- Stats Overview -->
<div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
<div class="stats-card p-6 rounded-2xl">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm font-medium">Active Clusters</p>
<p class="metric-number"><?php echo $numberofbranches; ?></p>
</div>
<div class="feature-icon">
<i class="fas fa-server"></i>
</div>
</div>
</div>
<div class="stats-card p-6 rounded-2xl">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm font-medium">Security Score</p>
<p class="metric-number">98%</p>
</div>
<div class="feature-icon">
<i class="fas fa-shield-alt"></i>
</div>
</div>
</div>
<div class="stats-card p-6 rounded-2xl">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm font-medium">Response Time</p>
<p class="metric-number">&lt;30s</p>
</div>
<div class="feature-icon">
<i class="fas fa-stopwatch"></i>
</div>
</div>
</div>
<div class="stats-card p-6 rounded-2xl">
<div class="flex items-center justify-between">
<div>
<p class="text-gray-500 text-sm font-medium">Uptime</p>
<p class="metric-number">99.9%</p>
</div>
<div class="feature-icon">
<i class="fas fa-clock"></i>
</div>
</div>
</div>
</div>
<!-- Hero Section -->
<div class="hero-pattern bg-white rounded-3xl p-8 mb-8 border border-gray-100">
<div class="max-w-4xl mx-auto text-center">
<h1 class="text-4xl md:text-5xl font-bold text-gray-800 mb-6">
Secure Your Kubernetes
<span class="custom-green block">Infrastructure</span>
</h1>
<p class="text-xl text-gray-600 mb-8 max-w-3xl mx-auto leading-relaxed">
Advanced security orchestration for cloud-native environments with AI-powered threat detection,
real-time monitoring, and comprehensive protection across all your clusters.
</p>
<div class="flex flex-col sm:flex-row gap-4 justify-center">
<button class="custom-green-bg text-white px-8 py-4 rounded-2xl font-semibold text-lg custom-green-hover transition-all" onclick="window.location.href='newfirstdashboard.php'">
<i class="fas fa-rocket mr-2"></i>
Explore Dashboard
</button>
<button class="border-2 custom-green-border custom-green px-8 py-4 rounded-2xl font-semibold text-lg hover:bg-green-50 transition-all">
<i class="fas fa-play mr-2"></i>
Watch Demo
</button>
</div>
</div>
</div>
<!-- Features Grid -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<img src="./threatprevImage.png" alt="Threat Detection" class="w-full h-40 object-contain rounded-xl mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Real-time Threat Detection</h3>
<p class="text-gray-600 leading-relaxed">
AI-powered security monitoring that detects and neutralizes threats before they impact your workloads.
</p>
</div>
</div>
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<img src="./controlPlaneImage.png" alt="Control Plane Security" class="w-full h-40 object-contain rounded-xl mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Control Plane Security</h3>
<p class="text-gray-600 leading-relaxed">
Comprehensive protection for cluster components, metadata, and cloud-native storage systems.
</p>
</div>
</div>
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<img src="./multiclusterImage.png" alt="Multi-cluster Management" class="w-full object-contain h-40 rounded-xl mb-6">
<h3 class="text-xl font-bold text-gray-800 mb-4">Multi-cluster Coverage</h3>
<p class="text-gray-600 leading-relaxed">
Unified security management across multiple Kubernetes clusters with consistent policy enforcement.
</p>
</div>
</div>
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<div class="feature-icon mx-auto mb-6">
<i class="fas fa-layer-group"></i>
</div>
<h3 class="text-xl font-bold text-gray-800 mb-4">Layered Defense</h3>
<p class="text-gray-600 leading-relaxed">
Multi-vectored security architecture providing enhanced resilience and comprehensive protection.
</p>
</div>
</div>
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<div class="feature-icon mx-auto mb-6">
<i class="fas fa-chart-bar"></i>
</div>
<h3 class="text-xl font-bold text-gray-800 mb-4">Advanced Analytics</h3>
<p class="text-gray-600 leading-relaxed">
Deep insights into security events, performance metrics, and compliance status across your infrastructure.
</p>
</div>
</div>
<div class="card-hover bg-white p-8 rounded-2xl">
<div class="text-center">
<div class="feature-icon mx-auto mb-6">
<i class="fas fa-robot"></i>
</div>
<h3 class="text-xl font-bold text-gray-800 mb-4">AI-Powered Automation</h3>
<p class="text-gray-600 leading-relaxed">
Intelligent automation for incident response, policy enforcement, and security orchestration.
</p>
</div>
</div>
</div>
<!-- Call to Action -->
<div class="bg-gradient-to-r from-green-50 to-green-100 rounded-3xl p-8 text-center border border-green-200">
<h2 class="text-3xl font-bold text-gray-800 mb-4">Ready to Secure Your Infrastructure?</h2>
<p class="text-lg text-gray-600 mb-6 max-w-2xl mx-auto">
Get started with KubeSec and experience comprehensive Kubernetes security with AI-powered protection.
</p>
<button class="custom-green-bg text-white px-8 py-4 rounded-2xl font-semibold text-lg custom-green-hover transition-all" onclick="window.location.href='newfirstdashboard.php'">
<i class="fas fa-arrow-right mr-2"></i>
Get Started Now
</button>
</div>
</main>
</div>
</div>
<!-- Cluster Selection Popup -->
<div id="selectOptionsPopup" class="fixed inset-0 popup-overlay hidden items-center justify-center z-50">
<div class="popup-content p-8 max-w-md w-full mx-4">
<div class="flex items-center justify-between mb-6">
<h2 class="text-2xl font-bold text-gray-800">Select Configuration</h2>
<button class="text-gray-500 hover:text-gray-700" onclick="closeSelectOptionsPopup()">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div class="space-y-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Select Cluster</label>
<select id="productSelect" class="w-full p-4 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-green-500">
<option value="0">Choose a cluster...</option>
<?php for ($k = 1; $k <= $numberofbranches; $k++) {
$branchName = readDataFromXml("/branchInfo/branch" . $k . "_Info/branchname", $branchesxml);
$branchvalue = readDataFromXml("/branchInfo/branch" . $k . "_Info/branchid", $branchesxml);
?>
<option value="<?php echo $branchvalue; ?>"><?php echo $branchName; ?></option>
<?php } ?>
</select>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-2">Select System</label>
<select id="systemSelectnew" class="w-full p-4 border border-gray-300 rounded-xl focus:outline-none focus:ring-2 focus:ring-green-500">
<option value="0">Choose a system...</option>
</select>
</div>
<button id="submitButton" class="w-full custom-green-bg text-white py-4 rounded-xl font-semibold custom-green-hover transition-all">
<i class="fas fa-check mr-2"></i>
Continue
</button>
</div>
</div>
</div>
<!-- Contact Dialog -->
<div id="dialogOverlay" class="fixed inset-0 popup-overlay hidden items-center justify-center z-50">
<div id="contactDialog" class="popup-content p-8 max-w-md w-full mx-4">
<div class="flex items-center justify-between mb-6">
<h2 class="text-2xl font-bold text-gray-800">Contact Support</h2>
<button class="text-gray-500 hover:text-gray-700" onclick="closeContactDialog()">
<i class="fas fa-times text-xl"></i>
</button>
</div>
<div class="space-y-4">
<div class="flex items-center space-x-4 p-4 bg-gray-50 rounded-xl">
<div class="feature-icon w-12 h-12 text-lg">
<i class="fas fa-phone"></i>
</div>
<div>
<p class="font-medium text-gray-800">Phone Support</p>
<p class="text-gray-600">+91-8042179002</p>
</div>
</div>
<div class="flex items-center space-x-4 p-4 bg-gray-50 rounded-xl">
<div class="feature-icon w-12 h-12 text-lg">
<i class="fas fa-envelope"></i>
</div>
<div>
<p class="font-medium text-gray-800">Email Support</p>
<p class="text-gray-600">support@neridio.com</p>
</div>
</div>
</div>
</div>
</div>
<script>
// Navigation handlers
var cyberTelemetry = document.getElementById("cyberTelemetry");
if (cyberTelemetry) {
cyberTelemetry.addEventListener("click", function (e) {
window.location.href = "newaddconfigurepage.php";
});
}
var seconddash = document.getElementById("seconddashboard");
if (seconddash) {
seconddash.addEventListener("click", function (e) {
var configureval = "<?php echo $configure ?>";
if (configureval == "0") {
Swal.fire({
icon: 'warning',
title: 'Please Configure Your Required Service First',
showConfirmButton: false,
timer: 2000
});
} else {
window.location.href = "./newfirstdashboard.php";
}
});
}
var thirddashboard = document.getElementById("thirddashboard");
if (thirddashboard) {
thirddashboard.addEventListener("click", function (e) {
var configureval = "<?php echo $configure ?>";
if (configureval == "0") {
Swal.fire({
icon: 'warning',
title: 'Please Configure Your Required Service First',
showConfirmButton: false,
timer: 2000
});
} else {
showSelectOptionsPopup("supportLink");
}
});
}
var fourthdashboard = document.getElementById("fourthdashboard");
if (fourthdashboard) {
fourthdashboard.addEventListener("click", function (e) {
var configureval = "<?php echo $configure ?>";
if (configureval == "0") {
Swal.fire({
icon: 'warning',
title: 'Please Configure Your Required Service First',
showConfirmButton: false,
timer: 2000
});
} else {
window.location.href = "./newauditlogsreportdashboard.php";
}
});
}
document.addEventListener("DOMContentLoaded", function () {
var configandsoft = document.getElementById("configandsoft");
if (configandsoft) {
configandsoft.addEventListener("click", function () {
var showvalue = "<?php echo $show ?>";
if (showvalue == "0") {
Swal.fire({
icon: 'warning',
title: 'Please Contact Administrator',
showConfirmButton: false,
timer: 2000
});
} else {
showSelectOptionsPopup("supportLink2");
}
});
}
});
// AJAX and form handling
$(document).ready(function () {
$("#productSelect").change(function () {
var bid = $(this).val();
var cid = '<?php echo $custID ?>';
$.ajax({
type: "POST",
url: 'systemXML.php',
data: { 'bid': bid, 'cid': cid },
dataType: "json",
success: function (systemsData) {
$('#systemSelectnew').empty();
systemsData.forEach(function (system) {
$('#systemSelectnew').append('<option>' + system + '</option>');
});
},
error: function (xhr, status, error) {
console.error('Error fetching systems data:', error);
}
});
});
$("#submitButton").click(function () {
submitOptions();
});
});
function submitOptions() {
var clickedButtonId = document.getElementById("submitButton").getAttribute("data-button-id");
var compath = "<?php echo $compath ?>";
var custID = "<?php echo $custID ?>";
var branchId = $("#productSelect").val();
var selectedSystemname = $("#systemSelectnew").val();
if (selectedSystemname === "0" || branchId === "0") {
Swal.fire({
icon: 'warning',
title: 'Please select both cluster and system',
showConfirmButton: false,
timer: 2000
});
return;
}
var typeValue = 0;
var kValue = "";
if (selectedSystemname.includes("Master")) {
typeValue = 1;
kValue = selectedSystemname.split(": ")[1];
} else if (selectedSystemname.includes("Worker")) {
typeValue = 2;
kValue = selectedSystemname.split(": ")[1];
}
var systemxml = compath + "/" + custID + "/" + branchId + "/" + typeValue + "/Systems.xml";
$.ajax({
type: "POST",
url: "getsystemid.php",
data: { systemxml: systemxml, selectedSystemname: kValue },
success: function (response) {
var nextPage;
if (clickedButtonId === 'supportLink') {
nextPage = "CmdExcDisplay3.php";
} else if (clickedButtonId === 'supportLink2') {
nextPage = "configANDswUpdate_home.php";
}
var queryParams = "?productId=" + branchId + "&type=" + typeValue + "&j=" + response;
window.location.href = nextPage + queryParams;
},
error: function (xhr, status, error) {
console.error("Error calling getsystemid.php:", error);
}
});
}
// UI functions
function showSelectOptionsPopup(clickedButtonId) {
var popup = document.getElementById("selectOptionsPopup");
popup.classList.remove("hidden");
popup.classList.add("flex");
var submitButton = document.getElementById("submitButton");
submitButton.setAttribute("data-button-id", clickedButtonId);
}
function closeSelectOptionsPopup() {
var popup = document.getElementById("selectOptionsPopup");
popup.classList.add("hidden");
popup.classList.remove("flex");
}
function toggleContactDialog() {
var overlay = document.getElementById("dialogOverlay");
if (overlay.classList.contains("hidden")) {
overlay.classList.remove("hidden");
overlay.classList.add("flex");
} else {
closeContactDialog();
}
}
function closeContactDialog() {
var overlay = document.getElementById("dialogOverlay");
overlay.classList.add("hidden");
overlay.classList.remove("flex");
}
function redirectToNeridio() {
window.location.href = "https://neridio.com";
}
function showLogoutConfirmation() {
Swal.fire({
title: 'Are you sure?',
text: 'You will be logged out of your account.',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#166534',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, logout!',
cancelButtonText: 'Cancel'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = 'CDTLogout.php';
}
});
}
function toggleSidebar() {
var sidebar = document.querySelector('.sidebar');
sidebar.classList.toggle('open');
}
// Close sidebar when clicking outside on mobile
document.addEventListener('click', function(event) {
var sidebar = document.querySelector('.sidebar');
var toggleButton = event.target.closest('button');
if (window.innerWidth <= 768 && !sidebar.contains(event.target) && !toggleButton) {
sidebar.classList.remove('open');
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment