fix using linter.

pull/307/head
Jason Kulatunga 2 years ago
parent 8a1ae2ffa0
commit 46f3b1c02c

@ -21,10 +21,10 @@ export class TreoConfigService
{
let currentScrutinyConfig = defaultConfig
let localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY)
const localConfigStr = localStorage.getItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY)
if (localConfigStr){
//check localstorage for a value
let localConfig = JSON.parse(localConfigStr)
// check localstorage for a value
const localConfig = JSON.parse(localConfigStr)
currentScrutinyConfig = Object.assign({}, currentScrutinyConfig, localConfig) // make sure defaults are available if missing from localStorage.
}
// Set the private defaults
@ -38,20 +38,20 @@ export class TreoConfigService
/**
* Setter and getter for config
*/
//Setter
// Setter
set config(value: any)
{
// Merge the new config over to the current config
let config = _.merge({}, this._config.getValue(), value);
const config = _.merge({}, this._config.getValue(), value);
//Store the config in localstorage
// Store the config in localstorage
localStorage.setItem(SCRUTINY_CONFIG_LOCAL_STORAGE_KEY, JSON.stringify(config));
// Execute the observable
this._config.next(config);
}
//Getter
// Getter
get config$(): Observable<any>
{
return this._config.asObservable();

@ -1,7 +1,7 @@
import { Layout } from "app/layout/layout.types";
import { Layout } from 'app/layout/layout.types';
// Theme type
export type Theme = "light" | "dark" | "system";
export type Theme = 'light' | 'dark' | 'system';
/**
* AppConfig interface. Update this interface to strictly type your config
@ -28,12 +28,12 @@ export interface AppConfig
* "ConfigService".
*/
export const appConfig: AppConfig = {
theme : "light",
layout: "material",
theme : 'light',
layout: 'material',
dashboardDisplay: "name",
dashboardSort: "status",
dashboardDisplay: 'name',
dashboardSort: 'status',
temperatureUnit: "celsius",
temperatureUnit: 'celsius',
};

@ -1,264 +1,264 @@
export const sda = {
"data": {
"device": {
"CreatedAt": "2021-06-24T21:17:31.301226-07:00",
"UpdatedAt": "2021-10-24T16:37:56.981833-07:00",
"DeletedAt": null,
"wwn": "0x5002538e40a22954",
"device_name": "sda",
"manufacturer": "ATA",
"model_name": "Samsung_SSD_860_EVO_500GB",
"interface_type": "SCSI",
"interface_speed": "",
"serial_number": "S3YZNB0KBXXXXXX",
"firmware": "002C",
"rotational_speed": 0,
"capacity": 500107862016,
"form_factor": "",
"smart_support": false,
"device_protocol": "NVMe",
"device_type": "",
"label": "",
"host_id": "",
"device_status": 0
'data': {
'device': {
'CreatedAt': '2021-06-24T21:17:31.301226-07:00',
'UpdatedAt': '2021-10-24T16:37:56.981833-07:00',
'DeletedAt': null,
'wwn': '0x5002538e40a22954',
'device_name': 'sda',
'manufacturer': 'ATA',
'model_name': 'Samsung_SSD_860_EVO_500GB',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': 'S3YZNB0KBXXXXXX',
'firmware': '002C',
'rotational_speed': 0,
'capacity': 500107862016,
'form_factor': '',
'smart_support': false,
'device_protocol': 'NVMe',
'device_type': '',
'label': '',
'host_id': '',
'device_status': 0
},
"smart_results": [{
"date": "2021-10-24T23:20:44Z",
"device_wwn": "0x5002538e40a22954",
"device_protocol": "NVMe",
"temp": 36,
"power_on_hours": 2401,
"power_cycle_count": 266,
"attrs": {
"available_spare": {
"attribute_id": "available_spare",
"value": 100,
"thresh": 10,
"transformed_value": 0,
"status": 0
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5002538e40a22954',
'device_protocol': 'NVMe',
'temp': 36,
'power_on_hours': 2401,
'power_cycle_count': 266,
'attrs': {
'available_spare': {
'attribute_id': 'available_spare',
'value': 100,
'thresh': 10,
'transformed_value': 0,
'status': 0
},
"controller_busy_time": {
"attribute_id": "controller_busy_time",
"value": 3060,
"thresh": -1,
"transformed_value": 0,
"status": 0
'controller_busy_time': {
'attribute_id': 'controller_busy_time',
'value': 3060,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"critical_comp_time": {
"attribute_id": "critical_comp_time",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'critical_comp_time': {
'attribute_id': 'critical_comp_time',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"critical_warning": {
"attribute_id": "critical_warning",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'critical_warning': {
'attribute_id': 'critical_warning',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"data_units_read": {
"attribute_id": "data_units_read",
"value": 9511859,
"thresh": -1,
"transformed_value": 0,
"status": 0
'data_units_read': {
'attribute_id': 'data_units_read',
'value': 9511859,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"data_units_written": {
"attribute_id": "data_units_written",
"value": 7773431,
"thresh": -1,
"transformed_value": 0,
"status": 0
'data_units_written': {
'attribute_id': 'data_units_written',
'value': 7773431,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"host_reads": {
"attribute_id": "host_reads",
"value": 111303174,
"thresh": -1,
"transformed_value": 0,
"status": 0
'host_reads': {
'attribute_id': 'host_reads',
'value': 111303174,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"host_writes": {
"attribute_id": "host_writes",
"value": 83170961,
"thresh": -1,
"transformed_value": 0,
"status": 0
'host_writes': {
'attribute_id': 'host_writes',
'value': 83170961,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"media_errors": {
"attribute_id": "media_errors",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'media_errors': {
'attribute_id': 'media_errors',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"num_err_log_entries": {
"attribute_id": "num_err_log_entries",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'num_err_log_entries': {
'attribute_id': 'num_err_log_entries',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"percentage_used": {
"attribute_id": "percentage_used",
"value": 0,
"thresh": 100,
"transformed_value": 0,
"status": 0
'percentage_used': {
'attribute_id': 'percentage_used',
'value': 0,
'thresh': 100,
'transformed_value': 0,
'status': 0
},
"power_cycles": {
"attribute_id": "power_cycles",
"value": 266,
"thresh": -1,
"transformed_value": 0,
"status": 0
'power_cycles': {
'attribute_id': 'power_cycles',
'value': 266,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"power_on_hours": {
"attribute_id": "power_on_hours",
"value": 2401,
"thresh": -1,
"transformed_value": 0,
"status": 0
'power_on_hours': {
'attribute_id': 'power_on_hours',
'value': 2401,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"temperature": {
"attribute_id": "temperature",
"value": 36,
"thresh": -1,
"transformed_value": 0,
"status": 0
'temperature': {
'attribute_id': 'temperature',
'value': 36,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"unsafe_shutdowns": {
"attribute_id": "unsafe_shutdowns",
"value": 43,
"thresh": -1,
"transformed_value": 0,
"status": 0
'unsafe_shutdowns': {
'attribute_id': 'unsafe_shutdowns',
'value': 43,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"warning_temp_time": {
"attribute_id": "warning_temp_time",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'warning_temp_time': {
'attribute_id': 'warning_temp_time',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
}
},
"Status": 0
'Status': 0
}]
},
"metadata": {
"available_spare": {
"display_name": "Available Spare",
"ideal": "high",
"critical": true,
"description": "Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.",
"display_type": ""
'metadata': {
'available_spare': {
'display_name': 'Available Spare',
'ideal': 'high',
'critical': true,
'description': 'Contains a normalized percentage (0 to 100%) of the remaining spare capacity available.',
'display_type': ''
},
"controller_busy_time": {
"display_name": "Controller Busy Time",
"ideal": "",
"critical": false,
"description": "Contains the amount of time the controller is busy with I/O commands. The controller is busy when there is a command outstanding to an I/O Queue (specifically, a command was issued via an I/O Submission Queue Tail doorbell write and the corresponding completion queue entry has not been posted yet to the associated I/O Completion Queue). This value is reported in minutes.",
"display_type": ""
'controller_busy_time': {
'display_name': 'Controller Busy Time',
'ideal': '',
'critical': false,
'description': 'Contains the amount of time the controller is busy with I/O commands. The controller is busy when there is a command outstanding to an I/O Queue (specifically, a command was issued via an I/O Submission Queue Tail doorbell write and the corresponding completion queue entry has not been posted yet to the associated I/O Completion Queue). This value is reported in minutes.',
'display_type': ''
},
"critical_comp_time": {
"display_name": "Critical CompTime",
"ideal": "",
"critical": false,
"description": "Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure.",
"display_type": ""
'critical_comp_time': {
'display_name': 'Critical CompTime',
'ideal': '',
'critical': false,
'description': 'Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure.',
'display_type': ''
},
"critical_warning": {
"display_name": "Critical Warning",
"ideal": "low",
"critical": true,
"description": "This field indicates critical warnings for the state of the controller. Each bit corresponds to a critical warning type; multiple bits may be set. If a bit is cleared to 0, then that critical warning does not apply. Critical warnings may result in an asynchronous event notification to the host. Bits in this field represent the current associated state and are not persistent.",
"display_type": ""
'critical_warning': {
'display_name': 'Critical Warning',
'ideal': 'low',
'critical': true,
'description': 'This field indicates critical warnings for the state of the controller. Each bit corresponds to a critical warning type; multiple bits may be set. If a bit is cleared to 0, then that critical warning does not apply. Critical warnings may result in an asynchronous event notification to the host. Bits in this field represent the current associated state and are not persistent.',
'display_type': ''
},
"data_units_read": {
"display_name": "Data Units Read",
"ideal": "",
"critical": false,
"description": "Contains the number of 512 byte data units the host has read from the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes read) and is rounded up. When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data read to 512 byte units.",
"display_type": ""
'data_units_read': {
'display_name': 'Data Units Read',
'ideal': '',
'critical': false,
'description': 'Contains the number of 512 byte data units the host has read from the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes read) and is rounded up. When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data read to 512 byte units.',
'display_type': ''
},
"data_units_written": {
"display_name": "Data Units Written",
"ideal": "",
"critical": false,
"description": "Contains the number of 512 byte data units the host has written to the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes written) and is rounded up. When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data written to 512 byte units.",
"display_type": ""
'data_units_written': {
'display_name': 'Data Units Written',
'ideal': '',
'critical': false,
'description': 'Contains the number of 512 byte data units the host has written to the controller; this value does not include metadata. This value is reported in thousands (i.e., a value of 1 corresponds to 1000 units of 512 bytes written) and is rounded up. When the LBA size is a value other than 512 bytes, the controller shall convert the amount of data written to 512 byte units.',
'display_type': ''
},
"host_reads": {
"display_name": "Host Reads",
"ideal": "",
"critical": false,
"description": "Contains the number of read commands completed by the controller",
"display_type": ""
'host_reads': {
'display_name': 'Host Reads',
'ideal': '',
'critical': false,
'description': 'Contains the number of read commands completed by the controller',
'display_type': ''
},
"host_writes": {
"display_name": "Host Writes",
"ideal": "",
"critical": false,
"description": "Contains the number of write commands completed by the controller",
"display_type": ""
'host_writes': {
'display_name': 'Host Writes',
'ideal': '',
'critical': false,
'description': 'Contains the number of write commands completed by the controller',
'display_type': ''
},
"media_errors": {
"display_name": "Media Errors",
"ideal": "low",
"critical": true,
"description": "Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.",
"display_type": ""
'media_errors': {
'display_name': 'Media Errors',
'ideal': 'low',
'critical': true,
'description': 'Contains the number of occurrences where the controller detected an unrecovered data integrity error. Errors such as uncorrectable ECC, CRC checksum failure, or LBA tag mismatch are included in this field.',
'display_type': ''
},
"num_err_log_entries": {
"display_name": "Numb Err Log Entries",
"ideal": "low",
"critical": true,
"description": "Contains the number of Error Information log entries over the life of the controller.",
"display_type": ""
'num_err_log_entries': {
'display_name': 'Numb Err Log Entries',
'ideal': 'low',
'critical': true,
'description': 'Contains the number of Error Information log entries over the life of the controller.',
'display_type': ''
},
"percentage_used": {
"display_name": "Percentage Used",
"ideal": "low",
"critical": true,
"description": "Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturers prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).",
"display_type": ""
'percentage_used': {
'display_name': 'Percentage Used',
'ideal': 'low',
'critical': true,
'description': 'Contains a vendor specific estimate of the percentage of NVM subsystem life used based on the actual usage and the manufacturers prediction of NVM life. A value of 100 indicates that the estimated endurance of the NVM in the NVM subsystem has been consumed, but may not indicate an NVM subsystem failure. The value is allowed to exceed 100. Percentages greater than 254 shall be represented as 255. This value shall be updated once per power-on hour (when the controller is not in a sleep state).',
'display_type': ''
},
"power_cycles": {
"display_name": "Power Cycles",
"ideal": "",
"critical": false,
"description": "Contains the number of power cycles.",
"display_type": ""
'power_cycles': {
'display_name': 'Power Cycles',
'ideal': '',
'critical': false,
'description': 'Contains the number of power cycles.',
'display_type': ''
},
"power_on_hours": {
"display_name": "Power on Hours",
"ideal": "",
"critical": false,
"description": "Contains the number of power-on hours. Power on hours is always logging, even when in low power mode.",
"display_type": ""
'power_on_hours': {
'display_name': 'Power on Hours',
'ideal': '',
'critical': false,
'description': 'Contains the number of power-on hours. Power on hours is always logging, even when in low power mode.',
'display_type': ''
},
"temperature": {
"display_name": "Temperature",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'temperature': {
'display_name': 'Temperature',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"unsafe_shutdowns": {
"display_name": "Unsafe Shutdowns",
"ideal": "",
"critical": false,
"description": "Contains the number of unsafe shutdowns. This count is incremented when a shutdown notification (CC.SHN) is not received prior to loss of power.",
"display_type": ""
'unsafe_shutdowns': {
'display_name': 'Unsafe Shutdowns',
'ideal': '',
'critical': false,
'description': 'Contains the number of unsafe shutdowns. This count is incremented when a shutdown notification (CC.SHN) is not received prior to loss of power.',
'display_type': ''
},
"warning_temp_time": {
"display_name": "Warning Temp Time",
"ideal": "",
"critical": false,
"description": "Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure.",
"display_type": ""
'warning_temp_time': {
'display_name': 'Warning Temp Time',
'ideal': '',
'critical': false,
'description': 'Contains the amount of time in minutes that the controller is operational and the Composite Temperature is greater than or equal to the Warning Composite Temperature Threshold (WCTEMP) field and less than the Critical Composite Temperature Threshold (CCTEMP) field in the Identify Controller data structure.',
'display_type': ''
}
},
"success": true
'success': true
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,222 +1,222 @@
export const sdd = {
"data": {
"device": {
"CreatedAt": "2021-06-24T21:17:31.30374-07:00",
"UpdatedAt": "2021-10-24T16:37:57.013758-07:00",
"DeletedAt": null,
"wwn": "0x5000cca252c859cc",
"device_name": "sdd",
"manufacturer": "ATA",
"model_name": "WDC_WD80EFAX-68LHPN0",
"interface_type": "SCSI",
"interface_speed": "",
"serial_number": "7SGLXXXXX",
"firmware": "",
"rotational_speed": 0,
"capacity": 8001563222016,
"form_factor": "",
"smart_support": false,
"device_protocol": "SCSI",
"device_type": "",
"label": "",
"host_id": "",
"device_status": 0
'data': {
'device': {
'CreatedAt': '2021-06-24T21:17:31.30374-07:00',
'UpdatedAt': '2021-10-24T16:37:57.013758-07:00',
'DeletedAt': null,
'wwn': '0x5000cca252c859cc',
'device_name': 'sdd',
'manufacturer': 'ATA',
'model_name': 'WDC_WD80EFAX-68LHPN0',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': '7SGLXXXXX',
'firmware': '',
'rotational_speed': 0,
'capacity': 8001563222016,
'form_factor': '',
'smart_support': false,
'device_protocol': 'SCSI',
'device_type': '',
'label': '',
'host_id': '',
'device_status': 0
},
"smart_results": [{
"date": "2021-10-24T23:20:44Z",
"device_wwn": "0x5000cca252c859cc",
"device_protocol": "SCSI",
"temp": 34,
"power_on_hours": 43549,
"power_cycle_count": 0,
"attrs": {
"read_correction_algorithm_invocations": {
"attribute_id": "read_correction_algorithm_invocations",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca252c859cc',
'device_protocol': 'SCSI',
'temp': 34,
'power_on_hours': 43549,
'power_cycle_count': 0,
'attrs': {
'read_correction_algorithm_invocations': {
'attribute_id': 'read_correction_algorithm_invocations',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_eccdelayed": {
"attribute_id": "read_errors_corrected_by_eccdelayed",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_eccdelayed': {
'attribute_id': 'read_errors_corrected_by_eccdelayed',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_eccfast": {
"attribute_id": "read_errors_corrected_by_eccfast",
"value": 300357663,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_eccfast': {
'attribute_id': 'read_errors_corrected_by_eccfast',
'value': 300357663,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_rereads_rewrites": {
"attribute_id": "read_errors_corrected_by_rereads_rewrites",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_rereads_rewrites': {
'attribute_id': 'read_errors_corrected_by_rereads_rewrites',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"read_total_errors_corrected": {
"attribute_id": "read_total_errors_corrected",
"value": 300357663,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_total_errors_corrected': {
'attribute_id': 'read_total_errors_corrected',
'value': 300357663,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_total_uncorrected_errors": {
"attribute_id": "read_total_uncorrected_errors",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'read_total_uncorrected_errors': {
'attribute_id': 'read_total_uncorrected_errors',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"scsi_grown_defect_list": {
"attribute_id": "scsi_grown_defect_list",
"value": 56,
"thresh": 0,
"transformed_value": 0,
"status": 0
'scsi_grown_defect_list': {
'attribute_id': 'scsi_grown_defect_list',
'value': 56,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"write_correction_algorithm_invocations": {
"attribute_id": "write_correction_algorithm_invocations",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_correction_algorithm_invocations': {
'attribute_id': 'write_correction_algorithm_invocations',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_eccdelayed": {
"attribute_id": "write_errors_corrected_by_eccdelayed",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_eccdelayed': {
'attribute_id': 'write_errors_corrected_by_eccdelayed',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_eccfast": {
"attribute_id": "write_errors_corrected_by_eccfast",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_eccfast': {
'attribute_id': 'write_errors_corrected_by_eccfast',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_rereads_rewrites": {
"attribute_id": "write_errors_corrected_by_rereads_rewrites",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_rereads_rewrites': {
'attribute_id': 'write_errors_corrected_by_rereads_rewrites',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"write_total_errors_corrected": {
"attribute_id": "write_total_errors_corrected",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_total_errors_corrected': {
'attribute_id': 'write_total_errors_corrected',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_total_uncorrected_errors": {
"attribute_id": "write_total_uncorrected_errors",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'write_total_uncorrected_errors': {
'attribute_id': 'write_total_uncorrected_errors',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
}
},
"Status": 0
'Status': 0
}]
},
"metadata": {
"read_correction_algorithm_invocations": {
"display_name": "Read Correction Algorithm Invocations",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'metadata': {
'read_correction_algorithm_invocations': {
'display_name': 'Read Correction Algorithm Invocations',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_eccdelayed": {
"display_name": "Read Errors Corrected by ECC Delayed",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_errors_corrected_by_eccdelayed': {
'display_name': 'Read Errors Corrected by ECC Delayed',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_eccfast": {
"display_name": "Read Errors Corrected by ECC Fast",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_errors_corrected_by_eccfast': {
'display_name': 'Read Errors Corrected by ECC Fast',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_rereads_rewrites": {
"display_name": "Read Errors Corrected by ReReads/ReWrites",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'read_errors_corrected_by_rereads_rewrites': {
'display_name': 'Read Errors Corrected by ReReads/ReWrites',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"read_total_errors_corrected": {
"display_name": "Read Total Errors Corrected",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_total_errors_corrected': {
'display_name': 'Read Total Errors Corrected',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_total_uncorrected_errors": {
"display_name": "Read Total Uncorrected Errors",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'read_total_uncorrected_errors': {
'display_name': 'Read Total Uncorrected Errors',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"scsi_grown_defect_list": {
"display_name": "Grown Defect List",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'scsi_grown_defect_list': {
'display_name': 'Grown Defect List',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"write_correction_algorithm_invocations": {
"display_name": "Write Correction Algorithm Invocations",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_correction_algorithm_invocations': {
'display_name': 'Write Correction Algorithm Invocations',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_eccdelayed": {
"display_name": "Write Errors Corrected by ECC Delayed",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_errors_corrected_by_eccdelayed': {
'display_name': 'Write Errors Corrected by ECC Delayed',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_eccfast": {
"display_name": "Write Errors Corrected by ECC Fast",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_errors_corrected_by_eccfast': {
'display_name': 'Write Errors Corrected by ECC Fast',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_rereads_rewrites": {
"display_name": "Write Errors Corrected by ReReads/ReWrites",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'write_errors_corrected_by_rereads_rewrites': {
'display_name': 'Write Errors Corrected by ReReads/ReWrites',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"write_total_errors_corrected": {
"display_name": "Write Total Errors Corrected",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_total_errors_corrected': {
'display_name': 'Write Total Errors Corrected',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_total_uncorrected_errors": {
"display_name": "Write Total Uncorrected Errors",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'write_total_uncorrected_errors': {
'display_name': 'Write Total Uncorrected Errors',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
}
},
"success": true
'success': true
}

@ -1,222 +1,222 @@
export const sde = {
"data": {
"device": {
"CreatedAt": "2021-06-24T21:17:31.304461-07:00",
"UpdatedAt": "2021-10-24T16:40:16.495248-07:00",
"DeletedAt": null,
"wwn": "0x5000cca264ebc248",
"device_name": "sde",
"manufacturer": "ATA",
"model_name": "WDC_WD140EDFZ-11A0VA0",
"interface_type": "SCSI",
"interface_speed": "",
"serial_number": "9RK3XXXXX",
"firmware": "",
"rotational_speed": 0,
"capacity": 14000519643136,
"form_factor": "",
"smart_support": false,
"device_protocol": "SCSI",
"device_type": "",
"label": "",
"host_id": "",
"device_status": 0
'data': {
'device': {
'CreatedAt': '2021-06-24T21:17:31.304461-07:00',
'UpdatedAt': '2021-10-24T16:40:16.495248-07:00',
'DeletedAt': null,
'wwn': '0x5000cca264ebc248',
'device_name': 'sde',
'manufacturer': 'ATA',
'model_name': 'WDC_WD140EDFZ-11A0VA0',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': '9RK3XXXXX',
'firmware': '',
'rotational_speed': 0,
'capacity': 14000519643136,
'form_factor': '',
'smart_support': false,
'device_protocol': 'SCSI',
'device_type': '',
'label': '',
'host_id': '',
'device_status': 0
},
"smart_results": [{
"date": "2021-10-24T23:20:44Z",
"device_wwn": "0x5000cca264ebc248",
"device_protocol": "SCSI",
"temp": 31,
"power_on_hours": 5675,
"power_cycle_count": 0,
"attrs": {
"read_correction_algorithm_invocations": {
"attribute_id": "read_correction_algorithm_invocations",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'smart_results': [{
'date': '2021-10-24T23:20:44Z',
'device_wwn': '0x5000cca264ebc248',
'device_protocol': 'SCSI',
'temp': 31,
'power_on_hours': 5675,
'power_cycle_count': 0,
'attrs': {
'read_correction_algorithm_invocations': {
'attribute_id': 'read_correction_algorithm_invocations',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_eccdelayed": {
"attribute_id": "read_errors_corrected_by_eccdelayed",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_eccdelayed': {
'attribute_id': 'read_errors_corrected_by_eccdelayed',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_eccfast": {
"attribute_id": "read_errors_corrected_by_eccfast",
"value": 1410362924,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_eccfast': {
'attribute_id': 'read_errors_corrected_by_eccfast',
'value': 1410362924,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_errors_corrected_by_rereads_rewrites": {
"attribute_id": "read_errors_corrected_by_rereads_rewrites",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'read_errors_corrected_by_rereads_rewrites': {
'attribute_id': 'read_errors_corrected_by_rereads_rewrites',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"read_total_errors_corrected": {
"attribute_id": "read_total_errors_corrected",
"value": 1410362924,
"thresh": -1,
"transformed_value": 0,
"status": 0
'read_total_errors_corrected': {
'attribute_id': 'read_total_errors_corrected',
'value': 1410362924,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"read_total_uncorrected_errors": {
"attribute_id": "read_total_uncorrected_errors",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'read_total_uncorrected_errors': {
'attribute_id': 'read_total_uncorrected_errors',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"scsi_grown_defect_list": {
"attribute_id": "scsi_grown_defect_list",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'scsi_grown_defect_list': {
'attribute_id': 'scsi_grown_defect_list',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"write_correction_algorithm_invocations": {
"attribute_id": "write_correction_algorithm_invocations",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_correction_algorithm_invocations': {
'attribute_id': 'write_correction_algorithm_invocations',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_eccdelayed": {
"attribute_id": "write_errors_corrected_by_eccdelayed",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_eccdelayed': {
'attribute_id': 'write_errors_corrected_by_eccdelayed',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_eccfast": {
"attribute_id": "write_errors_corrected_by_eccfast",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_eccfast': {
'attribute_id': 'write_errors_corrected_by_eccfast',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_errors_corrected_by_rereads_rewrites": {
"attribute_id": "write_errors_corrected_by_rereads_rewrites",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'write_errors_corrected_by_rereads_rewrites': {
'attribute_id': 'write_errors_corrected_by_rereads_rewrites',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
},
"write_total_errors_corrected": {
"attribute_id": "write_total_errors_corrected",
"value": 0,
"thresh": -1,
"transformed_value": 0,
"status": 0
'write_total_errors_corrected': {
'attribute_id': 'write_total_errors_corrected',
'value': 0,
'thresh': -1,
'transformed_value': 0,
'status': 0
},
"write_total_uncorrected_errors": {
"attribute_id": "write_total_uncorrected_errors",
"value": 0,
"thresh": 0,
"transformed_value": 0,
"status": 0
'write_total_uncorrected_errors': {
'attribute_id': 'write_total_uncorrected_errors',
'value': 0,
'thresh': 0,
'transformed_value': 0,
'status': 0
}
},
"Status": 0
'Status': 0
}]
},
"metadata": {
"read_correction_algorithm_invocations": {
"display_name": "Read Correction Algorithm Invocations",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'metadata': {
'read_correction_algorithm_invocations': {
'display_name': 'Read Correction Algorithm Invocations',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_eccdelayed": {
"display_name": "Read Errors Corrected by ECC Delayed",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_errors_corrected_by_eccdelayed': {
'display_name': 'Read Errors Corrected by ECC Delayed',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_eccfast": {
"display_name": "Read Errors Corrected by ECC Fast",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_errors_corrected_by_eccfast': {
'display_name': 'Read Errors Corrected by ECC Fast',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_errors_corrected_by_rereads_rewrites": {
"display_name": "Read Errors Corrected by ReReads/ReWrites",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'read_errors_corrected_by_rereads_rewrites': {
'display_name': 'Read Errors Corrected by ReReads/ReWrites',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"read_total_errors_corrected": {
"display_name": "Read Total Errors Corrected",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'read_total_errors_corrected': {
'display_name': 'Read Total Errors Corrected',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"read_total_uncorrected_errors": {
"display_name": "Read Total Uncorrected Errors",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'read_total_uncorrected_errors': {
'display_name': 'Read Total Uncorrected Errors',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"scsi_grown_defect_list": {
"display_name": "Grown Defect List",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'scsi_grown_defect_list': {
'display_name': 'Grown Defect List',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"write_correction_algorithm_invocations": {
"display_name": "Write Correction Algorithm Invocations",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_correction_algorithm_invocations': {
'display_name': 'Write Correction Algorithm Invocations',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_eccdelayed": {
"display_name": "Write Errors Corrected by ECC Delayed",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_errors_corrected_by_eccdelayed': {
'display_name': 'Write Errors Corrected by ECC Delayed',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_eccfast": {
"display_name": "Write Errors Corrected by ECC Fast",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_errors_corrected_by_eccfast': {
'display_name': 'Write Errors Corrected by ECC Fast',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_errors_corrected_by_rereads_rewrites": {
"display_name": "Write Errors Corrected by ReReads/ReWrites",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'write_errors_corrected_by_rereads_rewrites': {
'display_name': 'Write Errors Corrected by ReReads/ReWrites',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
},
"write_total_errors_corrected": {
"display_name": "Write Total Errors Corrected",
"ideal": "",
"critical": false,
"description": "",
"display_type": ""
'write_total_errors_corrected': {
'display_name': 'Write Total Errors Corrected',
'ideal': '',
'critical': false,
'description': '',
'display_type': ''
},
"write_total_uncorrected_errors": {
"display_name": "Write Total Uncorrected Errors",
"ideal": "low",
"critical": true,
"description": "",
"display_type": ""
'write_total_uncorrected_errors': {
'display_name': 'Write Total Uncorrected Errors',
'ideal': 'low',
'critical': true,
'description': '',
'display_type': ''
}
},
"success": true
'success': true
}

@ -1,29 +1,29 @@
export const sdf = {
"data": {
"device": {
"CreatedAt": "2021-06-24T21:17:31.305246-07:00",
"UpdatedAt": "2021-06-24T21:17:31.305246-07:00",
"DeletedAt": null,
"wwn": "0x50014ee20b2a72a9",
"device_name": "sdf",
"manufacturer": "ATA",
"model_name": "WDC_WD60EFRX-68MYMN1",
"interface_type": "SCSI",
"interface_speed": "",
"serial_number": "WD-WXL1HXXXXX",
"firmware": "",
"rotational_speed": 0,
"capacity": 6001175126016,
"form_factor": "",
"smart_support": false,
"device_protocol": "",
"device_type": "",
"label": "",
"host_id": "",
"device_status": 0
'data': {
'device': {
'CreatedAt': '2021-06-24T21:17:31.305246-07:00',
'UpdatedAt': '2021-06-24T21:17:31.305246-07:00',
'DeletedAt': null,
'wwn': '0x50014ee20b2a72a9',
'device_name': 'sdf',
'manufacturer': 'ATA',
'model_name': 'WDC_WD60EFRX-68MYMN1',
'interface_type': 'SCSI',
'interface_speed': '',
'serial_number': 'WD-WXL1HXXXXX',
'firmware': '',
'rotational_speed': 0,
'capacity': 6001175126016,
'form_factor': '',
'smart_support': false,
'device_protocol': '',
'device_type': '',
'label': '',
'host_id': '',
'device_status': 0
},
"smart_results": []
'smart_results': []
},
"metadata": null,
"success": true
'metadata': null,
'success': true
}

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
import { Component, OnInit, Inject } from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {DashboardDeviceDeleteDialogService} from "./dashboard-device-delete-dialog.service";
import {Subject} from "rxjs";
import {DashboardDeviceDeleteDialogService} from 'app/layout/common/dashboard-device-delete-dialog/dashboard-device-delete-dialog.service';
import {Subject} from 'rxjs';
@Component({
selector: 'app-dashboard-device-delete-dialog',

@ -9,18 +9,18 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { SharedModule } from 'app/shared/shared.module';
import {DashboardDeviceDeleteDialogComponent} from 'app/layout/common/dashboard-device-delete-dialog/dashboard-device-delete-dialog.component'
import { MatButtonToggleModule} from "@angular/material/button-toggle";
import {MatTabsModule} from "@angular/material/tabs";
import {MatSliderModule} from "@angular/material/slider";
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
import {MatTooltipModule} from "@angular/material/tooltip";
import {dashboardRoutes} from "../../../modules/dashboard/dashboard.routing";
import {MatDividerModule} from "@angular/material/divider";
import {MatMenuModule} from "@angular/material/menu";
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatSortModule} from "@angular/material/sort";
import {MatTableModule} from "@angular/material/table";
import {NgApexchartsModule} from "ng-apexcharts";
import { MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatTabsModule} from '@angular/material/tabs';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatTooltipModule} from '@angular/material/tooltip';
import {dashboardRoutes} from 'app/modules/dashboard/dashboard.routing';
import {MatDividerModule} from '@angular/material/divider';
import {MatMenuModule} from '@angular/material/menu';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatSortModule} from '@angular/material/sort';
import {MatTableModule} from '@angular/material/table';
import {NgApexchartsModule} from 'ng-apexcharts';
import { MatDialogModule } from '@angular/material/dialog';
@NgModule({

@ -1,13 +1,13 @@
import { Component, Input, Output, OnInit, EventEmitter} from '@angular/core';
import * as moment from "moment";
import {takeUntil} from "rxjs/operators";
import {AppConfig} from "app/core/config/app.config";
import {TreoConfigService} from "@treo/services/config";
import {Subject} from "rxjs";
import * as moment from 'moment';
import {takeUntil} from 'rxjs/operators';
import {AppConfig} from 'app/core/config/app.config';
import {TreoConfigService} from '@treo/services/config';
import {Subject} from 'rxjs';
import humanizeDuration from 'humanize-duration'
import {MatDialog} from '@angular/material/dialog';
import {DashboardDeviceDeleteDialogComponent} from "app/layout/common/dashboard-device-delete-dialog/dashboard-device-delete-dialog.component";
import {DeviceTitlePipe} from "app/shared/device-title.pipe";
import {DashboardDeviceDeleteDialogComponent} from 'app/layout/common/dashboard-device-delete-dialog/dashboard-device-delete-dialog.component';
import {DeviceTitlePipe} from 'app/shared/device-title.pipe';
@Component({
selector: 'app-dashboard-device',
@ -15,13 +15,6 @@ import {DeviceTitlePipe} from "app/shared/device-title.pipe";
styleUrls: ['./dashboard-device.component.scss']
})
export class DashboardDeviceComponent implements OnInit {
@Input() deviceSummary: any;
@Input() deviceWWN: string;
@Output() deviceDeleted = new EventEmitter<string>();
config: AppConfig;
private _unsubscribeAll: Subject<any>;
constructor(
private _configService: TreoConfigService,
@ -30,6 +23,15 @@ export class DashboardDeviceComponent implements OnInit {
// Set the private defaults
this._unsubscribeAll = new Subject();
}
@Input() deviceSummary: any;
@Input() deviceWWN: string;
@Output() deviceDeleted = new EventEmitter<string>();
config: AppConfig;
private _unsubscribeAll: Subject<any>;
readonly humanizeDuration = humanizeDuration;
ngOnInit(): void {
// Subscribe to config changes
@ -45,7 +47,7 @@ export class DashboardDeviceComponent implements OnInit {
// @ Public methods
// -----------------------------------------------------------------------------------------------------
classDeviceLastUpdatedOn(deviceSummary){
classDeviceLastUpdatedOn(deviceSummary): string {
if (deviceSummary.device.device_status !== 0) {
return 'text-red' // if the device has failed, always highlight in red
} else if(deviceSummary.device.device_status === 0 && deviceSummary.smart){
@ -65,16 +67,14 @@ export class DashboardDeviceComponent implements OnInit {
}
}
deviceStatusString(deviceStatus){
if(deviceStatus == 0){
return "passed"
deviceStatusString(deviceStatus): string {
if(deviceStatus === 0){
return 'passed'
} else {
return "failed"
return 'failed'
}
}
readonly humanizeDuration = humanizeDuration;
openDeleteDialog(): void {

@ -9,20 +9,20 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { SharedModule } from 'app/shared/shared.module';
import {DashboardDeviceComponent} from 'app/layout/common/dashboard-device/dashboard-device.component'
import { MatDialogModule } from "@angular/material/dialog";
import { MatButtonToggleModule} from "@angular/material/button-toggle";
import {MatTabsModule} from "@angular/material/tabs";
import {MatSliderModule} from "@angular/material/slider";
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
import {MatTooltipModule} from "@angular/material/tooltip";
import {dashboardRoutes} from "../../../modules/dashboard/dashboard.routing";
import {MatDividerModule} from "@angular/material/divider";
import {MatMenuModule} from "@angular/material/menu";
import {MatProgressBarModule} from "@angular/material/progress-bar";
import {MatSortModule} from "@angular/material/sort";
import {MatTableModule} from "@angular/material/table";
import {NgApexchartsModule} from "ng-apexcharts";
import {DashboardDeviceDeleteDialogModule} from "../dashboard-device-delete-dialog/dashboard-device-delete-dialog.module";
import { MatDialogModule } from '@angular/material/dialog';
import { MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatTabsModule} from '@angular/material/tabs';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatTooltipModule} from '@angular/material/tooltip';
import {dashboardRoutes} from '../../../modules/dashboard/dashboard.routing';
import {MatDividerModule} from '@angular/material/divider';
import {MatMenuModule} from '@angular/material/menu';
import {MatProgressBarModule} from '@angular/material/progress-bar';
import {MatSortModule} from '@angular/material/sort';
import {MatTableModule} from '@angular/material/table';
import {NgApexchartsModule} from 'ng-apexcharts';
import {DashboardDeviceDeleteDialogModule} from 'app/layout/common/dashboard-device-delete-dialog/dashboard-device-delete-dialog.module';
@NgModule({
declarations: [

@ -1,8 +1,8 @@
import { Component, OnInit } from '@angular/core';
import {AppConfig} from 'app/core/config/app.config';
import { TreoConfigService } from '@treo/services/config';
import {Subject} from "rxjs";
import {takeUntil} from "rxjs/operators";
import {Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
@Component({
selector: 'app-dashboard-settings',

@ -9,12 +9,12 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { SharedModule } from 'app/shared/shared.module';
import {DashboardSettingsComponent} from 'app/layout/common/dashboard-settings/dashboard-settings.component'
import { MatDialogModule } from "@angular/material/dialog";
import { MatButtonToggleModule} from "@angular/material/button-toggle";
import {MatTabsModule} from "@angular/material/tabs";
import {MatSliderModule} from "@angular/material/slider";
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
import {MatTooltipModule} from "@angular/material/tooltip";
import { MatDialogModule } from '@angular/material/dialog';
import { MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatTabsModule} from '@angular/material/tabs';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatTooltipModule} from '@angular/material/tooltip';
@NgModule({
declarations: [

@ -9,12 +9,12 @@ import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { SharedModule } from 'app/shared/shared.module';
import {DetailSettingsComponent} from 'app/layout/common/detail-settings/detail-settings.component'
import { MatDialogModule } from "@angular/material/dialog";
import { MatButtonToggleModule} from "@angular/material/button-toggle";
import {MatTabsModule} from "@angular/material/tabs";
import {MatSliderModule} from "@angular/material/slider";
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
import {MatTooltipModule} from "@angular/material/tooltip";
import { MatDialogModule } from '@angular/material/dialog';
import { MatButtonToggleModule} from '@angular/material/button-toggle';
import {MatTabsModule} from '@angular/material/tabs';
import {MatSliderModule} from '@angular/material/slider';
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
import {MatTooltipModule} from '@angular/material/tooltip';
@NgModule({
declarations: [

@ -45,7 +45,7 @@ export class LayoutComponent implements OnInit, OnDestroy
// Set the private defaults
this._unsubscribeAll = new Subject();
this.systemPrefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
this.systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
}

@ -7,11 +7,11 @@ import {ApexOptions, ChartComponent} from 'ng-apexcharts';
import { DashboardService } from 'app/modules/dashboard/dashboard.service';
import {MatDialog} from '@angular/material/dialog';
import { DashboardSettingsComponent } from 'app/layout/common/dashboard-settings/dashboard-settings.component';
import {AppConfig} from "app/core/config/app.config";
import {TreoConfigService} from "@treo/services/config";
import {Router} from "@angular/router";
import {TemperaturePipe} from "app/shared/temperature.pipe";
import {DeviceTitlePipe} from "app/shared/device-title.pipe";
import {AppConfig} from 'app/core/config/app.config';
import {TreoConfigService} from '@treo/services/config';
import {Router} from '@angular/router';
import {TemperaturePipe} from 'app/shared/temperature.pipe';
import {DeviceTitlePipe} from 'app/shared/device-title.pipe';
@Component({
selector : 'example',
@ -25,12 +25,12 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
data: any;
hostGroups: { [hostId: string]: string[] } = {}
temperatureOptions: ApexOptions;
tempDurationKey: string = "forever"
tempDurationKey = 'forever'
config: AppConfig;
// Private
private _unsubscribeAll: Subject<any>;
@ViewChild("tempChart", { static: false }) tempChart: ChartComponent;
@ViewChild('tempChart', { static: false }) tempChart: ChartComponent;
/**
* Constructor
@ -64,17 +64,17 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
.pipe(takeUntil(this._unsubscribeAll))
.subscribe((config: AppConfig) => {
//check if the old config and the new config do not match.
let oldConfig = JSON.stringify(this.config)
let newConfig = JSON.stringify(config)
// check if the old config and the new config do not match.
const oldConfig = JSON.stringify(this.config)
const newConfig = JSON.stringify(config)
if(oldConfig != newConfig){
if(oldConfig !== newConfig){
console.log(`Configuration updated: ${newConfig} vs ${oldConfig}`)
// Store the config
this.config = config;
if(oldConfig){
console.log("reloading component...")
console.log('reloading component...')
this.refreshComponent()
}
}
@ -88,10 +88,10 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
// Store the data
this.data = data;
//generate group data.
for(let wwn in this.data.data.summary){
let hostid = this.data.data.summary[wwn].device.host_id
let hostDeviceList = this.hostGroups[hostid] || []
// generate group data.
for(const wwn in this.data.data.summary){
const hostid = this.data.data.summary[wwn].device.host_id
const hostDeviceList = this.hostGroups[hostid] || []
hostDeviceList.push(wwn)
this.hostGroups[hostid] = hostDeviceList
}
@ -121,34 +121,34 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
// -----------------------------------------------------------------------------------------------------
// @ Private methods
// -----------------------------------------------------------------------------------------------------
private refreshComponent(){
private refreshComponent(): void {
let currentUrl = this.router.url;
const currentUrl = this.router.url;
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
this.router.onSameUrlNavigation = 'reload';
this.router.navigate([currentUrl]);
}
private _deviceDataTemperatureSeries() {
var deviceTemperatureSeries = []
private _deviceDataTemperatureSeries(): any[] {
const deviceTemperatureSeries = []
console.log("DEVICE DATA SUMMARY", this.data)
console.log('DEVICE DATA SUMMARY', this.data)
for(const wwn in this.data.data.summary){
var deviceSummary = this.data.data.summary[wwn]
const deviceSummary = this.data.data.summary[wwn]
if (!deviceSummary.temp_history){
continue
}
let deviceName = DeviceTitlePipe.deviceTitleWithFallback(deviceSummary.device, this.config.dashboardDisplay)
const deviceName = DeviceTitlePipe.deviceTitleWithFallback(deviceSummary.device, this.config.dashboardDisplay)
var deviceSeriesMetadata = {
const deviceSeriesMetadata = {
name: deviceName,
data: []
}
for(let tempHistory of deviceSummary.temp_history){
let newDate = new Date(tempHistory.date);
for(const tempHistory of deviceSummary.temp_history){
const newDate = new Date(tempHistory.date);
deviceSeriesMetadata.data.push({
x: newDate,
y: TemperaturePipe.formatTemperature(tempHistory.temp, this.config.temperatureUnit, false)
@ -216,9 +216,9 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
// @ Public methods
// -----------------------------------------------------------------------------------------------------
deviceSummariesForHostGroup(hostGroupWWNs: string[]) {
let deviceSummaries = []
for(let wwn of hostGroupWWNs){
deviceSummariesForHostGroup(hostGroupWWNs: string[]): any[] {
const deviceSummaries = []
for(const wwn of hostGroupWWNs){
if(this.data.data.summary[wwn]){
deviceSummaries.push(this.data.data.summary[wwn])
}
@ -226,7 +226,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
return deviceSummaries
}
openDialog() {
openDialog(): void {
const dialogRef = this.dialog.open(DashboardSettingsComponent);
dialogRef.afterClosed().subscribe(result => {
@ -234,7 +234,7 @@ export class DashboardComponent implements OnInit, AfterViewInit, OnDestroy
});
}
onDeviceDeleted(wwn: string) {
onDeviceDeleted(wwn: string): void {
delete this.data.data.summary[wwn] // remove the device from the summary list.
}

@ -12,8 +12,8 @@ import { MatSortModule } from '@angular/material/sort';
import { MatTableModule } from '@angular/material/table';
import { NgApexchartsModule } from 'ng-apexcharts';
import { MatTooltipModule } from '@angular/material/tooltip'
import { DashboardSettingsModule } from "app/layout/common/dashboard-settings/dashboard-settings.module";
import { DashboardDeviceModule } from "app/layout/common/dashboard-device/dashboard-device.module";
import { DashboardSettingsModule } from 'app/layout/common/dashboard-settings/dashboard-settings.module';
import { DashboardDeviceModule } from 'app/layout/common/dashboard-device/dashboard-device.module';
@NgModule({
declarations: [

@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { DashboardComponent } from 'app/modules/dashboard/dashboard.component';
import {DashboardResolver} from "./dashboard.resolvers";
import {DashboardResolver} from 'app/modules/dashboard/dashboard.resolvers';
export const dashboardRoutes: Route[] = [
{

@ -55,9 +55,9 @@ export class DashboardService
getSummaryTempData(durationKey: string): Observable<any>
{
let params = {}
const params = {}
if(durationKey){
params["duration_key"] = durationKey
params['duration_key'] = durationKey
}
return this._httpClient.get(getBasePath() + '/api/summary/temp', {params: params});

@ -1,18 +1,17 @@
import {AfterViewInit, Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
import {ApexOptions} from "ng-apexcharts";
import {MatTableDataSource} from "@angular/material/table";
import {MatSort} from "@angular/material/sort";
import {Subject} from "rxjs";
import {DetailService} from "./detail.service";
import {takeUntil} from "rxjs/operators";
import {fadeOut} from "../../../@treo/animations/fade";
import {DetailSettingsComponent} from "app/layout/common/detail-settings/detail-settings.component";
import {MatDialog} from "@angular/material/dialog";
import {ApexOptions} from 'ng-apexcharts';
import {MatTableDataSource} from '@angular/material/table';
import {MatSort} from '@angular/material/sort';
import {Subject} from 'rxjs';
import {DetailService} from './detail.service';
import {takeUntil} from 'rxjs/operators';
import {DetailSettingsComponent} from 'app/layout/common/detail-settings/detail-settings.component';
import {MatDialog} from '@angular/material/dialog';
import humanizeDuration from 'humanize-duration';
import {TreoConfigService} from "../../../@treo/services/config";
import {AppConfig} from "../../core/config/app.config";
import {TreoConfigService} from '@treo/services/config';
import {AppConfig} from 'app/core/config/app.config';
import {animate, state, style, transition, trigger} from '@angular/animations';
import {formatDate} from "@angular/common";
import {formatDate} from '@angular/common';
import { LOCALE_ID, Inject } from '@angular/core';
// from Constants.go - these must match
@ -37,27 +36,6 @@ const AttributeStatusFailedScrutiny = 4
export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
config: AppConfig;
onlyCritical: boolean = true;
// data: any;
expandedAttribute: any | null;
metadata: any;
device: any;
smart_results: any[];
commonSparklineOptions: Partial<ApexOptions>;
smartAttributeDataSource: MatTableDataSource<any>;
smartAttributeTableColumns: string[];
@ViewChild('smartAttributeTable', {read: MatSort})
smartAttributeTableMatSort: MatSort;
// Private
private _unsubscribeAll: Subject<any>;
private systemPrefersDark: boolean;
/**
* Constructor
*
@ -79,10 +57,33 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
// this.recentTransactionsTableColumns = ['status', 'id', 'name', 'value', 'worst', 'thresh'];
this.smartAttributeTableColumns = ['status', 'id', 'name', 'value', 'worst', 'thresh','ideal', 'failure', 'history'];
this.systemPrefersDark = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
this.systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
}
config: AppConfig;
onlyCritical = true;
// data: any;
expandedAttribute: any | null;
metadata: any;
device: any;
smart_results: any[];
commonSparklineOptions: Partial<ApexOptions>;
smartAttributeDataSource: MatTableDataSource<any>;
smartAttributeTableColumns: string[];
@ViewChild('smartAttributeTable', {read: MatSort})
smartAttributeTableMatSort: MatSort;
// Private
private _unsubscribeAll: Subject<any>;
private systemPrefersDark: boolean;
readonly humanizeDuration = humanizeDuration;
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
@ -181,7 +182,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
getAttributeName(attribute_data): string {
let attribute_metadata = this.metadata[attribute_data.attribute_id]
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata){
return 'Unknown Attribute Name'
} else {
@ -189,7 +190,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
getAttributeDescription(attribute_data){
let attribute_metadata = this.metadata[attribute_data.attribute_id]
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata){
return 'Unknown'
} else {
@ -200,12 +201,12 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
getAttributeValue(attribute_data){
if(this.isAta()) {
let attribute_metadata = this.metadata[attribute_data.attribute_id]
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata){
return attribute_data.value
} else if (attribute_metadata.display_type == "raw") {
} else if (attribute_metadata.display_type == 'raw') {
return attribute_data.raw_value
} else if (attribute_metadata.display_type == "transformed" && attribute_data.transformed_value) {
} else if (attribute_metadata.display_type == 'transformed' && attribute_data.transformed_value) {
return attribute_data.transformed_value
} else {
return attribute_data.value
@ -218,7 +219,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
getAttributeValueType(attribute_data){
if(this.isAta()) {
let attribute_metadata = this.metadata[attribute_data.attribute_id]
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata){
return ''
} else {
@ -231,25 +232,25 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
getAttributeIdeal(attribute_data){
if(this.isAta()){
return this.metadata[attribute_data.attribute_id]?.display_type == "raw" ? this.metadata[attribute_data.attribute_id]?.ideal : ''
return this.metadata[attribute_data.attribute_id]?.display_type == 'raw' ? this.metadata[attribute_data.attribute_id]?.ideal : ''
} else {
return this.metadata[attribute_data.attribute_id]?.ideal
}
}
getAttributeWorst(attribute_data){
let attribute_metadata = this.metadata[attribute_data.attribute_id]
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata){
return attribute_data.worst
} else {
return attribute_metadata?.display_type == "normalized" ? attribute_data.worst : ''
return attribute_metadata?.display_type == 'normalized' ? attribute_data.worst : ''
}
}
getAttributeThreshold(attribute_data){
if(this.isAta()){
let attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata || attribute_metadata.display_type == "normalized"){
const attribute_metadata = this.metadata[attribute_data.attribute_id]
if(!attribute_metadata || attribute_metadata.display_type == 'normalized'){
return attribute_data.thresh
} else {
// if(this.data.metadata[attribute_data.attribute_id].observed_thresholds){
@ -273,7 +274,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
}
let attributes_length = 0
let attributes = this.smart_results[0]?.attrs
const attributes = this.smart_results[0]?.attrs
if (attributes) {
attributes_length = Object.keys(attributes).length
}
@ -292,12 +293,12 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
}
private _generateSmartAttributeTableDataSource(smart_results){
var smartAttributeDataSource = [];
const smartAttributeDataSource = [];
if(smart_results.length == 0){
return smartAttributeDataSource
}
var latest_smart_result = smart_results[0];
const latest_smart_result = smart_results[0];
let attributes = {}
if(this.isScsi()) {
this.smartAttributeTableColumns = ['status', 'name', 'value', 'thresh', 'history'];
@ -306,20 +307,20 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
this.smartAttributeTableColumns = ['status', 'name', 'value', 'thresh', 'ideal', 'history'];
attributes = latest_smart_result.attrs
} else {
//ATA
// ATA
attributes = latest_smart_result.attrs
this.smartAttributeTableColumns = ['status', 'id', 'name', 'value', 'thresh','ideal', 'failure', 'history'];
}
for(const attrId in attributes){
var attr = attributes[attrId]
const attr = attributes[attrId]
//chart history data
// chart history data
if (!attr.chartData) {
var attrHistory = []
for (let smart_result of smart_results){
const attrHistory = []
for (const smart_result of smart_results){
// attrHistory.push(this.getAttributeValue(smart_result.attrs[attrId]))
const chartDatapoint = {
@ -342,12 +343,12 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
attributes[attrId].chartData = [
{
name: "chart-line-sparkline",
name: 'chart-line-sparkline',
data: attrHistory
}
]
}
//determine when to include the attributes in table.
// determine when to include the attributes in table.
if(!this.onlyCritical || this.onlyCritical && this.metadata[attr.attribute_id]?.critical || attr.value < attr.thresh){
smartAttributeDataSource.push(attr)
@ -367,7 +368,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
// Account balance
this.commonSparklineOptions = {
chart: {
type: "bar",
type: 'bar',
width: 100,
height: 25,
sparkline: {
@ -392,7 +393,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
y: {
title: {
formatter: function(seriesName) {
return "";
return '';
}
}
},
@ -421,7 +422,7 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
// -----------------------------------------------------------------------------------------------------
toHex(decimalNumb){
return "0x" + Number(decimalNumb).toString(16).padStart(2, '0').toUpperCase()
return '0x' + Number(decimalNumb).toString(16).padStart(2, '0').toUpperCase()
}
toggleOnlyCritical(){
this.onlyCritical = !this.onlyCritical
@ -449,6 +450,4 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy {
// return item.id || index;
}
readonly humanizeDuration = humanizeDuration;
}

@ -13,7 +13,7 @@ import { MatTableModule } from '@angular/material/table';
import { MatTooltipModule } from '@angular/material/tooltip'
import { NgApexchartsModule } from 'ng-apexcharts';
import { TreoCardModule } from '@treo/components/card';
import {DetailSettingsModule} from "app/layout/common/detail-settings/detail-settings.module";
import {DetailSettingsModule} from 'app/layout/common/detail-settings/detail-settings.module';
@NgModule({
declarations: [

@ -1,6 +1,6 @@
import { Route } from '@angular/router';
import { DetailComponent } from 'app/modules/detail/detail.component';
import {DetailResolver} from "./detail.resolvers";
import {DetailResolver} from './detail.resolvers';
export const detailRoutes: Route[] = [
{

@ -1,33 +1,33 @@
import { Pipe, PipeTransform } from '@angular/core';
import {DeviceTitlePipe} from "./device-title.pipe";
import {DeviceTitlePipe} from 'app/shared/device-title.pipe';
@Pipe({
name: 'deviceSort'
})
export class DeviceSortPipe implements PipeTransform {
statusCompareFn(a: any, b: any) {
statusCompareFn(a: any, b: any): number {
function deviceStatus(deviceSummary): number {
if(!deviceSummary.smart){
return 0
} else if (deviceSummary.device.device_status == 0){
} else if (deviceSummary.device.device_status === 0){
return 1
} else {
return deviceSummary.device.device_status * -1 // will return range from -1, -2, -3
}
}
let left = deviceStatus(a)
let right = deviceStatus(b)
const left = deviceStatus(a)
const right = deviceStatus(b)
return left - right;
}
titleCompareFn(dashboardDisplay: string) {
return function (a: any, b: any){
let _dashboardDisplay = dashboardDisplay
let left = DeviceTitlePipe.deviceTitleForType(a.device, _dashboardDisplay) || DeviceTitlePipe.deviceTitleForType(a.device, 'name')
let right = DeviceTitlePipe.deviceTitleForType(b.device, _dashboardDisplay) || DeviceTitlePipe.deviceTitleForType(b.device, 'name')
const _dashboardDisplay = dashboardDisplay
const left = DeviceTitlePipe.deviceTitleForType(a.device, _dashboardDisplay) || DeviceTitlePipe.deviceTitleForType(a.device, 'name')
const right = DeviceTitlePipe.deviceTitleForType(b.device, _dashboardDisplay) || DeviceTitlePipe.deviceTitleForType(b.device, 'name')
if( left < right )
return -1;
@ -39,7 +39,7 @@ export class DeviceSortPipe implements PipeTransform {
}
}
ageCompareFn(a: any, b: any) {
ageCompareFn(a: any, b: any): number {
const left = a.smart?.power_on_hours
const right = b.smart?.power_on_hours

@ -1,5 +1,5 @@
import { Pipe, PipeTransform } from '@angular/core';
import {formatNumber} from "@angular/common";
import {formatNumber} from '@angular/common';
@Pipe({
name: 'temperature'

Loading…
Cancel
Save