sync plugin, plugins UI css fixes

This commit is contained in:
jokob-sk
2025-07-21 17:56:49 +10:00
parent 752322bbad
commit 9ada27cf7e
5 changed files with 88 additions and 45 deletions

View File

@@ -885,6 +885,10 @@ height: 50px;
margin: 10px; margin: 10px;
padding: 10px; padding: 10px;
} }
#notifications .notification-box{
min-height: 90vh;
}
#notificationData textarea{ #notificationData textarea{
width: 100%; width: 100%;
@@ -1669,6 +1673,10 @@ input[readonly] {
} }
/* AdminLTE overrides */ /* AdminLTE overrides */
.content-wrapper {
min-height: calc(100vh - 31px) !important;
}
#networkTree .box #networkTree .box
{ {
border-width:1px; border-width:1px;
@@ -1905,7 +1913,10 @@ input[readonly] {
/* PLUGINS page */ /* PLUGINS page */
/* ----------------------------------------------------------------- */ /* ----------------------------------------------------------------- */
#tabs-location
{
padding-right: 0px;
}
.plugin-filters .plugin-filters
{ {
@@ -1920,9 +1931,25 @@ input[readonly] {
padding-bottom: 0px; padding-bottom: 0px;
} }
.plugin-content .left-nav{ .plugin-content .nav-tabs li a
{
border-right-width: 0px;
}
#tabs-content-location-wrap
{
min-height: 90vh;
}
#tabs-content-location textarea {
width: 100%; width: 100%;
}
.plugin-content .left-nav{
width: calc(100%);
padding-right: 0px; padding-right: 0px;
z-index: 2;
background-color: inherit !important;
} }
.plugin-content #tabs-content-location .plugin-content #tabs-content-location
@@ -1996,6 +2023,8 @@ input[readonly] {
.pluginBadge .pluginBadge
{ {
float: right; float: right;
margin-right: 3px;
opacity: 0.6;
} }
.pluginBadgeWrap .pluginBadgeWrap

View File

@@ -147,7 +147,7 @@
{ {
"column": "Watched_Value1", "column": "Watched_Value1",
"css_classes": "col-sm-3", "css_classes": "col-sm-3",
"show": true, "show": false,
"type": "label", "type": "label",
"default_value": "", "default_value": "",
"options": [], "options": [],
@@ -177,7 +177,7 @@
{ {
"column": "Watched_Value3", "column": "Watched_Value3",
"css_classes": "col-sm-2", "css_classes": "col-sm-2",
"show": true, "show": false,
"type": "label", "type": "label",
"default_value": "", "default_value": "",
"options": [], "options": [],
@@ -193,7 +193,7 @@
"column": "Watched_Value4", "column": "Watched_Value4",
"css_classes": "col-sm-2", "css_classes": "col-sm-2",
"show": true, "show": true,
"type": "device_mac", "type": "device_name_mac",
"default_value": "", "default_value": "",
"options": [], "options": [],
"localized": ["name"], "localized": ["name"],

View File

@@ -311,7 +311,7 @@
"column": "Watched_Value2", "column": "Watched_Value2",
"css_classes": "col-sm-2", "css_classes": "col-sm-2",
"show": true, "show": true,
"type": "label", "type": "textarea_readonly",
"default_value": "", "default_value": "",
"options": [], "options": [],
"localized": [ "localized": [

View File

@@ -177,11 +177,10 @@ def main():
if file_name != 'last_result.log': if file_name != 'last_result.log':
mylog('verbose', [f'[{pluginName}] Processing: "{file_name}"']) mylog('verbose', [f'[{pluginName}] Processing: "{file_name}"'])
# Store e.g. Node_1 from last_result.encoded.Node_1.1.log # make sure the file has teh correct name (e.g last_result.encoded.Node_1.1.log) to skip any otehr plugin files
tmp_SyncHubNodeName = ''
if len(file_name.split('.')) > 2: if len(file_name.split('.')) > 2:
tmp_SyncHubNodeName = file_name.split('.')[1] # Store e.g. Node_1 from last_result.encoded.Node_1.1.log
syncHubNodeName = file_name.split('.')[1]
file_path = f"{LOG_PATH}/{file_name}" file_path = f"{LOG_PATH}/{file_name}"
@@ -189,7 +188,7 @@ def main():
data = json.load(f) data = json.load(f)
for device in data['data']: for device in data['data']:
if device['devMac'] not in unique_mac_addresses: if device['devMac'] not in unique_mac_addresses:
device['devSyncHubNode'] = tmp_SyncHubNodeName device['devSyncHubNode'] = syncHubNodeName
unique_mac_addresses.add(device['devMac']) unique_mac_addresses.add(device['devMac'])
device_data.append(device) device_data.append(device)

View File

@@ -17,9 +17,11 @@
<ul id="tabs-location" class="nav nav-tabs col-sm-2 "> <ul id="tabs-location" class="nav nav-tabs col-sm-2 ">
<!-- PLACEHOLDER --> <!-- PLACEHOLDER -->
</ul> </ul>
<div id="tabs-content-location" class="tab-content col-sm-10"> <div id="tabs-content-location-wrap" class="tab-content col-sm-10">
<div id="tabs-content-location" class="tab-content col-sm-12">
<!-- PLACEHOLDER --> <!-- PLACEHOLDER -->
</div> </div>
</div>
</section> </section>
@@ -35,7 +37,14 @@ function initMacFilter() {
const mac = urlParams.get('mac'); const mac = urlParams.get('mac');
// Set the MAC in the input field // Set the MAC in the input field
if(mac)
{
$("#txtMacFilter").val(mac); $("#txtMacFilter").val(mac);
}
else
{
$("#txtMacFilter").val("--");
}
return mac; return mac;
} }
@@ -52,7 +61,6 @@ function initFields() {
// - different from what's already displayed // - different from what's already displayed
if (currentVal != "--" && currentVal !== lastMac) { if (currentVal != "--" && currentVal !== lastMac) {
// Update the lastMac so we don't reload unnecessarily // Update the lastMac so we don't reload unnecessarily
lastMac = currentVal; lastMac = currentVal;
@@ -315,6 +323,8 @@ function createTabHeader(pluginObj, stats) {
// Determine the active class for the first tab // Determine the active class for the first tab
const activeClass = pluginDefinitions.indexOf(pluginObj) === 0 ? 'active' : ''; const activeClass = pluginDefinitions.indexOf(pluginObj) === 0 ? 'active' : '';
if(stats.objectDataCount > 0)
{
// Append the tab header to the tabs location // Append the tab header to the tabs location
$('#tabs-location').append(` $('#tabs-location').append(`
<li class="left-nav ${activeClass} "> <li class="left-nav ${activeClass} ">
@@ -326,6 +336,7 @@ function createTabHeader(pluginObj, stats) {
</li> </li>
`); `);
} }
}
function createTabContent(pluginObj) { function createTabContent(pluginObj) {
const prefix = pluginObj.unique_prefix; // Get the unique prefix for the plugin const prefix = pluginObj.unique_prefix; // Get the unique prefix for the plugin
@@ -479,7 +490,11 @@ function shouldBeShown(entry, pluginObj)
compare_use_quotes = dataFilters[i].compare_use_quotes; compare_use_quotes = dataFilters[i].compare_use_quotes;
compare_field_id_value = $(`#${compare_field_id}`).val(); compare_field_id_value = $(`#${compare_field_id}`).val();
// apply filter i sthe filter field has a valid value // console.log(compare_field_id_value);
// console.log(compare_field_id);
// apply filter if the filter field has a valid value
if(compare_field_id_value != undefined && compare_field_id_value != '--') if(compare_field_id_value != undefined && compare_field_id_value != '--')
{ {
// valid value // valid value