Add hightlight event frmStatus

1. Добавлена подсветка клиентов c окрытой транзакцией превышающей время idle_in_transaction_session_timeout.
   Цвет выбирается в настройках.
2. Добавлен фильтр показывающий только строки с подсветкой.
This commit is contained in:
levinsv 2025-08-19 16:25:26 +05:00
parent a77fcfcd5a
commit f02ecba5b4
13 changed files with 661 additions and 410 deletions

View file

@ -30,49 +30,7 @@
#include "utils/WaitSample.h"
#include "ctl/wxTopActivity.h"
enum
{
CTL_RATECBO = 250,
CTL_REFRESHBTN,
CTL_CANCELBTN,
CTL_TERMINATEBTN,
CTL_COMMITBTN,
CTL_ROLLBACKBTN,
CTL_LOGCBO,
CTL_ROTATEBTN,
CTL_STATUSLIST,
CTL_LOCKLIST,
CTL_XACTLIST,
CTL_LOGLIST,
CTL_QUERYSTATELIST,
MNU_STATUSPAGE,
MNU_LOCKPAGE,
MNU_XACTPAGE,
MNU_LOGPAGE,
MNU_QUERYSTATEPAGE,
MNU_TERMINATE,
MNU_COMMIT,
MNU_ROLLBACK,
MNU_COPY_QUERY,
MNU_CLEAR_FILTER_SERVER_STATUS,
MNU_COPY_QUERY_PLAN,
MNU_HIGHLIGHTSTATUS,
MNU_QUERYSTATEVERBOSE,
MNU_QUERYSTATETIME,
MNU_QUERYSTATEBUFFER,
MNU_QUERYSTATETRIGGER,
MNU_WAITENABLE,
MNU_WAITSAVE,
CMD_EVENT_FIND_STR,
TIMER_REFRESHUI_ID,
TIMER_STATUS_ID,
TIMER_LOCKS_ID,
TIMER_XACT_ID,
TIMER_LOG_ID,
TIMER_QUERYSTATE_ID,
TIMER_LOGHINT_ID
};
#include "frm/menuServerStatus.h"
enum
{
@ -212,6 +170,7 @@ private:
bool showCurrent, isCurrent;
long backend_pid;
long idle_in_transaction_session_timeout=30;
int wait_event_type_col;
bool isrecovery,track_commit_timestamp, is_read_log;
bool wait_sample, wait_enable, wait_save,std,pro;
@ -259,6 +218,7 @@ private:
wxArrayString queries;
wxArrayInt filterColumn;
wxArrayString filterValue;
bool onlyhightligth = false;
int statusColWidth[12], lockColWidth[10], xactColWidth[5], querystateColWidth[5];
popuphelp* m_Popup = NULL;
@ -350,6 +310,7 @@ private:
void OnCommit(wxCommandEvent &event);
void OnRollback(wxCommandEvent &event);
void OnClearFilter(wxCommandEvent& event);
void OnSetHighlightFilter(wxCommandEvent& event);
void OnLogKeyUp(wxKeyEvent& event);
void OnAddLabelTextThread(wxThreadEvent& event);
void ActivatePane(wxString name);

View file

@ -0,0 +1,45 @@
#pragma once
enum
{
CTL_RATECBO = 250,
CTL_REFRESHBTN,
CTL_CANCELBTN,
CTL_TERMINATEBTN,
CTL_COMMITBTN,
CTL_ROLLBACKBTN,
CTL_LOGCBO,
CTL_ROTATEBTN,
CTL_STATUSLIST,
CTL_LOCKLIST,
CTL_XACTLIST,
CTL_LOGLIST,
CTL_QUERYSTATELIST,
MNU_STATUSPAGE,
MNU_LOCKPAGE,
MNU_XACTPAGE,
MNU_LOGPAGE,
MNU_QUERYSTATEPAGE,
MNU_TERMINATE,
MNU_COMMIT,
MNU_ROLLBACK,
MNU_COPY_QUERY,
MNU_CLEAR_FILTER_SERVER_STATUS,
MNU_COPY_QUERY_PLAN,
MNU_HIGHLIGHTSTATUS,
MNU_QUERYSTATEVERBOSE,
MNU_QUERYSTATETIME,
MNU_QUERYSTATEBUFFER,
MNU_QUERYSTATETRIGGER,
MNU_WAITENABLE,
MNU_WAITSAVE,
CMD_EVENT_FIND_STR,
TIMER_REFRESHUI_ID,
TIMER_STATUS_ID,
TIMER_LOCKS_ID,
TIMER_XACT_ID,
TIMER_LOG_ID,
TIMER_QUERYSTATE_ID,
TIMER_LOGHINT_ID,
MNU_SET_FILTER_HIGHLIGHT_STATUS
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

View file

@ -0,0 +1,119 @@
#ifndef WARNING_AMBER_48DP_PNG_H
#define WARNING_AMBER_48DP_PNG_H
static const unsigned char warning_amber_48dp_png_data[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,
0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30,
0x08, 0x03, 0x00, 0x00, 0x00, 0x60, 0xdc, 0x09,
0xb5, 0x00, 0x00, 0x00, 0x20, 0x63, 0x48, 0x52,
0x4d, 0x00, 0x00, 0x7a, 0x26, 0x00, 0x00, 0x80,
0x84, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x80,
0xe8, 0x00, 0x00, 0x75, 0x30, 0x00, 0x00, 0xea,
0x60, 0x00, 0x00, 0x3a, 0x98, 0x00, 0x00, 0x17,
0x70, 0x9c, 0xba, 0x51, 0x3c, 0x00, 0x00, 0x00,
0x90, 0x50, 0x4c, 0x54, 0x45, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07,
0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1,
0x07, 0xff, 0xc1, 0x07, 0xff, 0xc1, 0x07, 0xff,
0xc1, 0x07, 0xff, 0xff, 0xff, 0xdb, 0x67, 0x40,
0xe1, 0x00, 0x00, 0x00, 0x2e, 0x74, 0x52, 0x4e,
0x53, 0x00, 0x4a, 0x05, 0xd9, 0xd8, 0x73, 0x72,
0x16, 0xf0, 0x15, 0x9b, 0x9a, 0x32, 0xfd, 0x31,
0xc3, 0xc2, 0x58, 0x57, 0x09, 0xe2, 0xe1, 0x80,
0x7f, 0x1e, 0xf6, 0x1d, 0xa9, 0xa8, 0x3d, 0x3c,
0x02, 0xce, 0xcd, 0x65, 0x64, 0x0f, 0xea, 0xe9,
0x8e, 0x8d, 0x27, 0xfa, 0x26, 0xb6, 0xb5, 0x29,
0xe1, 0x4f, 0x6b, 0x00, 0x00, 0x00, 0x01, 0x62,
0x4b, 0x47, 0x44, 0x2f, 0x23, 0xd4, 0x20, 0x11,
0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73,
0x00, 0x00, 0x0b, 0x13, 0x00, 0x00, 0x0b, 0x13,
0x01, 0x00, 0x9a, 0x9c, 0x18, 0x00, 0x00, 0x00,
0xf5, 0x49, 0x44, 0x41, 0x54, 0x48, 0xc7, 0xed,
0x93, 0xc9, 0x12, 0x82, 0x30, 0x10, 0x05, 0x01,
0x45, 0x71, 0x05, 0x71, 0xc5, 0x0d, 0x15, 0xdc,
0xf5, 0xfd, 0xff, 0xe7, 0x29, 0x8a, 0x08, 0x61,
0x92, 0x0c, 0x57, 0xcb, 0x3e, 0x4d, 0x55, 0x5e,
0x1f, 0x72, 0x68, 0xc3, 0xf8, 0x5d, 0x4c, 0xb3,
0xda, 0xde, 0xaa, 0xd5, 0xad, 0x4a, 0x82, 0x0d,
0x34, 0xaa, 0xec, 0x9b, 0x0e, 0xe0,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 0x8b, 0x07, 0x57, 0xd6,
0x8d, 0x5d, 0x2c, 0xc0, 0xb6, 0xeb, 0x00, 0x00,
0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82,
};
#include "wx/mstream.h"
static wxImage *warning_amber_48dp_png_img()
{
if (!wxImage::FindHandler(wxT("PNG file")))
wxImage::AddHandler(new wxPNGHandler());
static wxImage *img_warning_amber_48dp_png = new wxImage();
if (!img_warning_amber_48dp_png || !img_warning_amber_48dp_png->IsOk())
{
wxMemoryInputStream img_warning_amber_48dp_pngIS(warning_amber_48dp_png_data, sizeof(warning_amber_48dp_png_data));
img_warning_amber_48dp_png->LoadFile(img_warning_amber_48dp_pngIS, wxBITMAP_TYPE_PNG);
}
return img_warning_amber_48dp_png;
}
#define warning_amber_48dp_png_img warning_amber_48dp_png_img()
static wxBitmap *warning_amber_48dp_png_bmp()
{
static wxBitmap *bmp_warning_amber_48dp_png;
if (!bmp_warning_amber_48dp_png || !bmp_warning_amber_48dp_png->IsOk())
bmp_warning_amber_48dp_png = new wxBitmap(*warning_amber_48dp_png_img);
return bmp_warning_amber_48dp_png;
}
#define warning_amber_48dp_png_bmp warning_amber_48dp_png_bmp()
static wxIcon *warning_amber_48dp_png_ico()
{
static wxIcon *ico_warning_amber_48dp_png;
if (!ico_warning_amber_48dp_png || !ico_warning_amber_48dp_png->IsOk())
{
ico_warning_amber_48dp_png = new wxIcon();
ico_warning_amber_48dp_png->CopyFromBitmap(*warning_amber_48dp_png_bmp);
}
return ico_warning_amber_48dp_png;
}
#define warning_amber_48dp_png_ico warning_amber_48dp_png_ico()
#endif // WARNING_AMBER_48DP_PNG_H

View file

@ -9,6 +9,7 @@
#include <map>
#include <vector>
#include "wx/display.h"
#include "frm/menuServerStatus.h"
class popuphelp :
public wxPopupTransientWindow
@ -155,7 +156,7 @@ public:
wxString wname = GetParent()->GetName();
if (wname == "frmStatus") {
//CMD_EVENT_FIND_STR
wxCommandEvent event(wxEVT_MENU, 281);
wxCommandEvent event(wxEVT_MENU, CMD_EVENT_FIND_STR);
event.SetEventObject(this);
// Give it some contents
event.SetString(ctext);

View file

@ -584,6 +584,16 @@ public:
{
Write(wxT("SlowProcessColour"), newval);
}
void SetIdle_in_transaction_session_timeoutProcessColour(const wxString& newval)
{
Write(wxT("Idle_in_transaction_session_timeoutProcessColour"), newval);
}
wxString GetIdle_in_transaction_session_timeoutProcessColour() const
{
wxString s;
Read(wxT("Idle_in_transaction_session_timeoutProcessColour"), &s, wxT("#ad5bff"));
return s;
}
wxString GetBlockedProcessColour() const
{
wxString s;