448 lines
No EOL
18 KiB
HTML
448 lines
No EOL
18 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
|
||
<head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||
<meta name="description" content="">
|
||
<meta name="author" content="">
|
||
|
||
<link rel="icon" type="image/png" href="theme/images/logo_light.png">
|
||
|
||
<title>lxdware - dashboard</title>
|
||
|
||
<!-- Custom fonts for this template-->
|
||
<link href="theme/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
|
||
<link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">
|
||
|
||
<!-- Custom styles for this template-->
|
||
<link href="theme/css/sb-admin-2.css" rel="stylesheet">
|
||
|
||
</head>
|
||
|
||
<body id="page-top">
|
||
|
||
<!-- Page Wrapper -->
|
||
<div id="wrapper">
|
||
|
||
<!-- Sidebar -->
|
||
<ul class="navbar-nav bg-gradient-dark sidebar sidebar-dark accordion" id="accordionSidebar">
|
||
|
||
<div id="sidebarLinks"></div>
|
||
|
||
<!-- Divider -->
|
||
<hr class="sidebar-divider d-none d-md-block">
|
||
|
||
<!-- Sidebar Toggler (Sidebar) -->
|
||
<div class="text-center d-none d-md-inline">
|
||
<button class="rounded-circle border-0" id="sidebarToggle"></button>
|
||
</div>
|
||
</ul>
|
||
<!-- End of Sidebar -->
|
||
|
||
|
||
<!-- Content Wrapper -->
|
||
<div id="content-wrapper" class="d-flex flex-column">
|
||
|
||
<!-- Main Content -->
|
||
<div id="content">
|
||
|
||
<!-- Topbar -->
|
||
<nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">
|
||
|
||
<!-- Sidebar Toggle (Topbar) -->
|
||
<button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
|
||
<i class="fa fa-bars"></i>
|
||
</button>
|
||
|
||
|
||
<!-- Topbar Notification -->
|
||
<div class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
|
||
<ul class="navbar-nav ml-auto">
|
||
|
||
<li>
|
||
<div class="nav-item spinner-border m-3" role="status" style="display:none;" id="spinner">
|
||
<span class="nav-item sr-only">Loading...</span>
|
||
</div>
|
||
</li>
|
||
|
||
<li class="nav-item dropdown no-arrow" id="notificationArea" style="display: none;">
|
||
<div class="nav-link dropdown-toggle">
|
||
<span id="notification" class="mr-2 d-none d-lg-inline text-gray-600">Notification</span>
|
||
</div>
|
||
</li>
|
||
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
<!-- Topbar Navbar -->
|
||
<ul class="navbar-nav ml-auto">
|
||
|
||
<li class="nav-item dropdown" id="remoteListNav">
|
||
</li>
|
||
|
||
<li class="nav-item dropdown" id="projectListNav">
|
||
</li>
|
||
|
||
<div class="topbar-divider d-none d-sm-block"></div>
|
||
|
||
<!-- Nav Item - User Information -->
|
||
<li class="nav-item dropdown no-arrow">
|
||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||
<span class="mr-2 d-none d-lg-inline text-gray-600">Admin</span>
|
||
</a>
|
||
<!-- Dropdown - User Information -->
|
||
<div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
|
||
<a class="dropdown-item" href="index.html">
|
||
<i class="fas fa-server fa-sm fa-fw mr-2 text-gray-400"></i>
|
||
Hosts
|
||
</a>
|
||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#aboutModal">
|
||
<i class="fas fa-info-circle fa-sm fa-fw mr-2 text-gray-400"></i>
|
||
About
|
||
</a>
|
||
<a class="dropdown-item" href="#" onclick="logout()">
|
||
<i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
|
||
Logout
|
||
</a>
|
||
</div>
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</nav>
|
||
<!-- End of Topbar -->
|
||
|
||
<!-- Begin Page Content -->
|
||
<div class="container-fluid">
|
||
|
||
<!-- BreadCrumb -->
|
||
<nav aria-label="breadcrumb">
|
||
<ol class="breadcrumb">
|
||
<li class="breadcrumb-item active" aria-current="page" id="remoteBreadCrumb"></li>
|
||
</ol>
|
||
</nav>
|
||
|
||
<div class="row">
|
||
|
||
<div class="col-12">
|
||
<!-- Host Details -->
|
||
<div class="card shadow mb-4">
|
||
<!-- Card Header - Dropdown -->
|
||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
||
<h6 class="m-0 font-weight-bold text-primary">Host Details</h6>
|
||
<div class="dropdown no-arrow">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Instance Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="instanceCard">
|
||
<!-- Instance Card -->
|
||
<i class="mb-2 fas fa-cube fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Instances:</strong></h5>
|
||
0 out of 0 running
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Instance Details -->
|
||
</div>
|
||
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Image Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="imageCard">
|
||
<!-- Image Card -->
|
||
<i class="mb-2 fas fa-box-open fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Images:</strong></h5>
|
||
0 images available
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Image Details -->
|
||
</div>
|
||
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Cluster Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="clusterCard">
|
||
<!-- Cluster Card -->
|
||
<i class="mb-2 fas fa-project-diagram fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Cluster:</strong></h5>
|
||
0 out of 0 online
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Cluster Details -->
|
||
</div>
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Project Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="projectCard">
|
||
<!-- Project Card -->
|
||
<i class="mb-2 fas fa-chart-bar fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Projects:</strong></h5>
|
||
0 project environments
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Project Details -->
|
||
</div>
|
||
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Network Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="networkCard">
|
||
<!-- Network Card -->
|
||
<i class="mb-2 fas fa-network-wired fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Networks:</strong></h5>
|
||
0 network interfaces
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Network Details -->
|
||
</div>
|
||
|
||
<div class="col-xl-2 col-lg-4 col-md-6 col-sm-12">
|
||
<!-- Storage Details -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Body -->
|
||
<div class="card-body text-center">
|
||
<div id="storageCard">
|
||
<!-- Storage Card -->
|
||
<i class="mb-2 fas fa-hdd fa-5x fa-fw" style="color:#cccccc"></i>
|
||
<div class="media-body">
|
||
<h5 class="mt-0 mb-1"><strong>Storage Pools:</strong></h5>
|
||
0 dedicated storage pools
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Storage Details -->
|
||
</div>
|
||
|
||
<div class="col-sm-12 col-md-6">
|
||
<!-- LXD Information -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Header - Dropdown -->
|
||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
||
<h6 class="m-0 font-weight-bold text-primary">LXD Information</h6>
|
||
</div>
|
||
<!-- Card Body -->
|
||
<div class="card-body">
|
||
<div id="lxdCard">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End LXD Information -->
|
||
</div>
|
||
|
||
<div class="col-sm-12 col-md-6">
|
||
<!-- Resource Information -->
|
||
<div class="card mb-4 border-0">
|
||
<!-- Card Header - Dropdown -->
|
||
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
|
||
<h6 class="m-0 font-weight-bold text-primary">Resource Information</h6>
|
||
</div>
|
||
<!-- Card Body -->
|
||
<div class="card-body">
|
||
<div id="sysCard">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Resource Information -->
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<!-- End Host Details -->
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<!-- /.container-fluid -->
|
||
</div>
|
||
<!-- End of Main Content -->
|
||
|
||
<!-- Footer -->
|
||
<footer class="sticky-footer bg-white">
|
||
<div class="container my-auto">
|
||
<div class="copyright text-center my-auto">
|
||
<span>Copyright © lxdware.com 2021</span>
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
<!-- End of Footer -->
|
||
|
||
</div>
|
||
<!-- End of Content Wrapper -->
|
||
|
||
</div>
|
||
<!-- End of Page Wrapper -->
|
||
|
||
<!-- Scroll to Top Button-->
|
||
<a class="scroll-to-top rounded" href="#page-top">
|
||
<i class="fas fa-angle-up"></i>
|
||
</a>
|
||
|
||
<!-- About Modal-->
|
||
<div class="modal fade" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title" id="exampleModalLabel">About LXDWARE Dashboard</h5>
|
||
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div id="about"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-secondary" type="button" data-dismiss="modal">Dismiss</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Bootstrap core JavaScript-->
|
||
<script src="theme/vendor/jquery/jquery.min.js"></script>
|
||
<script src="theme/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||
|
||
<!-- Core plugin JavaScript-->
|
||
<script src="theme/vendor/jquery-easing/jquery.easing.min.js"></script>
|
||
|
||
<!-- Custom scripts for all pages-->
|
||
<script src="theme/js/sb-admin-2.min.js"></script>
|
||
|
||
<!-- Page level plugins -->
|
||
<script src="theme/vendor/chart.js/Chart.min.js"></script>
|
||
|
||
</body>
|
||
|
||
<script>
|
||
const queryString = window.location.search;
|
||
const urlParams = new URLSearchParams(queryString);
|
||
const remoteName = urlParams.get('remote');
|
||
const projectName = urlParams.get('project');
|
||
|
||
function logout(){
|
||
var http = new XMLHttpRequest();
|
||
http.open("get", "../admin", false, "null", "null");
|
||
http.send("");
|
||
window.location.replace("../index.html");
|
||
}
|
||
|
||
function operationStatusCheck(){
|
||
//check to see if there are any running operations
|
||
$.get("./php/lxd/operation-status.php?remote=" + encodeURI(remoteName), function (data) {
|
||
//Check to see if we have running operations
|
||
if (data){
|
||
//Display spinner and notification area if there are running tasks
|
||
$('#spinner').show();
|
||
$('#notificationArea').show();
|
||
$('#notification').text(data);
|
||
//Set the page to check operations again in 1 second
|
||
setTimeout(() => { operationStatusCheck(); }, 1000);
|
||
}
|
||
else {
|
||
//Hide spinner and notification area if no running tasks
|
||
$('#spinner').hide();
|
||
$('#notificationArea').hide();
|
||
$('#notification').text("");
|
||
//Set the page to check operations again in 3 seconds
|
||
setTimeout(() => { operationStatusCheck(); }, 3000);
|
||
}
|
||
});
|
||
}
|
||
|
||
function reloadPageContent() {
|
||
|
||
$("#instanceCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=instanceInfo");
|
||
$("#imageCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=imageInfo");
|
||
$("#networkCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=networkInfo");
|
||
$("#storageCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=storageInfo");
|
||
$("#sysCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=sysInfo");
|
||
$("#projectCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=projectInfo");
|
||
$("#clusterCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=clusterInfo");
|
||
|
||
//On some servers the Driver/Driver Version field keep alternating. No need to refresh this data
|
||
//$("#lxdCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=lxdInfo");
|
||
}
|
||
|
||
function loadPageContent(){
|
||
|
||
$("#sidebarLinks").load("./sidebar.html");
|
||
|
||
$('#remoteBreadCrumb').load("./php/lxd/remote-breadcrumb.php?remote=" + encodeURI(remoteName));
|
||
|
||
$("#instanceCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=instanceInfo");
|
||
$("#imageCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=imageInfo");
|
||
$("#networkCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=networkInfo");
|
||
$("#storageCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=storageInfo");
|
||
$("#sysCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=sysInfo");
|
||
$("#projectCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=projectInfo");
|
||
$("#clusterCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=clusterInfo");
|
||
$("#lxdCard").load("./php/lxd/hosts.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=lxdInfo");
|
||
|
||
//Check for any running operations
|
||
operationStatusCheck();
|
||
|
||
//Set the page content to reload in 5 seconds
|
||
setInterval(() => { reloadPageContent(); }, 5000);
|
||
}
|
||
|
||
$(document).ready(function(){
|
||
|
||
//Check Authorization
|
||
$.get("./php/auth/auth-check.php", function (data) {
|
||
if(data != "true"){
|
||
window.location.replace("../index.html");
|
||
}
|
||
});
|
||
|
||
//Load Page Content
|
||
loadPageContent();
|
||
|
||
$("#remoteListNav").load("./php/lxd/remote-list-nav.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName));
|
||
$("#projectListNav").load("./php/lxd/project-list-nav.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName));
|
||
|
||
//Load the about info for the about modal
|
||
$.get("./about.html", function (data) {
|
||
$("#about").html(data);
|
||
});
|
||
|
||
});
|
||
|
||
</script>
|
||
|
||
</html> |