代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/drbd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4f71713b706a75fae6b3835aa92e4280165ed67e Mon Sep 17 00:00:00 2001
From: Robert Altnoeder <robert.altnoeder@linbit.com>
Date: Tue, 19 Mar 2024 09:25:56 +0100
Subject: [PATCH 080/100] DRBDmon: Busy indicator, debug log updates
- Debug log: Enable select-all/deselect-all
- Busy indicator:
- Indicate busy on multiple item operations
- Indicate busy when queueing multiple commands
---
user/drbdmon/terminal/DrbdCommandsImpl.cpp | 10 +++++++
user/drbdmon/terminal/GlobalCommandsImpl.cpp | 31 ++++++++++++++------
user/drbdmon/terminal/MDspBase.cpp | 5 ++++
user/drbdmon/terminal/MDspConnections.cpp | 9 ++++++
user/drbdmon/terminal/MDspPeerVolumes.cpp | 7 +++++
user/drbdmon/terminal/MDspResources.cpp | 10 ++++++-
user/drbdmon/terminal/MDspStdListBase.cpp | 1 +
user/drbdmon/terminal/MDspVolumes.cpp | 7 +++++
8 files changed, 70 insertions(+), 10 deletions(-)
diff --git a/user/drbdmon/terminal/DrbdCommandsImpl.cpp b/user/drbdmon/terminal/DrbdCommandsImpl.cpp
index 23f79db5..78ef870c 100644
--- a/user/drbdmon/terminal/DrbdCommandsImpl.cpp
+++ b/user/drbdmon/terminal/DrbdCommandsImpl.cpp
@@ -144,6 +144,8 @@ bool DrbdCommandsImpl::exec_for_resources(
active_page == DisplayId::display_page::RSC_ACTIONS) &&
dsp_comp_hub.dsp_shared->have_resources_selection())
{
+ dsp_comp_hub.dsp_common->application_working();
+
cmd_valid = true;
ResourcesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_resources_map();
@@ -199,6 +201,8 @@ bool DrbdCommandsImpl::exec_for_connections(
// On resource list or resource actions with a selection of multiple resources,
// operates on all connections or all selected resources, overrides any connection selection
+ dsp_comp_hub.dsp_common->application_working();
+
cmd_valid = true;
ResourcesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_resources_map();
@@ -227,6 +231,8 @@ bool DrbdCommandsImpl::exec_for_connections(
{
// On connection list or connection details with a selection of multiple connections
+ dsp_comp_hub.dsp_common->application_working();
+
ConnectionsMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_connections_map();
ConnectionsMap::KeysIterator con_iter(selection_map);
@@ -299,6 +305,8 @@ bool DrbdCommandsImpl::exec_for_volumes(
active_page == DisplayId::display_page::VLM_ACTIONS) &&
dsp_comp_hub.dsp_shared->have_volumes_selection())
{
+ dsp_comp_hub.dsp_common->application_working();
+
cmd_valid = true;
VolumesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_volumes_map();
@@ -368,6 +376,8 @@ bool DrbdCommandsImpl::exec_for_peer_volumes(
active_page == DisplayId::display_page::PEER_VLM_ACTIONS) &&
dsp_comp_hub.dsp_shared->have_peer_volumes_selection())
{
+ dsp_comp_hub.dsp_common->application_working();
+
cmd_valid = true;
VolumesMap& selection_map = dsp_comp_hub.dsp_shared->get_selected_peer_volumes_map();
diff --git a/user/drbdmon/terminal/GlobalCommandsImpl.cpp b/user/drbdmon/terminal/GlobalCommandsImpl.cpp
index 6d772b07..675d5eb0 100644
--- a/user/drbdmon/terminal/GlobalCommandsImpl.cpp
+++ b/user/drbdmon/terminal/GlobalCommandsImpl.cpp
@@ -174,14 +174,22 @@ bool GlobalCommandsImpl::cmd_select_all(const std::string& command, StringTokeni
DisplayId::display_page active_page = dsp_comp_hub.dsp_selector->get_active_page();
if (active_page == DisplayId::display_page::LOG_VIEWER)
{
- std::unique_lock<std::recursive_mutex> lock(dsp_comp_hub.log->queue_lock);
-
- MessageLog::Queue::ValuesIterator entry_iter = dsp_comp_hub.log->iterator();
- while (entry_iter.has_next())
+ MessageLog* const log = active_page == DisplayId::display_page::LOG_VIEWER ?
+ dsp_comp_hub.log : dsp_comp_hub.debug_log;
+ MessageMap& selection = active_page == DisplayId::display_page::LOG_VIEWER ?
+ *(dsp_comp_hub.dsp_shared->selected_log_entries) :
+ *(dsp_comp_hub.dsp_shared->selected_debug_log_entries);
+ dsp_comp_hub.dsp_common->application_working();
{
- MessageLog::Entry* const entry = entry_iter.next();
- const uint64_t entry_id = entry->get_id();
- dsp_comp_hub.dsp_shared->select_log_entry(*(dsp_comp_hub.dsp_shared->selected_log_entries), entry_id);
+ std::unique_lock<std::recursive_mutex> lock(log->queue_lock);
+
+ MessageLog::Queue::ValuesIterator entry_iter = log->iterator();
+ while (entry_iter.has_next())
+ {
+ MessageLog::Entry* const entry = entry_iter.next();
+ const uint64_t entry_id = entry->get_id();
+ dsp_comp_hub.dsp_shared->select_log_entry(selection, entry_id);
+ }
}
dsp_comp_hub.dsp_selector->refresh_display();
accepted = true;
@@ -193,9 +201,14 @@ bool GlobalCommandsImpl::cmd_deselect_all(const std::string& command, StringToke
{
bool accepted = false;
DisplayId::display_page active_page = dsp_comp_hub.dsp_selector->get_active_page();
- if (active_page == DisplayId::display_page::LOG_VIEWER)
+ if (active_page == DisplayId::display_page::LOG_VIEWER ||
+ active_page == DisplayId::display_page::DEBUG_LOG_VIEWER)
{
- dsp_comp_hub.dsp_shared->clear_log_entry_selection(*(dsp_comp_hub.dsp_shared->selected_log_entries));
+ MessageMap& selection = active_page == DisplayId::display_page::LOG_VIEWER ?
+ *(dsp_comp_hub.dsp_shared->selected_log_entries) :
+ *(dsp_comp_hub.dsp_shared->selected_debug_log_entries);
+ dsp_comp_hub.dsp_common->application_working();
+ dsp_comp_hub.dsp_shared->clear_log_entry_selection(selection);
dsp_comp_hub.dsp_selector->refresh_display();
accepted = true;
}
diff --git a/user/drbdmon/terminal/MDspBase.cpp b/user/drbdmon/terminal/MDspBase.cpp
index 601bee63..77bc86af 100644
--- a/user/drbdmon/terminal/MDspBase.cpp
+++ b/user/drbdmon/terminal/MDspBase.cpp
@@ -206,6 +206,11 @@ bool MDspBase::key_pressed(const uint32_t key)
dsp_comp_hub.dsp_common->display_command_line();
leave_command_line_mode();
}
+ else
+ {
+ dsp_comp_hub.dsp_common->application_idle();
+ reposition_text_cursor();
+ }
intercepted = true;
}
diff --git a/user/drbdmon/terminal/MDspConnections.cpp b/user/drbdmon/terminal/MDspConnections.cpp
index 581ad168..36454792 100644
--- a/user/drbdmon/terminal/MDspConnections.cpp
+++ b/user/drbdmon/terminal/MDspConnections.cpp
@@ -678,6 +678,7 @@ bool MDspConnections::execute_command(const std::string& command, StringTokenize
{
if (string_matching::is_pattern(cmd_arg))
{
+ dsp_comp_hub.dsp_common->application_working();
try
{
std::unique_ptr<string_matching::PatternItem> pattern;
@@ -744,6 +745,7 @@ bool MDspConnections::execute_command(const std::string& command, StringTokenize
std::string cmd_arg = tokenizer.next();
if (string_matching::is_pattern(cmd_arg))
{
+ dsp_comp_hub.dsp_common->application_working();
try
{
accepted = change_selection(cmd_arg, command == cmd_names::KEY_CMD_SELECT);
@@ -776,6 +778,7 @@ bool MDspConnections::execute_command(const std::string& command, StringTokenize
DrbdResource* const rsc = dsp_comp_hub.get_monitor_resource();
if (rsc != nullptr)
{
+ dsp_comp_hub.dsp_common->application_working();
const bool prb_mode = is_problem_mode(rsc);
DrbdResource::ConnectionsIterator con_iter = rsc->connections_iterator();
while (con_iter.has_next())
@@ -793,6 +796,7 @@ bool MDspConnections::execute_command(const std::string& command, StringTokenize
else
if (command == cmd_names::KEY_CMD_DESELECT_ALL || command == cmd_names::KEY_CMD_CLEAR_SELECTION)
{
+ dsp_comp_hub.dsp_common->application_working();
clear_selection();
accepted = true;
}
@@ -800,6 +804,11 @@ bool MDspConnections::execute_command(const std::string& command, StringTokenize
{
dsp_comp_hub.dsp_selector->refresh_display();
}
+ else
+ {
+ dsp_comp_hub.dsp_common->application_idle();
+ reposition_text_cursor();
+ }
return accepted;
}
diff --git a/user/drbdmon/terminal/MDspPeerVolumes.cpp b/user/drbdmon/terminal/MDspPeerVolumes.cpp
index e2e64cc8..d9d82bd7 100644
--- a/user/drbdmon/terminal/MDspPeerVolumes.cpp
+++ b/user/drbdmon/terminal/MDspPeerVolumes.cpp
@@ -185,6 +185,7 @@ bool MDspPeerVolumes::execute_command(const std::string& command, StringTokenize
DrbdConnection* const con = dsp_comp_hub.get_monitor_connection();
if (rsc != nullptr && con != nullptr)
{
+ dsp_comp_hub.dsp_common->application_working();
DrbdConnection::VolumesIterator vlm_iter(*con);
if (is_problem_mode(rsc, con))
{
@@ -213,6 +214,7 @@ bool MDspPeerVolumes::execute_command(const std::string& command, StringTokenize
else
if (command == cmd_names::KEY_CMD_DESELECT_ALL || command == cmd_names::KEY_CMD_CLEAR_SELECTION)
{
+ dsp_comp_hub.dsp_common->application_working();
clear_selection();
accepted = true;
}
@@ -220,6 +222,11 @@ bool MDspPeerVolumes::execute_command(const std::string& command, StringTokenize
{
dsp_comp_hub.dsp_selector->refresh_display();
}
+ else
+ {
+ dsp_comp_hub.dsp_common->application_idle();
+ reposition_text_cursor();
+ }
return accepted;
}
diff --git a/user/drbdmon/terminal/MDspResources.cpp b/user/drbdmon/terminal/MDspResources.cpp
index 3a66e264..524569d7 100644
--- a/user/drbdmon/terminal/MDspResources.cpp
+++ b/user/drbdmon/terminal/MDspResources.cpp
@@ -596,6 +596,7 @@ bool MDspResources::execute_command(const std::string& command, StringTokenizer&
{
if (string_matching::is_pattern(cmd_arg))
{
+ dsp_comp_hub.dsp_common->application_working();
try
{
std::unique_ptr<string_matching::PatternItem> pattern;
@@ -638,6 +639,7 @@ bool MDspResources::execute_command(const std::string& command, StringTokenizer&
std::string cmd_arg = tokenizer.next();
if (string_matching::is_pattern(cmd_arg))
{
+ dsp_comp_hub.dsp_common->application_working();
try
{
accepted = change_selection(cmd_arg, command == cmd_names::KEY_CMD_SELECT);
@@ -667,6 +669,7 @@ bool MDspResources::execute_command(const std::string& command, StringTokenizer&
else
if (command == cmd_names::KEY_CMD_SELECT_ALL)
{
+ dsp_comp_hub.dsp_common->application_working();
ResourcesMap& selected_map = select_resources_map();
ResourcesMap::KeysIterator rsc_iter(selected_map);
while (rsc_iter.has_next())
@@ -679,14 +682,19 @@ bool MDspResources::execute_command(const std::string& command, StringTokenizer&
else
if (command == cmd_names::KEY_CMD_DESELECT_ALL || command == cmd_names::KEY_CMD_CLEAR_SELECTION)
{
+ dsp_comp_hub.dsp_common->application_working();
clear_selection();
-
accepted = true;
}
if (accepted)
{
dsp_comp_hub.dsp_selector->refresh_display();
}
+ else
+ {
+ dsp_comp_hub.dsp_common->application_idle();
+ reposition_text_cursor();
+ }
return accepted;
}
diff --git a/user/drbdmon/terminal/MDspStdListBase.cpp b/user/drbdmon/terminal/MDspStdListBase.cpp
index ff370eaa..d5d38b3e 100644
--- a/user/drbdmon/terminal/MDspStdListBase.cpp
+++ b/user/drbdmon/terminal/MDspStdListBase.cpp
@@ -61,6 +61,7 @@ bool MDspStdListBase::key_pressed(const uint32_t key)
else
if (key == KeyCodes::FUNC_04)
{
+ dsp_comp_hub.dsp_common->application_working();
clear_selection();
dsp_comp_hub.dsp_selector->refresh_display();
intercepted = true;
diff --git a/user/drbdmon/terminal/MDspVolumes.cpp b/user/drbdmon/terminal/MDspVolumes.cpp
index f1c6fdb7..9625a58b 100644
--- a/user/drbdmon/terminal/MDspVolumes.cpp
+++ b/user/drbdmon/terminal/MDspVolumes.cpp
@@ -405,6 +405,7 @@ bool MDspVolumes::execute_command(const std::string& command, StringTokenizer& t
DrbdResource* const rsc = dsp_comp_hub.get_monitor_resource();
if (rsc != nullptr)
{
+ dsp_comp_hub.dsp_common->application_working();
const bool prb_mode = is_problem_mode(rsc);
DrbdResource::VolumesIterator vlm_iter = rsc->volumes_iterator();
while (vlm_iter.has_next())
@@ -422,6 +423,7 @@ bool MDspVolumes::execute_command(const std::string& command, StringTokenizer& t
else
if (command == cmd_names::KEY_CMD_DESELECT_ALL || command == cmd_names::KEY_CMD_CLEAR_SELECTION)
{
+ dsp_comp_hub.dsp_common->application_working();
clear_selection();
accepted = true;
}
@@ -429,6 +431,11 @@ bool MDspVolumes::execute_command(const std::string& command, StringTokenizer& t
{
dsp_comp_hub.dsp_selector->refresh_display();
}
+ else
+ {
+ dsp_comp_hub.dsp_common->application_idle();
+ reposition_text_cursor();
+ }
return accepted;
}
--
2.33.1.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。