682 lines
No EOL
32 KiB
HTML
682 lines
No EOL
32 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">
|
||
|
||
<!-- Custom styles for this page -->
|
||
<link href="theme/vendor/datatables/dataTables.bootstrap4.min.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"><a href="#" id="remoteBreadCrumb"></a></li>
|
||
<li class="breadcrumb-item active" aria-current="page" id="instancesBreadCrumb"></li>
|
||
</ol>
|
||
</nav>
|
||
|
||
<div class="row">
|
||
|
||
<div class="col-12">
|
||
<!-- Instance List -->
|
||
<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">Instances</h6>
|
||
<div class="dropdown no-arrow">
|
||
<a class="dropdown-toggle mr-2" href="#" data-toggle="modal" data-target="#createInstanceModal" title="New Instance" aria-hidden="true">
|
||
<i class="fas fa-plus fa-sm fa-fw"></i> Instance</a>
|
||
</div>
|
||
</div>
|
||
<!-- Card Body -->
|
||
<div class="card-body">
|
||
<div class="table-responsive">
|
||
<table class="table" id="instanceListTable" width="100%" cellspacing="0">
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- End Instance List -->
|
||
</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>
|
||
|
||
<!-- Create Instance Modal-->
|
||
<div class="modal fade" id="createInstanceModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog modal-lg" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title" id="exampleModalLabel">Create Instance</h5>
|
||
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||
<li class="nav-item">
|
||
<a class="nav-link active" id="form-tab" data-toggle="tab" href="#form" role="tab" aria-controls="form" aria-selected="true">Form</a>
|
||
</li>
|
||
<li class="nav-item">
|
||
<a class="nav-link" id="json-tab" data-toggle="tab" href="#json" role="tab" aria-controls="json" aria-selected="false">JSON</a>
|
||
</li>
|
||
</ul>
|
||
<div class="tab-content" id="myTabContent">
|
||
<div class="tab-pane fade show active" id="form" role="tabpanel" aria-labelledby="form-tab">
|
||
<br />
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Name: </label>
|
||
<div class="col-9">
|
||
<div class="form-group">
|
||
<input type="text" id="instanceNameInput" class="form-control" required="required" placeholder="Enter name of instance" name="name">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Type:</label>
|
||
<div class="col-9 text-right">
|
||
<div class="form-group">
|
||
<select id="selectTypeInput" onchange="changeImageInput()" class="form-control" name="type">
|
||
<option value="container" selected>container</option>
|
||
<option value="virtual-machine">virtual-machine</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Image: </label>
|
||
<div class="col-9">
|
||
<div class="form-group">
|
||
<select id="selectImageInput" class="form-control" name="fingerprint">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Profile: </label>
|
||
<div class="col-9">
|
||
<div class="form-group">
|
||
<select id="selectProfileInput" class="form-control" name="profile">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Instance Type: </label>
|
||
<div class="col-9">
|
||
<div class="form-group">
|
||
<select id="selectInstanceTypeInput" class="form-control" name="instance_type">
|
||
<option value="none" selected>none</option>
|
||
<option disabled>--- AWS Instance Types ---</option>
|
||
<option value="aws:c1.medium">c1.medium</option>
|
||
<option value="aws:c1.xlarge">c1.xlarge</option>
|
||
<option value="aws:c3.2xlarge">c3.2xlarge</option>
|
||
<option value="aws:c3.4xlarge">c3.4xlarge</option>
|
||
<option value="aws:c3.8xlarge">c3.8xlarge</option>
|
||
<option value="aws:c3.large">c3.large</option>
|
||
<option value="aws:c3.xlarge">c3.xlarge</option>
|
||
<option value="aws:c4.2xlarge">c4.2xlarge</option>
|
||
<option value="aws:c4.4xlarge">c4.4xlarge</option>
|
||
<option value="aws:c4.8xlarge">c4.8xlarge</option>
|
||
<option value="aws:c4.large">c4.large</option>
|
||
<option value="aws:c4.xlarge">c4.xlarge</option>
|
||
<option value="aws:c5.large">c5.large</option>
|
||
<option value="aws:c5.xlarge">c5.xlarge</option>
|
||
<option value="aws:c5.2xlarge">c5.2xlarge</option>
|
||
<option value="aws:c5.4xlarge">c5.4xlarge</option>
|
||
<option value="aws:c5.9xlarge">c5.9xlarge</option>
|
||
<option value="aws:c5.18xlarge">c5.18xlarge</option>
|
||
<option value="aws:cc2.8xlarge">cc2.8xlarge</option>
|
||
<option value="aws:cg1.4xlarge">cg1.4xlarge</option>
|
||
<option value="aws:cr1.8xlarge">cr1.8xlarge</option>
|
||
<option value="aws:d2.xlarge">d2.xlarge</option>
|
||
<option value="aws:d2.2xlarge">d2.2xlarge</option>
|
||
<option value="aws:d2.4xlarge">d2.4xlarge</option>
|
||
<option value="aws:d2.8xlarge">d2.8xlarge</option>
|
||
<option value="aws:f1.2xlarge">f1.2xlarge</option>
|
||
<option value="aws:f1.16xlarge">f1.16xlarge</option>
|
||
<option value="aws:g2.2xlarge">g2.2xlarge</option>
|
||
<option value="aws:g2.8xlarge">g2.8xlarge</option>
|
||
<option value="aws:g3.4xlarge">g3.4xlarge</option>
|
||
<option value="aws:g3.8xlarge">g3.8xlarge</option>
|
||
<option value="aws:g3.16xlarge">g3.16xlarge</option>
|
||
<option value="aws:hi1.4xlarge">hi1.4xlarge</option>
|
||
<option value="aws:hs1.8xlarge">hs1.8xlarge</option>
|
||
<option value="aws:i2.xlarge">i2.xlarge</option>
|
||
<option value="aws:i2.2xlarge">i2.2xlarge</option>
|
||
<option value="aws:i2.4xlarge">i2.4xlarge</option>
|
||
<option value="aws:i2.8xlarge">i2.8xlarge</option>
|
||
<option value="aws:i3.large">i3.large</option>
|
||
<option value="aws:i3.xlarge">i3.xlarge</option>
|
||
<option value="aws:i3.2xlarge">i3.2xlarge</option>
|
||
<option value="aws:i3.4xlarge">i3.4xlarge</option>
|
||
<option value="aws:i3.8xlarge">i3.8xlarge</option>
|
||
<option value="aws:i3.16xlarge">i3.16xlarge</option>
|
||
<option value="aws:m1.small">m1.small</option>
|
||
<option value="aws:m1.medium">m1.medium</option>
|
||
<option value="aws:m1.large">m1.large</option>
|
||
<option value="aws:m1.xlarge">m1.xlarge</option>
|
||
<option value="aws:m2.xlarge">m2.xlarge</option>
|
||
<option value="aws:m2.2xlarge">m2.2xlarge</option>
|
||
<option value="aws:m2.4xlarge">m2.4xlarge</option>
|
||
<option value="aws:m3.medium">m3.medium</option>
|
||
<option value="aws:m3.large">m3.large</option>
|
||
<option value="aws:m3.xlarge">m3.xlarge</option>
|
||
<option value="aws:m3.2xlarge">m3.2xlarge</option>
|
||
<option value="aws:m4.large">m4.large</option>
|
||
<option value="aws:m4.xlarge">m4.xlarge</option>
|
||
<option value="aws:m4.2xlarge">m4.2xlarge</option>
|
||
<option value="aws:m4.4xlarge">m4.4xlarge</option>
|
||
<option value="aws:m4.10xlarge">m4.10xlarge</option>
|
||
<option value="aws:m4.16xlarge">m4.16xlarge</option>
|
||
<option value="aws:p2.xlarge">p2.xlarge</option>
|
||
<option value="aws:p2.8xlarge">p2.8xlarge</option>
|
||
<option value="aws:p2.16xlarge">p2.16xlarge</option>
|
||
<option value="aws:r3.large">r3.large</option>
|
||
<option value="aws:r3.xlarge">r3.xlarge</option>
|
||
<option value="aws:r3.2xlarge">r3.2xlarge</option>
|
||
<option value="aws:r3.4xlarge">r3.4xlarge</option>
|
||
<option value="aws:r3.8xlarge">r3.8xlarge</option>
|
||
<option value="aws:r4.large">r4.large</option>
|
||
<option value="aws:r4.xlarge">r4.xlarge</option>
|
||
<option value="aws:r4.2xlarge">r4.2xlarge</option>
|
||
<option value="aws:r4.4xlarge">r4.4xlarge</option>
|
||
<option value="aws:r4.8xlarge">r4.8xlarge</option>
|
||
<option value="aws:r4.16xlarge">r4.16xlarge</option>
|
||
<option value="aws:t1.micro">t1.micro</option>
|
||
<option value="aws:t2.nano">t2.nano</option>
|
||
<option value="aws:t2.micro">t2.micro</option>
|
||
<option value="aws:t2.small">t2.small</option>
|
||
<option value="aws:t2.medium">t2.medium</option>
|
||
<option value="aws:t2.large">t2.large</option>
|
||
<option value="aws:t2.xlarge">t2.xlarge</option>
|
||
<option value="aws:t2.2xlarge">t2.2xlarge</option>
|
||
<option value="aws:t3.nano">t3.nano</option>
|
||
<option value="aws:t3.micro">t3.micro</option>
|
||
<option value="aws:t3.small">t3.small</option>
|
||
<option value="aws:t3.medium">t3.medium</option>
|
||
<option value="aws:t3.large">t3.large</option>
|
||
<option value="aws:t3.xlarge">t3.xlarge</option>
|
||
<option value="aws:t3.2xlarge">t3.2xlarge</option>
|
||
<option value="aws:x1.16xlarge">x1.16xlarge</option>
|
||
<option value="aws:x1.32xlarge">x1.32xlarge</option>
|
||
<option disabled>--- Azure Instance Types ---</option>
|
||
<option value="azure:A5">A5</option>
|
||
<option value="azure:A6">A6</option>
|
||
<option value="azure:A7">A7</option>
|
||
<option value="azure:A8">A8</option>
|
||
<option value="azure:A9">A9</option>
|
||
<option value="azure:A10">A10</option>
|
||
<option value="azure:A11">A11</option>
|
||
<option value="azure:ExtraSmall">ExtraSmall</option>
|
||
<option value="azure:Small">Small</option>
|
||
<option value="azure:Medium">Medium</option>
|
||
<option value="azure:Large">Large</option>
|
||
<option value="azure:ExtraLarge">ExtraLarge</option>
|
||
<option value="azure:Standard_A1_v2">Standard_A1_v2</option>
|
||
<option value="azure:Standard_A2m_v2">Standard_A2m_v2</option>
|
||
<option value="azure:Standard_A2_v2">Standard_A2_v2</option>
|
||
<option value="azure:Standard_A4m_v2">Standard_A4m_v2</option>
|
||
<option value="azure:Standard_A4_v2">Standard_A4_v2</option>
|
||
<option value="azure:Standard_A8m_v2">Standard_A8m_v2</option>
|
||
<option value="azure:Standard_A8_v2">Standard_A8_v2</option>
|
||
<option value="azure:Standard_D1">Standard_D1</option>
|
||
<option value="azure:Standard_D1_v2">Standard_D1_v2</option>
|
||
<option value="azure:Standard_D2">Standard_D2</option>
|
||
<option value="azure:Standard_D2_v2">Standard_D2_v2</option>
|
||
<option value="azure:Standard_D3">Standard_D3</option>
|
||
<option value="azure:Standard_D3_v2">Standard_D3_v2</option>
|
||
<option value="azure:Standard_D4">Standard_D4</option>
|
||
<option value="azure:Standard_D4_v2">Standard_D4_v2</option>
|
||
<option value="azure:Standard_D5_v2">Standard_D5_v2</option>
|
||
<option value="azure:Standard_D11">Standard_D11</option>
|
||
<option value="azure:Standard_D11_v2">Standard_D11_v2</option>
|
||
<option value="azure:Standard_D12">Standard_D12</option>
|
||
<option value="azure:Standard_D12_v2">Standard_D12_v2</option>
|
||
<option value="azure:Standard_D13">Standard_D13</option>
|
||
<option value="azure:Standard_D13_v2">Standard_D13_v2</option>
|
||
<option value="azure:Standard_D14">Standard_D14</option>
|
||
<option value="azure:Standard_D14_v2">Standard_D14_v2</option>
|
||
<option value="azure:Standard_D15_v2">Standard_D15_v2</option>
|
||
<option value="azure:Standard_G1">Standard_G1</option>
|
||
<option value="azure:Standard_G2">Standard_G2</option>
|
||
<option value="azure:Standard_G3">Standard_G3</option>
|
||
<option value="azure:Standard_G4">Standard_G4</option>
|
||
<option value="azure:Standard_G5">Standard_G5</option>
|
||
<option value="azure:Standard_H8">Standard_H8</option>
|
||
<option value="azure:Standard_H8m">Standard_H8m</option>
|
||
<option value="azure:Standard_H16">Standard_H16</option>
|
||
<option value="azure:Standard_H16m">Standard_H16m</option>
|
||
<option value="azure:Standard_H16mr">Standard_H16mr</option>
|
||
<option value="azure:Standard_H16r">Standard_H16r</option>
|
||
<option disabled>--- GCE Instance Types ---</option>
|
||
<option value="gce:f1-micro">f1-micro</option>
|
||
<option value="gce:g1-small">g1-small</option>
|
||
<option value="gce:n1-highcpu-2">n1-highcpu-2</option>
|
||
<option value="gce:n1-highcpu-4">n1-highcpu-4</option>
|
||
<option value="gce:n1-highcpu-8">n1-highcpu-8</option>
|
||
<option value="gce:n1-highcpu-16">n1-highcpu-16</option>
|
||
<option value="gce:n1-highcpu-32">n1-highcpu-32</option>
|
||
<option value="gce:n1-highcpu-64">n1-highcpu-64</option>
|
||
<option value="gce:n1-highmem-2">n1-highmem-2</option>
|
||
<option value="gce:n1-highmem-4">n1-highmem-4</option>
|
||
<option value="gce:n1-highmem-8">n1-highmem-8</option>
|
||
<option value="gce:n1-highmem-16">n1-highmem-16</option>
|
||
<option value="gce:n1-highmem-32">n1-highmem-32</option>
|
||
<option value="gce:n1-highmem-64">n1-highmem-64</option>
|
||
<option value="gce:n1-standard-1">n1-standard-1</option>
|
||
<option value="gce:n1-standard-2">n1-standard-2</option>
|
||
<option value="gce:n1-standard-4">n1-standard-4</option>
|
||
<option value="gce:n1-standard-8">n1-standard-8</option>
|
||
<option value="gce:n1-standard-16">n1-standard-16</option>
|
||
<option value="gce:n1-standard-32">n1-standard-32</option>
|
||
<option value="gce:n1-standard-64">n1-standard-64</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="row">
|
||
<label class="col-2 col-form-label text-right">Location: </label>
|
||
<div class="col-9">
|
||
<div class="form-group">
|
||
<select id="selectLocationInput" class="form-control" name="location">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
|
||
<a class="btn btn-primary" href="#" onclick="createInstance()" data-dismiss="modal">Ok</a>
|
||
</div>
|
||
</div>
|
||
<div class="tab-pane fade" id="json" role="tabpanel" aria-labelledby="json-tab">
|
||
<br />
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="form-group text-right">
|
||
<pre>
|
||
<textarea name="json" class="form-control" id="jsonCreateInput" rows="16" placeholder="Enter JSON data"></textarea>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
|
||
<a class="btn btn-primary" href="#" onclick="createInstanceJson()" data-dismiss="modal">Submit</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 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/datatables/jquery.dataTables.min.js"></script>
|
||
<script src="theme/vendor/datatables/dataTables.bootstrap4.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) + "&project=" + encodeURI(projectName), 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(){
|
||
$('#instanceListTable').DataTable().ajax.reload(null, false);
|
||
}
|
||
|
||
function loadPageContent(){
|
||
|
||
//Check Authorization
|
||
$.get("./php/auth/auth-check.php", function (data) {
|
||
if(data != "true"){
|
||
window.location.replace("../index.html");
|
||
}
|
||
});
|
||
|
||
$('#instanceListTable').DataTable( {
|
||
ajax: "./php/lxd/instance-list.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName),
|
||
columns: [
|
||
{},
|
||
{ title: "Name" },
|
||
{ title: "OS" },
|
||
{ title: "Location" },
|
||
{ title: "IPv4" },
|
||
{ title: "IPv6" },
|
||
{ title: "Type" },
|
||
{ title: "Memory" },
|
||
{ title: "Root Disk" },
|
||
{ title: "Status" },
|
||
{ title: "Action" }
|
||
],
|
||
order: [],
|
||
columnDefs: [
|
||
{ targets: 0, orderable: false, width: "25px" }
|
||
]
|
||
});
|
||
|
||
//Check for any running operations
|
||
operationStatusCheck();
|
||
|
||
//Set the page content to reload in 5 seconds
|
||
setInterval(() => { reloadPageContent(); }, 5000);
|
||
}
|
||
|
||
function createInstance(){
|
||
var instanceName = $("#instanceNameInput").val();
|
||
var profileName = $("#selectProfileInput").val();
|
||
var fingerprint = $("#selectImageInput").val();
|
||
var type = $("#selectTypeInput").val();
|
||
var instanceType = $("#selectInstanceTypeInput").val();
|
||
var location = $("#selectLocationInput").val();
|
||
console.log("Info: creating instance " + instanceName + " with profile " + profileName + ", fingerprint " + fingerprint + ", and location " + location);
|
||
$.get("./php/lxd/instances.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&name=" + encodeURI(instanceName) + "&profile=" + encodeURI(profileName) + "&fingerprint=" + encodeURI(fingerprint) + "&type=" + encodeURI(type) + "&instance_type=" + encodeURI(instanceType) + "&location=" + encodeURI(location) + "&action=createInstance", function (data) {
|
||
var operationData = JSON.parse(data);
|
||
console.log(operationData);
|
||
if (operationData.status_code == 100 && operationData.metadata.status_code < 400){
|
||
operationStatusCheck();
|
||
}
|
||
if (operationData.metadata.status_code >= 400){
|
||
alert(operationData.metadata.err);
|
||
}
|
||
if (operationData.error_code >= 400){
|
||
alert(operationData.error);
|
||
}
|
||
setTimeout(() => { reloadPageContent(); }, 1000);
|
||
});
|
||
}
|
||
|
||
function createInstanceJson(){
|
||
var instanceCreateJSON = $("#jsonCreateInput").val();
|
||
console.log("Info: creating instance");
|
||
$.post("./php/lxd/instances.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&action=createInstanceJson", {json: instanceCreateJSON}, function (data) {
|
||
var operationData = JSON.parse(data);
|
||
console.log(operationData);
|
||
if (operationData.error_code >= 400){
|
||
alert(operationData.error);
|
||
}
|
||
setTimeout(() => { reloadPageContent(); }, 1000);
|
||
});
|
||
}
|
||
|
||
function startInstance(instanceName){
|
||
console.log("Info: starting instance " + instanceName);
|
||
$.get("./php/lxd/instances.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&instance=" + encodeURI(instanceName) + "&action=startInstance", function (data) {
|
||
var operationData = JSON.parse(data);
|
||
console.log(operationData);
|
||
if (operationData.status_code == 100 && operationData.metadata.status_code < 400){
|
||
operationStatusCheck();
|
||
}
|
||
if (operationData.metadata.status_code >= 400){
|
||
alert(operationData.metadata.err);
|
||
}
|
||
setTimeout(() => { reloadPageContent(); }, 1000);
|
||
});
|
||
}
|
||
|
||
function stopInstance(instanceName){
|
||
console.log("Info: stoping instance " + instanceName);
|
||
$.get("./php/lxd/instances.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName) + "&instance=" + encodeURI(instanceName) + "&action=stopInstance", function (data) {
|
||
var operationData = JSON.parse(data);
|
||
console.log(operationData);
|
||
if (operationData.status_code == 100 && operationData.metadata.status_code < 400){
|
||
operationStatusCheck();
|
||
}
|
||
if (operationData.metadata.status_code >= 400){
|
||
alert(operationData.metadata.err);
|
||
}
|
||
setTimeout(() => { reloadPageContent(); }, 1000);
|
||
});
|
||
}
|
||
|
||
//If use creates a new instance load the images based on container or virtual-machine selection
|
||
function changeImageInput(){
|
||
var imageType = $("#selectTypeInput").val();
|
||
$("#selectImageInput").load("./php/lxd/image-list-select.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName)+ "&image_type=" + encodeURI(imageType));
|
||
}
|
||
|
||
$(document).ready(function(){
|
||
|
||
//Load in the sidebar
|
||
$("#sidebarLinks").load("./sidebar.html");
|
||
|
||
//Setup Page Breadcrumb Links/Information
|
||
$('#remoteBreadCrumb').load("./php/lxd/remote-breadcrumb.php?remote=" + encodeURI(remoteName));
|
||
$('#remoteBreadCrumb').attr("href", "host.html?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName));
|
||
$('#instancesBreadCrumb').text("instances");
|
||
|
||
//Load the card contents
|
||
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);
|
||
});
|
||
|
||
//Populate the select options fields used in modals
|
||
$("#selectProfileInput").load("./php/lxd/profile-list-select.php?remote=" + encodeURI(remoteName) + "&project=" + encodeURI(projectName));
|
||
$("#selectLocationInput").load("./php/lxd/cluster-list-select.php?remote=" + encodeURI(remoteName) + "&include_none=true");
|
||
|
||
//Populate initial list of images available for container
|
||
changeImageInput();
|
||
|
||
});
|
||
|
||
</script>
|
||
|
||
</html> |