-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
197 lines (163 loc) · 6.79 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>V-Shark Dashboard</title>
<meta content="" name="description">
<meta content="" name="keywords">
<!-- Favicons -->
<link href="assets/img/favicon.png" rel="icon">
<link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&family=Poppins:wght@100;200;400;500;600;700&family=Space+Mono:wght@400;700&display=swap" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="header fixed-top d-flex align-items-center">
<div class="d-flex align-items-center justify-content-between">
<a href="index.html" class="logo d-flex align-items-center">
<img src="assets/img/logo.png" alt="">
<span class="d-none d-lg-block">V-Shark</span>
</a>
</div>
<nav class="header-nav ms-auto">
<a class="nav-link collapsed" data-bs-target="#forms-nav" data-bs-toggle="collapse" href="#" style="color:#cfe0ff;">
<i class="bi bi-box-arrow-right"></i>
<span>Sign Out</span>
</a>
</nav>
</header>
<!-- End Header -->
<!-- =========//// Main Canvas ////========== -->
<main id="main" class="main">
<div class="pagetitle">
<h1>Dashboard</h1>
</div><!-- End Page Title -->
<section class="section dashboard mt-5">
<div class="row">
<!-- Left side columns -->
<div class="col-lg-12">
<div class="row">
<!--Stats Card -->
<div class="col-xxl-6 col-md-6">
<div class="card info-card sales-card">
<div class="card-body">
<div class="d-flex align-items-center card-content">
<h1 class="card-stats" id="machineCount"></h1>
</div>
<h5 class="card-title">Total Devices <br><span class="card-flag">[ Installed ]</span></h5>
</div>
</div>
</div>
<!-- End Stats Card -->
<!--Stats Card -->
<div class="col-xxl-6 col-md-6">
<div class="card info-card sales-card">
<div class="card-body">
<div class="d-flex align-items-center card-content">
<h1 class="card-stats" id="avgVscore"></h1>
</div>
<h5 class="card-title">V - Score <br><span class="card-flag">[ Average of all Devices ]</span></h5>
</div>
</div>
</div>
<!-- End Stats Card -->
</div>
</div>
<!-- End Left side columns -->
<div class="col-lg-12">
<div class="row">
<div class="col-lg-9">
<div class="search-bar">
<form class="search-form d-flex align-items-center" method="POST" action=".">
<input type="text" name="query" placeholder="Search" title="Enter search keyword">
<button type="submit" title="Search"><i class="bi bi-search"></i></button>
</form>
</div><!-- End Search Bar -->
</div>
<div class="col-lg-3">
<div class="col-sm-12">
<select class="form-select" aria-label="Default select example">
<option selected>Select Machine Type</option>
<option value="1">Windows 7</option>
<option value="2">Windows 8</option>
<option value="3">Windows 10</option>
<option value="3">Windows 11</option>
</select>
</div>
</div>
</div>
</div>
<div class="col-lg-12 results-container" id="resultsContainer">
</div>
</div>
</section>
</main><!-- End #main -->
<!-- ======= Footer ======= -->
<footer id="footer" class="footer">
<div class="copyright">
© 2022 Copyright <strong><span>V Shark</span></strong> | Developed by Team JSA
</div>
<div class="credits">
</div>
</footer><!-- End Footer -->
<a href="#" class="back-to-top d-flex align-items-center justify-content-center"><i class="bi bi-arrow-up-short"></i></a>
<!-- Vendor JS Files -->
<script src="assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Template Main JS File -->
<script src="assets/js/main.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script>
$(document).ready(function () {
$.getJSON("https://v-shark.herokuapp.com/data",function (data) {
var machineCount = 0;
var totalvscore = 0;
var avgVscore = 0;
$.each(data, function (key, value) {
var machine = '';
machine= `
<div class="card machine-card">
<div class="card-header machine-name">
<h5>${value.machinename}</h5>
</div>
<div class="machine-card-body">
<div class="section os">
<p class="section-flag">Operating System</p>
<h6>${value.osname}</h6>
</div>
<div class="section mac">
<p class="section-flag">Mac Address</p>
<h6>${value.mac}</h6>
</div>
<div class="section ip">
<p class="section-flag">Local IP Address</p>
<h6>${value.ip}</h6>
</div>
<div class="action">
<a href="machine.html?mac=${value.mac}"><i class="bi bi-chevron-compact-right"></i></a>
</div>
</div>
</div>
`;
//count total machines
machineCount += 1;
document.getElementById('machineCount').innerHTML = machineCount;
//count average V-score
totalvscore += parseInt(value.vscore);
avgVscore = (totalvscore / machineCount);
document.getElementById('avgVscore').innerHTML = Math.round(avgVscore);
$('#resultsContainer').append(machine);
});
});
});
</script>
</body>
</html>