Overridden by ENV + Icons preview #802

This commit is contained in:
jokob-sk
2024-09-23 13:32:36 +10:00
parent 30750a9449
commit f6a06842cc
4 changed files with 34 additions and 3 deletions

View File

@@ -1117,6 +1117,36 @@ input[readonly] {
display: inline-grid;
}
/* Basic style for the div elements */
#settingsPage .setting_overriden_by_env {
position: relative;
/* width: 300px;
height: 200px; */
background-color: #f3f3f3;
border: 1px solid #ccc;
margin: 20px;
z-index: 10;
}
/* Style for the overlay */
#settingsPage .setting_overriden_by_env::after {
content: "Overridden with ENV variable";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6); /* semi-transparent black overlay */
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
font-weight: 700;
z-index: 11;
}
/* ----------------------------------------------------------------- */
/* Devices page */
/* ----------------------------------------------------------------- */

View File

@@ -172,7 +172,7 @@
"PGkgY2xhc3M9ImZhIGZhLWxpZ2h0YnVsYiI+PC9pPg==",
"PGkgY2xhc3M9ImZhIGZhLXNoaWVsZCI+PC9pPg==",
"PGkgY2xhc3M9ImZhIGZhLXdpZmkiPjwvaT4=",
"PGkgY2xhc3M9J2ZhIGZhLWdhbWVwYWQnPjwvaT4"
"PGkgY2xhc3M9ImZhIGZhLWdhbWVwYWQiPjwvaT4="
],
"options": [],
"localized": [],

View File

@@ -378,6 +378,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
const valIn = set['Value'];
const codeName = set['Code_Name'];
const overriddenByEnv = set['OverriddenByEnv'] == 1;
const setType = set['Type'];
const isMetadata = codeName.includes('__metadata');
// is this isn't a metadata entry, get corresponding metadata object from the dummy setting
@@ -416,7 +417,7 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
<div class="table_cell setting_description">
${getString(codeName + '_description', set['Description'])}
</div>
<div class="table_cell input-group setting_input input-group col-sm-12">
<div class="table_cell input-group setting_input ${overriddenByEnv ? "setting_overriden_by_env" : ""} input-group col-sm-12">
`;
// OVERRIDE

View File

@@ -248,7 +248,7 @@ def execute_plugin(db, all_plugins, plugin, pluginsState = plugins_state() ):
for line in newLines:
columns = line.split("|")
# There have to be 9 or 13 columns
# There have to be 9 or 13 columns
if len(columns) not in [9, 13]:
mylog('none', [f'[Plugins] Wrong number of input values, must be 9 or 13, got {len(columns)} from: {line}'])
continue # Skip lines with incorrect number of columns