pug update to match data
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
**node_modules
|
**node_modules
|
||||||
**to_reform
|
**to_reform
|
||||||
.vscode
|
.vscode
|
||||||
|
current_site/dist
|
||||||
@@ -80,227 +80,4 @@ block variables
|
|||||||
{ id: 'val_temperature', value: 'AverageTemperature', label: 'Average Temperature', checked: true },
|
{ id: 'val_temperature', value: 'AverageTemperature', label: 'Average Temperature', checked: true },
|
||||||
{ id: 'val_humidity', value: 'Humidity', label: 'Average Humidity', checked: false },
|
{ id: 'val_humidity', value: 'Humidity', label: 'Average Humidity', checked: false },
|
||||||
{ id: 'val_battery', value: 'BatteryLevel', label: 'Average BatteryLevel', checked: false }
|
{ id: 'val_battery', value: 'BatteryLevel', label: 'Average BatteryLevel', checked: false }
|
||||||
]
|
]
|
||||||
|
|
||||||
var sensorData = [
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-001',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:41:50Z',
|
|
||||||
temperature: 19.4,
|
|
||||||
tempDifference: -0.2,
|
|
||||||
sensorType: 'Bmp220',
|
|
||||||
batteryLevel: 95,
|
|
||||||
humidity: 38.1,
|
|
||||||
lastCalibrationDate: '2025-07-26'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-003',
|
|
||||||
location: 'Bedroom',
|
|
||||||
timestamp: '2025-10-03T03:42:46Z',
|
|
||||||
temperature: 18.2,
|
|
||||||
tempDifference: -0.1,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 75,
|
|
||||||
humidity: 45.5,
|
|
||||||
lastCalibrationDate: '2025-07-21'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-004',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:43:48Z',
|
|
||||||
temperature: 24.1,
|
|
||||||
tempDifference: 0.1,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 72,
|
|
||||||
humidity: 50.5,
|
|
||||||
lastCalibrationDate: '2025-08-30'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-001',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:44:34Z',
|
|
||||||
temperature: 19.1,
|
|
||||||
tempDifference: -0.3,
|
|
||||||
sensorType: 'Bmp220',
|
|
||||||
batteryLevel: 95,
|
|
||||||
humidity: 56.5,
|
|
||||||
lastCalibrationDate: '2025-07-26'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-006',
|
|
||||||
location: 'Kitchen',
|
|
||||||
timestamp: '2025-10-03T03:45:46Z',
|
|
||||||
temperature: 22.8,
|
|
||||||
tempDifference: 0.0,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 80,
|
|
||||||
humidity: 41.4,
|
|
||||||
lastCalibrationDate: '2025-09-10'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-010',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:46:18Z',
|
|
||||||
temperature: 21.7,
|
|
||||||
tempDifference: 0.5,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 79,
|
|
||||||
humidity: 59.8,
|
|
||||||
lastCalibrationDate: '2025-08-07'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-006',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:47:05Z',
|
|
||||||
temperature: 22.7,
|
|
||||||
tempDifference: -0.1,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 80,
|
|
||||||
humidity: 36.1,
|
|
||||||
lastCalibrationDate: '2025-09-10'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-006',
|
|
||||||
location: 'Bedroom',
|
|
||||||
timestamp: '2025-10-03T03:48:13Z',
|
|
||||||
temperature: 22.9,
|
|
||||||
tempDifference: 0.2,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 80,
|
|
||||||
humidity: 56.1,
|
|
||||||
lastCalibrationDate: '2025-09-10'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-005',
|
|
||||||
location: 'Living Room',
|
|
||||||
timestamp: '2025-10-03T03:49:03Z',
|
|
||||||
temperature: 24.4,
|
|
||||||
tempDifference: 0.4,
|
|
||||||
sensorType: 'Bmp180',
|
|
||||||
batteryLevel: 91,
|
|
||||||
humidity: 30.1,
|
|
||||||
lastCalibrationDate: '2025-08-07'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-001',
|
|
||||||
location: 'Kitchen',
|
|
||||||
timestamp: '2025-10-03T03:50:24Z',
|
|
||||||
temperature: 19.1,
|
|
||||||
tempDifference: 0.0,
|
|
||||||
sensorType: 'Bmp220',
|
|
||||||
batteryLevel: 95,
|
|
||||||
humidity: 64.8,
|
|
||||||
lastCalibrationDate: '2025-07-26'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-008',
|
|
||||||
location: 'Living Room',
|
|
||||||
timestamp: '2025-10-03T03:51:12Z',
|
|
||||||
temperature: 21.9,
|
|
||||||
tempDifference: -0.1,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 92,
|
|
||||||
humidity: 36.0,
|
|
||||||
lastCalibrationDate: '2025-08-02'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-009',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:51:46Z',
|
|
||||||
temperature: 22.3,
|
|
||||||
tempDifference: 0.0,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 76,
|
|
||||||
humidity: 74.0,
|
|
||||||
lastCalibrationDate: '2025-09-17'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-003',
|
|
||||||
location: 'Kitchen',
|
|
||||||
timestamp: '2025-10-03T03:52:23Z',
|
|
||||||
temperature: 18.4,
|
|
||||||
tempDifference: 0.2,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 75,
|
|
||||||
humidity: 45.2,
|
|
||||||
lastCalibrationDate: '2025-07-21'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-010',
|
|
||||||
location: 'Living Room',
|
|
||||||
timestamp: '2025-10-03T03:53:44Z',
|
|
||||||
temperature: 21.8,
|
|
||||||
tempDifference: 0.1,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 79,
|
|
||||||
humidity: 36.3,
|
|
||||||
lastCalibrationDate: '2025-08-07'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-001',
|
|
||||||
location: 'Kitchen',
|
|
||||||
timestamp: '2025-10-03T03:54:46Z',
|
|
||||||
temperature: 18.7,
|
|
||||||
tempDifference: -0.4,
|
|
||||||
sensorType: 'Bmp220',
|
|
||||||
batteryLevel: 95,
|
|
||||||
humidity: 44.3,
|
|
||||||
lastCalibrationDate: '2025-07-26'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-006',
|
|
||||||
location: 'Bedroom',
|
|
||||||
timestamp: '2025-10-03T03:55:24Z',
|
|
||||||
temperature: 23.3,
|
|
||||||
tempDifference: 0.4,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 80,
|
|
||||||
humidity: 55.9,
|
|
||||||
lastCalibrationDate: '2025-09-10'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-002',
|
|
||||||
location: 'Kitchen',
|
|
||||||
timestamp: '2025-10-03T03:55:57Z',
|
|
||||||
temperature: 17.7,
|
|
||||||
tempDifference: -0.5,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 93,
|
|
||||||
humidity: 70.2,
|
|
||||||
lastCalibrationDate: '2025-08-30'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-002',
|
|
||||||
location: 'Balcony',
|
|
||||||
timestamp: '2025-10-03T03:57:05Z',
|
|
||||||
temperature: 17.4,
|
|
||||||
tempDifference: -0.3,
|
|
||||||
sensorType: 'Scd30(Internal)',
|
|
||||||
batteryLevel: 93,
|
|
||||||
humidity: 66.7,
|
|
||||||
lastCalibrationDate: '2025-08-30'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-009',
|
|
||||||
location: 'Living Room',
|
|
||||||
timestamp: '2025-10-03T03:58:28Z',
|
|
||||||
temperature: 22.6,
|
|
||||||
tempDifference: 0.3,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 76,
|
|
||||||
humidity: 56.4,
|
|
||||||
lastCalibrationDate: '2025-09-17'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sensorId: 'TEMP-004',
|
|
||||||
location: 'Bedroom',
|
|
||||||
timestamp: '2025-10-03T03:59:51Z',
|
|
||||||
temperature: 24.3,
|
|
||||||
tempDifference: 0.2,
|
|
||||||
sensorType: 'Xiaomi',
|
|
||||||
batteryLevel: 72,
|
|
||||||
humidity: 47.3,
|
|
||||||
lastCalibrationDate: '2025-08-30'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -28,97 +28,51 @@ mixin filtersMixin()
|
|||||||
details.filters
|
details.filters
|
||||||
summary.filters__summary Filters
|
summary.filters__summary Filters
|
||||||
form.filters__form
|
form.filters__form
|
||||||
fieldset.filters__fieldset
|
p
|
||||||
.filter-group
|
label(for='type') Type:
|
||||||
i.filter-group__label
|
select(id ='type')
|
||||||
b Location
|
p
|
||||||
br
|
label(for='name') Name:
|
||||||
.filter-group__items
|
input(type='text' id='name')
|
||||||
each filter in locationFilters
|
p
|
||||||
input.filter-group__checkbox(type="checkbox" id=filter.id name="location" value=filter.value)
|
label(for='manufacturer') Manufacturer name:
|
||||||
span #{filter.label}
|
input(type='text' id='manufacturer')
|
||||||
br
|
p
|
||||||
|
label(for='sizeFrom') Size:
|
||||||
.filter-group
|
| from
|
||||||
i.filter-group__label
|
input(type='number' id='sizeFrom')
|
||||||
b Sensor Type
|
| to
|
||||||
br
|
input(type='number' id='sizeTo')
|
||||||
.filter-group__items
|
p
|
||||||
each filter in sensorTypeFilters
|
label(for='releaseDateFrom') Release Date:
|
||||||
input.filter-group__checkbox(type="checkbox" id=filter.id name="sensor_type" value=filter.value)
|
| from
|
||||||
span #{filter.label}
|
input(type='number' id='releaseDateFrom')
|
||||||
br
|
| to
|
||||||
|
input(type='number' id='releaseDateTo')
|
||||||
.filter-group
|
p
|
||||||
i.filter-group__label
|
label(for='priceFrom') Release Date:
|
||||||
b Numeric Values
|
| from
|
||||||
br
|
input(type='number' id='priceFrom')
|
||||||
.filter-group__range
|
| to
|
||||||
span Temperature from:
|
input(type='number' id='priceTo')
|
||||||
input.filter-group__input(type="number" name="temp_min" placeholder="20")
|
input.filter-group__button--apply(type='button' id='applyFiltersButton' value="Apply Filters")
|
||||||
span to:
|
input.filter-group__button--reset(type='button' id='resetFiltersButton' value="Reset Filters")
|
||||||
input.filter-group__input(type="number" name="temp_max" placeholder="30")
|
|
||||||
br
|
|
||||||
span Humidity from:
|
|
||||||
input.filter-group__input(type="number" name="humidity_min" placeholder="40")
|
|
||||||
span to:
|
|
||||||
input.filter-group__input(type="number" name="humidity_max" placeholder="60")
|
|
||||||
br
|
|
||||||
|
|
||||||
.filter-group
|
|
||||||
i.filter-group__label
|
|
||||||
b Device Specific Filters
|
|
||||||
br
|
|
||||||
.filter-group__items
|
|
||||||
span Sensor Name:
|
|
||||||
input.filter-group__input(type="text" name="sensor_name")
|
|
||||||
br
|
|
||||||
span Days Since Calibration (max):
|
|
||||||
input.filter-group__input(type="number" name="calibration_days" placeholder="30")
|
|
||||||
br
|
|
||||||
|
|
||||||
.filter-group
|
|
||||||
i.filter-group__label
|
|
||||||
b Measurement Period
|
|
||||||
br
|
|
||||||
.filter-group__dates
|
|
||||||
span From:
|
|
||||||
input.filter-group__input(type="date" name="date_from")
|
|
||||||
br
|
|
||||||
span To:
|
|
||||||
input.filter-group__input(type="date" name="date_to")
|
|
||||||
br
|
|
||||||
|
|
||||||
.filter-group__buttons
|
|
||||||
input.filter-group__button.filter-group__button--submit(type="submit" value="Apply Filters")
|
|
||||||
input.filter-group__button.filter-group__button--reset(type="reset" value="Reset Filters")
|
|
||||||
|
|
||||||
mixin sortLevel(level)
|
mixin sortLevel(level)
|
||||||
.sort-level
|
p
|
||||||
i.sort-level__label
|
select.sort-level__select(id=`sort_${level}`)
|
||||||
b Sort Level #{level}
|
| ascending?
|
||||||
br
|
input(type="checkbox", id=`sort_reverse_${level}`)
|
||||||
label.sort-level__field-label(for=`sort${level}`) Field:
|
|
||||||
select.sort-level__select(id=`sort${level}` name=`sort${level}`)
|
|
||||||
each option in sortOptions
|
|
||||||
option(value=option.value) #{option.label}
|
|
||||||
label.sort-level__reverse-label(for=`sort${level}_reverse`)
|
|
||||||
input.sort-level__checkbox(type="checkbox" id=`sort${level}_reverse` name=`sort${level}_reverse`)
|
|
||||||
span Reverse
|
|
||||||
br
|
|
||||||
if level === '3'
|
|
||||||
input.sort-level__submit(type="submit" value="Sort")
|
|
||||||
else
|
|
||||||
br
|
|
||||||
|
|
||||||
mixin sortingMixin()
|
mixin sortingMixin()
|
||||||
- const sortLevels = ['1', '2', '3'];
|
- const sortLevels = ['1', '2', '3'];
|
||||||
details.sorting
|
details.sorting
|
||||||
summary.sorting__summary Sortings
|
summary.sorting__summary Sort
|
||||||
form.sorting__form
|
form.sorting__form
|
||||||
fieldset.sorting__fieldset
|
|
||||||
each level in sortLevels
|
each level in sortLevels
|
||||||
+sortLevel(level)
|
+sortLevel(level)
|
||||||
|
input.sort-group__button--apply(type='button' id='applySortButton' value="Apply Sort")
|
||||||
|
input.sort-group__button--reset(type='button' id='resetSortButton' value="Reset Sort")
|
||||||
|
|
||||||
|
|
||||||
mixin graphXOption(option)
|
mixin graphXOption(option)
|
||||||
if option.checked
|
if option.checked
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
include ../components/mixins.pug
|
include ../components/mixins.pug
|
||||||
include ../components/data.pug
|
|
||||||
|
|
||||||
head
|
head
|
||||||
title table
|
title table
|
||||||
|
script(src='./table/data.js')
|
||||||
|
script(src='./table/filter.js')
|
||||||
|
script(src='./table/main.js')
|
||||||
|
script(src='./table/sort.js')
|
||||||
|
script(src='./table/table.js')
|
||||||
|
|
||||||
body
|
body
|
||||||
+navbarMixin("Table")
|
+navbarMixin("Table")
|
||||||
|
|
||||||
|
.table-controls
|
||||||
|
+filtersMixin()
|
||||||
|
+sortingMixin()
|
||||||
|
+graphMixin()
|
||||||
|
|
||||||
.table-controls
|
table.table
|
||||||
+filtersMixin()
|
|
||||||
+sortingMixin()
|
|
||||||
+graphMixin()
|
|
||||||
|
|
||||||
table.table
|
|
||||||
tbody.table-content
|
|
||||||
each dataItem,index in sensorData
|
|
||||||
if index == 0
|
|
||||||
tr.table-content__table-header
|
|
||||||
each value,header in dataItem
|
|
||||||
th #{header}
|
|
||||||
tr.table-content__table-row
|
|
||||||
each value,header in dataItem
|
|
||||||
td #{value}
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,11 +59,28 @@ module.exports = {
|
|||||||
onStart: {
|
onStart: {
|
||||||
delete: ["dist"],
|
delete: ["dist"],
|
||||||
},
|
},
|
||||||
|
onEnd: {
|
||||||
|
copy: [
|
||||||
|
{
|
||||||
|
source: path.join(__dirname, "src", "pages", "table", "*.js"),
|
||||||
|
destination: path.join(__dirname, "dist", "table"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
devServer: {
|
devServer: {
|
||||||
watchFiles: path.join(__dirname, "src"),
|
watchFiles: path.join(__dirname, "src"),
|
||||||
port: 9000,
|
port: 9000,
|
||||||
|
static: [
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, "dist"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
directory: path.join(__dirname, "src", "pages"),
|
||||||
|
publicPath: "/",
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user