|
@@ -9,37 +9,45 @@ include_once '../auth.php';
|
|
<script src="../script/ao_module.js"></script>
|
|
<script src="../script/ao_module.js"></script>
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.6, shrink-to-fit=no">
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.6, shrink-to-fit=no">
|
|
<style>
|
|
<style>
|
|
|
|
+ body{
|
|
|
|
+ overflow-y: hidden;
|
|
|
|
+ }
|
|
.item{
|
|
.item{
|
|
text-align: center;
|
|
text-align: center;
|
|
}
|
|
}
|
|
.ts.mini.input{
|
|
.ts.mini.input{
|
|
padding: .48571em 1em;
|
|
padding: .48571em 1em;
|
|
}
|
|
}
|
|
|
|
+ .ts.horizontal.form .field.field>label{
|
|
|
|
+ top: 0.5em;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
<div class="ts tabbed menu" id="menu">
|
|
<div class="ts tabbed menu" id="menu">
|
|
</div>
|
|
</div>
|
|
<div class="ts grid">
|
|
<div class="ts grid">
|
|
- <div class="sixteen wide column"><h3 class="ts center aligned header" id="drivename">INTEL SSDSC2BW240H6 240.0GB</h3></div>
|
|
|
|
|
|
+ <div class="sixteen wide column"><h3 class="ts center aligned header" id="drivename" data-tooltip="">----</h3></div>
|
|
<div class="sixteen wide column">
|
|
<div class="sixteen wide column">
|
|
<div class="ts narrow container">
|
|
<div class="ts narrow container">
|
|
<div class="ts grid">
|
|
<div class="ts grid">
|
|
<div class="two wide column">
|
|
<div class="two wide column">
|
|
- <h5 class="ts center aligned header">Health Status</h5>
|
|
|
|
- <div class="ts inverted primary card">
|
|
|
|
- <div class="content">
|
|
|
|
- <div class="header" style="text-align: center;" id="health_status">Good</div>
|
|
|
|
- <div class="description" style="text-align: center;" id="health_prec">
|
|
|
|
- 95%
|
|
|
|
|
|
+ <div class="tablet or large device only">
|
|
|
|
+ <h5 class="ts center aligned header">Health Status</h5>
|
|
|
|
+ <div class="ts card" id="health_c">
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div class="header" style="text-align: center;" id="health_status">----</div>
|
|
|
|
+ <div class="description" style="text-align: center;" id="health_prec">
|
|
|
|
+ ----
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <h5 class="ts center aligned header">Temperture</h5>
|
|
|
|
- <div class="ts inverted primary card">
|
|
|
|
- <div class="content">
|
|
|
|
- <div class="description" style="text-align: center;" id="temperture">
|
|
|
|
- 25C
|
|
|
|
|
|
+ <h5 class="ts center aligned header">Temperature</h5>
|
|
|
|
+ <div class="ts card" id="temperature_c">
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div class="description" style="text-align: center;" id="temperature">
|
|
|
|
+
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -52,15 +60,15 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Firmware</label>
|
|
<label style="color:black">Firmware</label>
|
|
- <input id="firmware" class="ts mini input" style="color:black" type="text" value="RG21"></input>
|
|
|
|
|
|
+ <input id="firmware" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="eight wide column">
|
|
<div class="eight wide column">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
- <label id="col1" style="color:black">Total Host Reads</label>
|
|
|
|
- <input id="col1_v" class="ts mini input" style="color:black" type="text" value="22507GB"></input>
|
|
|
|
|
|
+ <label id="col1" style="color:black">----</label>
|
|
|
|
+ <input id="col1_v" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -72,15 +80,15 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Serial Number</label>
|
|
<label style="color:black">Serial Number</label>
|
|
- <input id="serial" class="ts mini input" style="color:black" type="text" value="CVTR505030T240CGN"></input>
|
|
|
|
|
|
+ <input id="serial" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="eight wide column">
|
|
<div class="eight wide column">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
- <label id="col2" style="color:black">Total Host Writes</label>
|
|
|
|
- <input id="col2_v" class="ts mini input" style="color:black" type="text" value="18517GB"></input>
|
|
|
|
|
|
+ <label id="col2" style="color:black">----</label>
|
|
|
|
+ <input id="col2_v" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -92,15 +100,15 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Interface</label>
|
|
<label style="color:black">Interface</label>
|
|
- <input id="interface" class="ts mini input" style="color:black" type="text" value="Serial ATA"></input>
|
|
|
|
|
|
+ <input id="interface" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="eight wide column">
|
|
<div class="eight wide column">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
- <label id="col3" style="color:black">Total NAND Writes</label>
|
|
|
|
- <input id="col3_v" class="ts mini input" style="color:black" type="text" value="77840GB"></input>
|
|
|
|
|
|
+ <label id="col3" style="color:black">----</label>
|
|
|
|
+ <input id="col3_v" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -112,7 +120,7 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Transfer Mode</label>
|
|
<label style="color:black">Transfer Mode</label>
|
|
- <input id="transfer" class="ts mini input" style="color:black" type="text" value="SATA/600 | SATA/600"></input>
|
|
|
|
|
|
+ <input id="transfer" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -120,7 +128,7 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Power On Count</label>
|
|
<label style="color:black">Power On Count</label>
|
|
- <input id="powercount" class="ts mini input" style="color:black" type="text" value="3816 count"></input>
|
|
|
|
|
|
+ <input id="powercount" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -132,7 +140,7 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Drive Letter</label>
|
|
<label style="color:black">Drive Letter</label>
|
|
- <input id="driveleter" class="ts mini input" style="color:black" type="text" value="C:"></input>
|
|
|
|
|
|
+ <input id="driveleter" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -140,7 +148,7 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Power On Hours</label>
|
|
<label style="color:black">Power On Hours</label>
|
|
- <input id="powerhour" class="ts mini input" style="color:black" type="text" value="1834 hours"></input>
|
|
|
|
|
|
+ <input id="powerhour" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -151,25 +159,16 @@ include_once '../auth.php';
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="ts horizontal form" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<div class="disabled field" style="opacity: 1;">
|
|
<label style="color:black">Standard</label>
|
|
<label style="color:black">Standard</label>
|
|
- <input id="standard" class="ts mini input" style="color:black" type="text" value="ACS-3 | ----"></input>
|
|
|
|
|
|
+ <input id="standard" class="ts mini input" style="color:black" type="text" value="----"></input>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="sixteen wide column">
|
|
|
|
- <div class="ts horizontal form" style="opacity: 1;">
|
|
|
|
- <div class="disabled field" style="opacity: 1;">
|
|
|
|
- <label style="color:black">Features</label>
|
|
|
|
- <input id="features" class="ts mini input" style="color:black" type="text" value="S.M.A.R.T., APM, NCQ, TRIM, DevSleep"></input>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div class="sixteen wide column">
|
|
|
|
|
|
+ <div class="sixteen wide column" style="height: 37vh;overflow-y: scroll;right: 5px;">
|
|
<br>
|
|
<br>
|
|
<div class="ts narrow container">
|
|
<div class="ts narrow container">
|
|
<table class="ts very basic table">
|
|
<table class="ts very basic table">
|
|
@@ -186,26 +185,52 @@ include_once '../auth.php';
|
|
</thead>
|
|
</thead>
|
|
<tbody id="tbody">
|
|
<tbody id="tbody">
|
|
</tbody>
|
|
</tbody>
|
|
- </table>
|
|
|
|
|
|
+ </table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</body>
|
|
<script>
|
|
<script>
|
|
var active = "<?php echo isset($_GET["drive"])?$_GET["drive"]:"" ?>";
|
|
var active = "<?php echo isset($_GET["drive"])?$_GET["drive"]:"" ?>";
|
|
|
|
+var smartstat = [];
|
|
|
|
+
|
|
|
|
+if(ao_module_virtualDesktop){
|
|
|
|
+ ao_module_setWindowSize(980,580);
|
|
|
|
+}
|
|
|
|
+
|
|
$.get( "opr.php?opr=scan", function( data ) {
|
|
$.get( "opr.php?opr=scan", function( data ) {
|
|
var arr = JSON.parse(data);
|
|
var arr = JSON.parse(data);
|
|
|
|
+ if(active == ""){
|
|
|
|
+ window.location = "index.php?drive=" + arr["devices"][0]["info_name"];
|
|
|
|
+ }
|
|
$(arr["devices"]).each(function(index, element) {
|
|
$(arr["devices"]).each(function(index, element) {
|
|
- if(active == element["info_name"]){
|
|
|
|
- $( "#menu" ).append('<a class="active item" href="?drive=' + element["info_name"] + '">' + smartok(element["info_name"]) + '<br>29C<br>' + element["info_name"] + '</a>');
|
|
|
|
- }else{
|
|
|
|
- $( "#menu" ).append('<a class="item" href="?drive=' + element["info_name"] + '">' + smartok(element["info_name"]) + '<br>29C<br>' + element["info_name"] + '</a>');
|
|
|
|
- }
|
|
|
|
|
|
+ $.get( "opr.php?opr=info&drive=" + element["info_name"], function( data ) {
|
|
|
|
+ if(data.length > 0){
|
|
|
|
+ var table = JSON.parse(data);
|
|
|
|
+ if(table["ata_smart_attributes"]["table"].length > 0){
|
|
|
|
+ $(table["ata_smart_attributes"]["table"]).each(function(tindex, telement) {
|
|
|
|
+ if(telement["when_failed"] == ""){
|
|
|
|
+ smartstat[element["info_name"]] = "Good";
|
|
|
|
+ }else{
|
|
|
|
+ smartstat[element["info_name"]] = "Warning";
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ smartstat[element["info_name"]] = "Unknown";
|
|
|
|
+ }
|
|
|
|
+ if(active == element["info_name"]){
|
|
|
|
+ $( "#menu" ).append('<a class="active item" href="?drive=' + element["info_name"] + '">' + smartstat[element["info_name"]] + '<br>' + table["temperature"]["current"] + '°C<br>' + element["info_name"] + '</a>');
|
|
|
|
+ }else{
|
|
|
|
+ $( "#menu" ).append('<a class="item" href="?drive=' + element["info_name"] + '">' + smartstat[element["info_name"]] + '<br>' + table["temperature"]["current"] + '°C<br>' + element["info_name"] + '</a>');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
$.get( "opr.php?opr=info&drive=" + active, function( data ) {
|
|
$.get( "opr.php?opr=info&drive=" + active, function( data ) {
|
|
var arr = JSON.parse(data);
|
|
var arr = JSON.parse(data);
|
|
- $("#drivename").html(arr["model_family"] + " " + arr["model_name"] + " " + formatSizeUnits(arr["user_capacity"]["bytes"]));
|
|
|
|
|
|
+ $("#drivename").html(arr["model_name"] + " " + formatSizeUnits(arr["user_capacity"]["bytes"]));
|
|
|
|
+ $("#drivename").attr("data-tooltip",arr["model_family"]);
|
|
$("#firmware").attr("value",arr["firmware_version"]);
|
|
$("#firmware").attr("value",arr["firmware_version"]);
|
|
$("#serial").attr("value",arr["serial_number"]);
|
|
$("#serial").attr("value",arr["serial_number"]);
|
|
$("#interface").attr("value",arr["device"]["protocol"]);
|
|
$("#interface").attr("value",arr["device"]["protocol"]);
|
|
@@ -232,29 +257,54 @@ $.get( "opr.php?opr=info&drive=" + active, function( data ) {
|
|
}
|
|
}
|
|
$("#powercount").attr("value",arr["power_cycle_count"] + " count");
|
|
$("#powercount").attr("value",arr["power_cycle_count"] + " count");
|
|
$("#powerhour").attr("value",arr["power_on_time"]["hours"] + " hours");
|
|
$("#powerhour").attr("value",arr["power_on_time"]["hours"] + " hours");
|
|
|
|
+ smartstat[active] = "Unknown";
|
|
$(arr["ata_smart_attributes"]["table"]).each(function(index, element) {
|
|
$(arr["ata_smart_attributes"]["table"]).each(function(index, element) {
|
|
if(element["when_failed"] == ""){
|
|
if(element["when_failed"] == ""){
|
|
var stat = "OK";
|
|
var stat = "OK";
|
|
}else{
|
|
}else{
|
|
var stat = "Failed";
|
|
var stat = "Failed";
|
|
|
|
+ //smartstat[active] = "Warning";
|
|
}
|
|
}
|
|
$("#tbody").append('<tr><td>' + stat + '</td><td>' + element["id"] + '</td><td>' + element["name"] + '</td><td>' + element["value"] + '</td><td>' + element["worst"] + '</td><td>' + element["thresh"] + '</td><td>' + element["raw"]["value"] + '</td></tr>');
|
|
$("#tbody").append('<tr><td>' + stat + '</td><td>' + element["id"] + '</td><td>' + element["name"] + '</td><td>' + element["value"] + '</td><td>' + element["worst"] + '</td><td>' + element["thresh"] + '</td><td>' + element["raw"]["value"] + '</td></tr>');
|
|
|
|
+
|
|
|
|
+ if(element["name"] == "SSD_Life_Left"){
|
|
|
|
+ $("#health_prec").html(element["value"] + "%");
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+ /*
|
|
|
|
+ if(smartstat[active] == "Unknown"){
|
|
|
|
+ smartstat[active] = "Good";
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+ if(smartstat[active] == "Warning"){
|
|
|
|
+ $("#health_c").attr("class","ts inverted warning card");
|
|
|
|
+ }else if(smartstat[active] == "Good"){
|
|
|
|
+ $("#health_c").attr("class","ts inverted primary card");
|
|
|
|
+ }else if(smartstat[active] == "Unknown"){
|
|
|
|
+ $("#health_c").attr("class","ts card");
|
|
|
|
+ }
|
|
|
|
+ if(arr["temperature"]["current"] > 40){
|
|
|
|
+ $("#temperature_c").attr("class","ts inverted warning card");
|
|
|
|
+ }else if(arr["temperature"]["current"] > 0 && arr["temperature"]["current"] < 40){
|
|
|
|
+ $("#temperature_c").attr("class","ts inverted primary card");
|
|
|
|
+ }else{
|
|
|
|
+ $("#temperature_c").attr("class","ts card");
|
|
|
|
+ }
|
|
|
|
+ $("#health_status").html(smartstat[active]);
|
|
|
|
+ $("#temperature").html(arr["temperature"]["current"] + "°C");
|
|
});
|
|
});
|
|
|
|
|
|
-function smartok(drive){
|
|
|
|
- return "Good";
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
//from https://stackoverflow.com/questions/5501427/php-filesize-mb-kb-conversion/5501447
|
|
//from https://stackoverflow.com/questions/5501427/php-filesize-mb-kb-conversion/5501447
|
|
function formatSizeUnits(bytes)
|
|
function formatSizeUnits(bytes)
|
|
{
|
|
{
|
|
- if(bytes >= 1000000000){
|
|
|
|
- bytes = Math.round(bytes / 1000000000,2) + 'GB';
|
|
|
|
|
|
+ if(bytes >= 1000000000000){
|
|
|
|
+ bytes = Math.round(bytes / 1000000000000) + 'TB';
|
|
|
|
+ }else if(bytes >= 1000000000){
|
|
|
|
+ bytes = Math.round(bytes / 1000000000) + 'GB';
|
|
}else if (bytes >= 1000000){
|
|
}else if (bytes >= 1000000){
|
|
- bytes = Math.round(bytes / 1000000,2) + 'MB';
|
|
|
|
|
|
+ bytes = Math.round(bytes / 1000000) + 'MB';
|
|
}else if (bytes >= 1000){
|
|
}else if (bytes >= 1000){
|
|
- bytes = Math.round(bytes / 1000,2) + 'KB';
|
|
|
|
|
|
+ bytes = Math.round(bytes / 1000) + 'KB';
|
|
}else if (bytes > 1){
|
|
}else if (bytes > 1){
|
|
bytes = bytes + 'bytes';
|
|
bytes = bytes + 'bytes';
|
|
}else if (bytes == 1){
|
|
}else if (bytes == 1){
|