@@ -302,6 +364,255 @@
+
+
+{% endblock %}
diff --git a/templates/partials/devices_table.html b/templates/partials/devices_table.html
index ed5aca6..ac48044 100644
--- a/templates/partials/devices_table.html
+++ b/templates/partials/devices_table.html
@@ -60,7 +60,9 @@
data-note="{{ unit.note if unit.note else '' }}">
- {% if unit.status == 'OK' %}
+ {% if not unit.deployed %}
+
+ {% elif unit.status == 'OK' %}
{% elif unit.status == 'Pending' %}
@@ -104,8 +106,13 @@
{% if unit.phone_number %}
{{ unit.phone_number }}
{% endif %}
- {% if unit.hardware_model %}
- {{ unit.hardware_model }}
+ {% if unit.deployed_with_unit_id %}
+
{% endif %}
{% else %}
{% if unit.next_calibration_due %}
@@ -126,7 +133,7 @@
|
- {{ unit.last_seen }}
+ {{ unit.last_seen }}
|
- At 00:00: Stop → Download (1 min) → Start (2 min)
+ At 00:00: Stop → Download → Start (~70 sec total)
@@ -132,12 +132,12 @@ document.getElementById('include_download').addEventListener('change', function(
downloadStep.style.display = 'flex';
downloadArrow.style.display = 'block';
startStepNum.textContent = '3';
- cycleTiming.innerHTML = `At ${timeValue}: Stop → Download (1 min) → Start (2 min)`;
+ cycleTiming.innerHTML = `At ${timeValue}: Stop → Download → Start (~70 sec total)`;
} else {
downloadStep.style.display = 'none';
downloadArrow.style.display = 'none';
startStepNum.textContent = '2';
- cycleTiming.innerHTML = `At ${timeValue}: Stop → Start (1 min)`;
+ cycleTiming.innerHTML = `At ${timeValue}: Stop → Start (~40 sec total)`;
}
});
diff --git a/templates/partials/roster_table.html b/templates/partials/roster_table.html
index 720f158..31d1731 100644
--- a/templates/partials/roster_table.html
+++ b/templates/partials/roster_table.html
@@ -58,7 +58,9 @@
data-note="{{ unit.note if unit.note else '' }}">
|
- {% if unit.status == 'OK' %}
+ {% if not unit.deployed %}
+
+ {% elif unit.status == 'OK' %}
{% elif unit.status == 'Pending' %}
@@ -83,6 +85,10 @@
Modem
+ {% elif unit.device_type == 'slm' %}
+
+ SLM
+
{% else %}
Seismograph
@@ -195,7 +201,9 @@
- {% if unit.status == 'OK' %}
+ {% if not unit.deployed %}
+
+ {% elif unit.status == 'OK' %}
{% elif unit.status == 'Pending' %}
@@ -222,6 +230,10 @@
Modem
+ {% elif unit.device_type == 'slm' %}
+
+ SLM
+
{% else %}
Seismograph
@@ -337,6 +349,7 @@
{% endblock %}
diff --git a/templates/roster.html b/templates/roster.html
index 7e29582..df989b7 100644
--- a/templates/roster.html
+++ b/templates/roster.html
@@ -122,7 +122,7 @@
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-seismo-orange">
-
+
@@ -178,8 +178,13 @@
-
+
+
+
+
+
@@ -206,21 +211,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
I (Impulse)
+
+
+ {% set picker_id = "-add-slm" %}
+ {% include "partials/modem_picker.html" with context %}
+ SLM connects via modem's IP address
+
@@ -301,7 +297,7 @@
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-seismo-orange">
-
+
@@ -360,8 +356,13 @@
-
+
+
+
+
+
@@ -388,21 +389,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
I (Impulse)
+
+
+ {% set picker_id = "-edit-slm" %}
+ {% include "partials/modem_picker.html" with context %}
+ SLM connects via modem's IP address
+
@@ -641,7 +633,7 @@
setFieldsDisabled(seismoFields, true);
setFieldsDisabled(modemFields, false);
setFieldsDisabled(slmFields, true);
- } else if (deviceType === 'sound_level_meter') {
+ } else if (deviceType === 'slm') {
seismoFields.classList.add('hidden');
modemFields.classList.add('hidden');
slmFields.classList.remove('hidden');
@@ -649,6 +641,7 @@
setFieldsDisabled(seismoFields, true);
setFieldsDisabled(modemFields, true);
setFieldsDisabled(slmFields, false);
+ toggleModemPairing(); // Check if modem pairing should be shown
}
}
@@ -661,17 +654,26 @@
});
}
- // Toggle modem pairing field visibility (only for deployed seismographs)
+ // Toggle modem pairing field visibility (only for deployed seismographs and SLMs)
function toggleModemPairing() {
const deviceType = document.getElementById('deviceTypeSelect').value;
const deployedCheckbox = document.getElementById('deployedCheckbox');
const modemPairingField = document.getElementById('modemPairingField');
+ const slmModemPairingField = document.getElementById('slmModemPairingField');
+ // Seismograph modem pairing
if (deviceType === 'seismograph' && deployedCheckbox.checked) {
modemPairingField.classList.remove('hidden');
} else {
modemPairingField.classList.add('hidden');
}
+
+ // SLM modem pairing
+ if (deviceType === 'slm' && deployedCheckbox.checked) {
+ slmModemPairingField.classList.remove('hidden');
+ } else {
+ slmModemPairingField.classList.add('hidden');
+ }
}
// Add unknown unit to roster
@@ -816,13 +818,14 @@
setFieldsDisabled(seismoFields, true);
setFieldsDisabled(modemFields, false);
setFieldsDisabled(slmFields, true);
- } else if (deviceType === 'sound_level_meter') {
+ } else if (deviceType === 'slm') {
seismoFields.classList.add('hidden');
modemFields.classList.add('hidden');
slmFields.classList.remove('hidden');
setFieldsDisabled(seismoFields, true);
setFieldsDisabled(modemFields, true);
setFieldsDisabled(slmFields, false);
+ toggleEditModemPairing(); // Check if modem pairing should be shown
}
}
@@ -831,12 +834,21 @@
const deviceType = document.getElementById('editDeviceTypeSelect').value;
const deployedCheckbox = document.getElementById('editDeployedCheckbox');
const modemPairingField = document.getElementById('editModemPairingField');
+ const slmModemPairingField = document.getElementById('editSlmModemPairingField');
+ // Seismograph modem pairing
if (deviceType === 'seismograph' && deployedCheckbox.checked) {
modemPairingField.classList.remove('hidden');
} else {
modemPairingField.classList.add('hidden');
}
+
+ // SLM modem pairing
+ if (deviceType === 'slm' && deployedCheckbox.checked) {
+ slmModemPairingField.classList.remove('hidden');
+ } else {
+ slmModemPairingField.classList.add('hidden');
+ }
}
// Edit Unit - Fetch data and populate form
@@ -911,7 +923,7 @@
// Modem fields
document.getElementById('editIpAddress').value = unit.ip_address;
document.getElementById('editPhoneNumber').value = unit.phone_number;
- document.getElementById('editHardwareModel').value = unit.hardware_model;
+ document.getElementById('editHardwareModel').value = unit.hardware_model || '';
document.getElementById('editDeploymentType').value = unit.deployment_type || '';
// Populate unit picker for modem (uses -edit-modem suffix)
@@ -940,13 +952,36 @@
// SLM fields
document.getElementById('editSlmModel').value = unit.slm_model || '';
- document.getElementById('editSlmHost').value = unit.slm_host || '';
- document.getElementById('editSlmTcpPort').value = unit.slm_tcp_port || '';
- document.getElementById('editSlmFtpPort').value = unit.slm_ftp_port || '';
document.getElementById('editSlmSerialNumber').value = unit.slm_serial_number || '';
document.getElementById('editSlmFrequencyWeighting').value = unit.slm_frequency_weighting || '';
document.getElementById('editSlmTimeWeighting').value = unit.slm_time_weighting || '';
+ // Populate SLM modem picker (uses -edit-slm suffix)
+ const slmModemPickerValue = document.getElementById('modem-picker-value-edit-slm');
+ const slmModemPickerSearch = document.getElementById('modem-picker-search-edit-slm');
+ const slmModemPickerClear = document.getElementById('modem-picker-clear-edit-slm');
+ if (slmModemPickerValue) slmModemPickerValue.value = unit.deployed_with_modem_id || '';
+ if (unit.deployed_with_modem_id && unit.device_type === 'slm') {
+ // Fetch modem display (ID + IP + note)
+ fetch(`/api/roster/${unit.deployed_with_modem_id}`)
+ .then(r => r.ok ? r.json() : null)
+ .then(modem => {
+ if (modem && slmModemPickerSearch) {
+ let display = modem.id;
+ if (modem.ip_address) display += ` - ${modem.ip_address}`;
+ if (modem.note) display += ` - ${modem.note}`;
+ slmModemPickerSearch.value = display;
+ if (slmModemPickerClear) slmModemPickerClear.classList.remove('hidden');
+ }
+ })
+ .catch(() => {
+ if (slmModemPickerSearch) slmModemPickerSearch.value = unit.deployed_with_modem_id;
+ });
+ } else {
+ if (slmModemPickerSearch) slmModemPickerSearch.value = '';
+ if (slmModemPickerClear) slmModemPickerClear.classList.add('hidden');
+ }
+
// Cascade section - show if there's a paired device
const cascadeSection = document.getElementById('editCascadeSection');
const cascadeToUnitId = document.getElementById('editCascadeToUnitId');
@@ -1154,11 +1189,20 @@
});
}
+ // Check if any modal is currently open
+ function isAnyModalOpen() {
+ const modalIds = ['addUnitModal', 'editUnitModal', 'renameUnitModal', 'importModal', 'quickCreateProjectModal'];
+ return modalIds.some(id => {
+ const modal = document.getElementById(id);
+ return modal && !modal.classList.contains('hidden');
+ });
+ }
+
document.addEventListener('DOMContentLoaded', function() {
// Auto-refresh device list every 30 seconds (increased from 10s to reduce flicker)
setInterval(() => {
const deviceContent = document.getElementById('device-content');
- if (deviceContent && !document.querySelector('.modal:not(.hidden)')) {
+ if (deviceContent && !isAnyModalOpen()) {
// Only auto-refresh if no modal is open
refreshDeviceList();
}
diff --git a/templates/unit_detail.html b/templates/unit_detail.html
index 2f7ca90..92e4f80 100644
--- a/templates/unit_detail.html
+++ b/templates/unit_detail.html
@@ -43,7 +43,7 @@
- --
+
+
+ --
+
+ --
+
@@ -174,6 +179,54 @@
--
+
+
+
+
+
+
+ Sound Level Meter Information
+
+
+
+
+
+ --
+
+
+
+
+ --
+
+
+
+
+
+ --
+
+ --
+
+
@@ -287,7 +340,7 @@
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-seismo-orange">
-
+
@@ -336,8 +389,20 @@
-
+
+
+ {% set picker_id = "-detail-seismo" %}
+ {% set input_name = "deployed_with_modem_id" %}
+ {% include "partials/modem_picker.html" with context %}
+
+
+
@@ -358,8 +423,13 @@
-
+
+
+
+
+
@@ -411,11 +481,20 @@
-
+
+
+ {% set picker_id = "-detail-slm" %}
+ {% set input_name = "deployed_with_modem_id" %}
+ {% include "partials/modem_picker.html" with context %}
+
+
+
Select the modem that provides network connectivity for this SLM
@@ -442,6 +521,54 @@
class="w-full px-4 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-700 text-gray-900 dark:text-white focus:ring-2 focus:ring-seismo-orange">
+
+
+
|