fix client connet redirect to scheda on page - migrazione localization
This commit is contained in:
+10
-58
@@ -1372,24 +1372,20 @@ class Server extends CommonDBTM
|
||||
return;
|
||||
}
|
||||
|
||||
echo '<div class="d-flex justify-content-end mb-2">';
|
||||
echo '<input type="text" id="missing-search" class="form-control form-control-sm" placeholder="' . htmlspecialchars(__('Search...', 'urbackup')) . '" style="width:250px">';
|
||||
echo '</div>';
|
||||
|
||||
$formAction = PLUGIN_URBACKUP_WEB_DIR . '/front/server.form.php';
|
||||
|
||||
echo '<table id="missing-table" class="table table-striped table-hover">';
|
||||
echo '<table class="table table-striped table-hover">';
|
||||
echo '<thead><tr>';
|
||||
echo '<th class="sortable" data-col="0">' . htmlspecialchars(__('Name')) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="1">' . htmlspecialchars(Entity::getTypeName(1)) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="2">' . htmlspecialchars(Location::getTypeName(1)) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="3">' . htmlspecialchars(__('Inventory number')) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="4">' . htmlspecialchars(__('IP address', 'urbackup')) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="5">' . htmlspecialchars(State::getTypeName(1)) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="6">' . htmlspecialchars(User::getTypeName(1)) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th class="sortable" data-col="7">' . htmlspecialchars(Group::getTypeName(1)) . ' <span class="sort-arrow"></span></th>';
|
||||
echo '<th>' . htmlspecialchars(__('Name')) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(Entity::getTypeName(1)) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(Location::getTypeName(1)) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(__('Inventory number')) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(__('IP address', 'urbackup')) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(State::getTypeName(1)) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(User::getTypeName(1)) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(Group::getTypeName(1)) . '</th>';
|
||||
if ($canWrite) {
|
||||
echo '<th data-col="8">' . htmlspecialchars(__('Actions', 'urbackup')) . '</th>';
|
||||
echo '<th>' . htmlspecialchars(__('Actions', 'urbackup')) . '</th>';
|
||||
}
|
||||
echo '</tr></thead>';
|
||||
echo '<tbody>';
|
||||
@@ -1434,50 +1430,6 @@ class Server extends CommonDBTM
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
echo <<<'JAVASCRIPT'
|
||||
<script>
|
||||
$(function () {
|
||||
var sortDir = {};
|
||||
$('#missing-table th.sortable').on('click', function () {
|
||||
var col = parseInt($(this).data('col'));
|
||||
var $table = $('#missing-table');
|
||||
var $tbody = $table.find('tbody');
|
||||
var rows = $tbody.find('tr').get();
|
||||
|
||||
var dir = sortDir[col] === 'asc' ? 'desc' : 'asc';
|
||||
sortDir[col] = dir;
|
||||
|
||||
rows.sort(function (a, b) {
|
||||
var aVal = $(a).children('td').eq(col).text().trim().toLowerCase();
|
||||
var bVal = $(b).children('td').eq(col).text().trim().toLowerCase();
|
||||
if (aVal < bVal) return dir === 'asc' ? -1 : 1;
|
||||
if (aVal > bVal) return dir === 'asc' ? 1 : -1;
|
||||
return 0;
|
||||
});
|
||||
|
||||
$.each(rows, function (i, row) { $tbody.append(row); });
|
||||
|
||||
$table.find('th .sort-arrow').text('');
|
||||
$(this).find('.sort-arrow').text(dir === 'asc' ? '\u25B2' : '\u25BC');
|
||||
});
|
||||
|
||||
$('#missing-search').on('keyup', function () {
|
||||
var val = $(this).val().toLowerCase();
|
||||
$('#missing-table tbody tr').each(function () {
|
||||
var match = false;
|
||||
$(this).children('td').each(function () {
|
||||
if ($(this).text().toLowerCase().indexOf(val) > -1) {
|
||||
match = true;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(this).toggle(match);
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
JAVASCRIPT;
|
||||
}
|
||||
|
||||
private static function getCachedName(string $classname, int $id, array &$cache): string
|
||||
|
||||
Reference in New Issue
Block a user