This commit is contained in:
lsv 2025-12-11 19:51:54 +05:00
commit 4a5ae2b859
5 changed files with 49 additions and 13 deletions

View file

@ -696,11 +696,11 @@ void wxTopActivity::render(wxDC& dc)
std::map<int, int> pid_btype;
// quid -> idx
// быстрый поиск
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
//std::map<long long,int> map_qid_idx;
std::vector<long long> qid_;
//std::vector<int> qid_wait_id;
// сумма ожидания для каждого idx
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> idx
std::vector<std::vector<int>> qid_wait_id_SUM;
//std::vector<std::vector<int>> qid_wait_id;
std::vector<int> sum_bg(m_count_wait);
@ -1044,6 +1044,8 @@ void wxTopActivity::paintSelRange(wxDC& dc, int width_sample) {
{
// current vert line
if (m_area.Contains(p2) && m_area.Contains(p1) && t.IsValid()) {
wxDCTextBgColourChanger bb(dc,wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
wxDCTextColourChanger ff(dc,wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
dc.SetBrush(bgCol);
dc.SetPen(*wxBLACK);
dc.DrawRectangle(r);
@ -1059,6 +1061,9 @@ void wxTopActivity::paintSelRange(wxDC& dc, int width_sample) {
// arrow line
wxPoint points[3];
if (fix_pos_L.IsValid() && (dx2 < dx1)) {
wxDCTextBgColourChanger bb(dc,wxSystemSettings::GetColour(wxSYS_COLOUR_INFOBK));
wxDCTextColourChanger ff(dc,wxSystemSettings::GetColour(wxSYS_COLOUR_INFOTEXT));
wxString labelLeft = fix_pos_L.Format("%d %H:%M:%S");
wxSize szf = dc.GetTextExtent(labelLeft);
wxPoint p1(cx - dx1, m_area.y + 25);
@ -1277,12 +1282,12 @@ void wxTopActivity::setViewRange(int m_aggregate_interval, int RightTime) {
m_RightTime = RightTime;
}
/// <summary>
/// Получение объекта WaitSample и некоторых настроечных параметров.
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WaitSample <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
///
/// </summary>
/// <param name="m_aggregate_interval"> Переменная в которую записывается текущий агрегатный период</param>
/// <param name="RightTime"> Перменная в которую записывается текущая правая граница</param>
/// <returns> Возвращает адрес WaitSample объекта</returns>
/// <param name="m_aggregate_interval"> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <param name="RightTime"> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></param>
/// <returns> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> WaitSample <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></returns>
WaitSample* wxTopActivity::getViewRange(int& m_aggregate_interval, int& RightTime) {
m_aggregate_interval = m_agg_int;
@ -1679,7 +1684,7 @@ void wxCustomButton::render(wxDC& dc)
y = y - h;
}
x = x - widthLine;
int skip = (prev_t - sa.etime) / interval; // не было ожиданий
int skip = (prev_t - sa.etime) / interval; // <EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if (skip > 0) {
x -= skip * widthLine;
}

View file

@ -1922,7 +1922,8 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event)
// Clear the queries array content
queries.Clear();
wxString blocked=wxT("");
int countsenders=0;
long pidAV=-1;
wxArrayLong pids;
wxDateTime tt;
while (!dataSet1->Eof())
@ -2024,15 +2025,21 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event)
{
backend_xid= dataSet1->GetVal(wxT("backend_xid"));
statusList->SetItem(row, colpos++, backend_xid);
if (!slinfo.IsEmpty()) statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("xmin_slot")));
if (!slinfo.IsEmpty()) {
statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("xmin_slot")));
countsenders++;
}
else
{
wxString av_replica;
if (iswalsend) av_replica= dataSet1->GetVal(wxT("av_replica"));
if (av_replica.IsEmpty())
statusList->SetItem(row, colpos++, dataSet1->GetVal(wxT("backend_xmin")));
else
else {
statusList->SetItem(row, colpos++, av_replica);
pidAV=pid;
}
}
}
if (connection->BackendMinimumVersion(9, 6))
@ -2142,6 +2149,17 @@ void frmStatus::OnRefreshStatusTimer(wxTimerEvent &event)
delete dataSet1;
if (viewMenu->IsChecked(MNU_HIGHLIGHTSTATUS))
{
if (countsenders == 0 && pidAV>0) {
// all walsender active='f'
for(long i = 0; i < pids.size(); i++)
{
if (pids[i]==pidAV)
statusList->SetItemBackgroundColour(i,
wxColour(settings->GetBlockedProcessColour()));
}
}
// who blocking
wxString numstr;
wxString str;
numstr=blocked.BeforeFirst(',',&str);

View file

@ -173,6 +173,14 @@ public:
p.y=p.y-50;
//this->Move(p);
}
if (event.GetKeyCode() == WXK_PAGEDOWN) htmlWindow->ScrollPages(1);
if (event.GetKeyCode() == WXK_PAGEUP) htmlWindow->ScrollPages(-1);
if (event.GetKeyCode() == WXK_DOWN) htmlWindow->ScrollLines(1);
if (event.GetKeyCode() == WXK_UP) htmlWindow->ScrollLines(-1);
if (event.GetKeyCode() == WXK_HOME) htmlWindow->ScrollPages(-1000);
if (event.GetKeyCode() == WXK_END) htmlWindow->ScrollPages(1000);
});
htmlWindow->Bind(wxEVT_RIGHT_UP, [&](wxMouseEvent& event) {
wxString name;

View file

@ -262,6 +262,11 @@ wxString FunctionPGHelper::getSqlCommandHelp(wxString fnd) {
wxUniChar sep = wxFileName::GetPathSeparator();
fnd.Replace(" ", "");
wxString f = wxFindFirstFile(path + sep + "sql-" + fnd + "*.html");
if (f.empty()) {
fnd.Replace("_", "-");
f = wxFindFirstFile(path + sep + "view-" + fnd + "*.html");
if (f.empty()) f = wxFindFirstFile(path + sep + "catalog-" + fnd + "*.html");
}
wxString last, txt;
int c = 0;
@ -389,7 +394,6 @@ void FunctionPGHelper::loadfile() {
body.clear();
path = settings->GetPgHelpPath();
wxString tempDir = path + "_func.txt";
//tempDir="C:\\Users\\lsv\\Source\\Repos\\wxHtmlhint\\1";
if (!wxFileExists(tempDir)) return;
wxTextFile tfile;
tfile.Open(tempDir);

View file

@ -180,8 +180,9 @@ public:
wxString position;
position = wxString::Format("lines %d,hieght 1 row %d full h=%d", lines, txtSize.GetHeight(), txtSize.GetHeight() * lines + 1 * lines);
#ifdef __WXGTK__
wxSize charSize = GetTextExtent("H");
txtSize.SetHeight(txtSize.GetHeight() + charSize.GetHeight()/2);
txtSize.SetWidth(txtSize.GetWidth()+12); // -1 no work in GTK
txtSize.SetHeight(txtSize.GetHeight()+8); // -1 no work in GTK
return txtSize;
#else
txtSize.SetHeight(txtSize.GetHeight() * lines + 1 * lines);
#endif