mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix do not include template text in HTML page (#9476)
This commit is contained in:
committed by
Tony Murray
parent
c5bb60907c
commit
36ea8a043e
@@ -14,7 +14,7 @@ require_once 'includes/modal/delete_alert_template.inc.php';
|
|||||||
<th data-column-id="id" data-searchable="false" data-identifier="true" data-type="numeric">#</th>
|
<th data-column-id="id" data-searchable="false" data-identifier="true" data-type="numeric">#</th>
|
||||||
<th data-column-id="templatename">Name</th>
|
<th data-column-id="templatename">Name</th>
|
||||||
<th data-column-id="actions" data-searchable="false" data-formatter="commands">Action</th>
|
<th data-column-id="actions" data-searchable="false" data-formatter="commands">Action</th>
|
||||||
<th data-column-id="template" data-searchable="false" data-visible="false">Template</th>
|
<th data-column-id="old_template" data-searchable="false" data-visible="false">Old template</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -30,11 +30,12 @@ foreach ($full_query as $template) {
|
|||||||
$template_ids = array_column($templates, 'id');
|
$template_ids = array_column($templates, 'id');
|
||||||
array_multisort($templates, SORT_ASC, $template_ids);
|
array_multisort($templates, SORT_ASC, $template_ids);
|
||||||
foreach ($templates as $template) {
|
foreach ($templates as $template) {
|
||||||
|
$old_template = strpos($template['template'], "{/if}") !== false ? "1" : "";
|
||||||
echo '<tr data-row-id="'.$template['id'].'">
|
echo '<tr data-row-id="'.$template['id'].'">
|
||||||
<td>'.$template['id'].'</td>
|
<td>'.$template['id'].'</td>
|
||||||
<td>'.$template['name'].'</td>
|
<td>'.$template['name'].'</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>'.$template['template'].'</td>
|
<td>'.$old_template.'</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,9 +65,8 @@ $(document).ready(function() {
|
|||||||
formatters: {
|
formatters: {
|
||||||
"commands": function(column, row) {
|
"commands": function(column, row) {
|
||||||
var response = '';
|
var response = '';
|
||||||
template = row.template;
|
|
||||||
//FIXME remove Deprecated template
|
//FIXME remove Deprecated template
|
||||||
if (template.indexOf("{/if}") >= 0) {
|
if (row.old_template == "1") {
|
||||||
response = "<button type='button' class='btn btn-xs btn-warning' data-content=' class='btn btn-xs btn-warning' data-content='><i class='fa fa-exclamation-triangle' title='This is a legacy template and needs converting, please edit this template and click convert then save'><i class='fa fa-exclamation-triangle'></i></button> ";
|
response = "<button type='button' class='btn btn-xs btn-warning' data-content=' class='btn btn-xs btn-warning' data-content='><i class='fa fa-exclamation-triangle' title='This is a legacy template and needs converting, please edit this template and click convert then save'><i class='fa fa-exclamation-triangle'></i></button> ";
|
||||||
}
|
}
|
||||||
if(row.id == 0) {
|
if(row.id == 0) {
|
||||||
|
Reference in New Issue
Block a user