Skip to content

Commit

Permalink
Fix a bug in log view search
Browse files Browse the repository at this point in the history
And don't filter empty rows
  • Loading branch information
kalaksi committed Oct 29, 2023
1 parent 479994b commit 46eed55
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/command_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ impl CommandHandler {
}).unwrap();

command.arguments(connector_messages);
::log::debug!("Opening terminal with command: {}", command.to_string());
command
}

Expand Down
3 changes: 0 additions & 3 deletions src/frontend/qt/models/command_handler_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ impl CommandHandlerModel {
if self.configuration.preferences.terminal == configuration::INTERNAL {
let command = self.command_handler.open_remote_terminal_command(&host_id, &command_id, &parameters);
let command_qsl = command.to_vec().into_iter().map(QString::from).collect::<QStringList>();

::log::debug!("Opening terminal with command: {}", command.to_string());

self.terminalSubviewOpened(QString::from(command_id), command_qsl)
}
else {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/qt/qml/DetailsView/HostDetailsLogView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Item {

// TODO: handle better situations where more log lines have appeared and so this isn't an accurate position
let oldListEnd = logList.rows.length - 1
let rows = commandResult.message.split("\n").filter((line) => line.length > 0)
let rows = commandResult.message.split("\n")
rows.reverse()
logList.rows = rows
logList.currentIndex = oldListEnd
Expand Down Expand Up @@ -160,7 +160,7 @@ Item {

LogList {
id: logList
rows: root.text.split("\n").filter((line) => line.length > 0)
rows: root.text.split("\n")
visible: rows.length > 0

Layout.fillWidth: true
Expand Down
5 changes: 3 additions & 2 deletions src/frontend/qt/qml/DetailsView/LogList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import QtQuick.Controls 2.15
import "../Text"
import "../Button"
import "../js/TextTransform.js" as TextTransform
import "../js/Utils.js" as Utils


ListView {
Expand Down Expand Up @@ -184,7 +185,7 @@ ListView {
}

modelRows.reverse()
matchingRows.sort()
Utils.sortNumerically(matchingRows)
return [modelRows, matchingRows, totalMatches]
}

Expand All @@ -201,7 +202,7 @@ ListView {
}

function addRows(newRows) {
root.rows = newRows.filter((row) => row.length > 0).concat(root.rows)
root.rows = newRows.concat(root.rows)
}

function getSearchDetails() {
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/qt/qml/js/Utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 46eed55

Please sign in to comment.