From f892599936f6c87541356ddaa2b7d2038749f667 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 20 Jul 2018 11:23:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80?= =?UTF-8?q?=D0=B0=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=20=D0=B4=D0=B2?= =?UTF-8?q?=D0=BE=D0=B9=D0=BD=D0=BE=D0=BC=D1=83=20=D0=BA=D0=BB=D0=B8=D0=BA?= =?UTF-8?q?=D1=83=20=D0=B2=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B5=20=D0=94?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B3=D0=BB=D1=83=D1=88=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=BD=D0=B0=D0=B6=D0=B0=D1=82=D0=B8=D0=B8=20=D0=BA=D0=BD=D0=BE?= =?UTF-8?q?=D0=BF=D0=BA=D0=B8=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BD=D0=B5=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D1=83=D0=B5=D0=BC=D1=8B=D1=85=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 17 ++++++++++++++++- lib/gui.tcl | 3 +-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index 1c90be5..2a02f9b 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -301,7 +301,9 @@ proc GetWorkTreeItems {par} { proc GetWorkTreeRow {} { set work_tree_id [.frm_work.tree_work selection] - #puts "$work_tree_id" + if {$work_tree_id eq ""} { + return + } set work_tree_values_list [.frm_work.tree_work item $work_tree_id -values] set column_list [.frm_work.tree_work cget -columns] set l1 [llength $column_list] @@ -1581,6 +1583,8 @@ proc Edit {} { set id [.frm_tree.tree selection] set values [.frm_tree.tree item $id -values] set key [lindex [split $id "::"] 0] + puts $key + puts $values if {$values eq "" || $key eq ""} {return} Edit::$key $tree $host $values } @@ -1952,11 +1956,18 @@ proc Edit::acl {tree host item descr} { global default active_cluster profile_name \ agent_user agent_pwd cluster_user cluster_pwd auth set lst [GetWorkTreeRow] + if {$lst eq ""} { + return + } set frm [Add::$item $tree $host $profile_name] $frm configure -text $descr FormFieldsDataInsert $frm [list $lst] $frm.ent_name configure -state disable } +proc Edit::connections {tree host values} {return} +proc Edit::processes {tree host values} {return} +proc Edit::locks {tree host values} {return} +proc Edit::sessions {tree host values} {return} proc Del {} { global active_cluster host @@ -2226,6 +2237,10 @@ proc Del::profiles {tree host values} { proc Del::acl {host type name profile_name} { global active_cluster agent_user agent_pwd cluster_user cluster_pwd auth + if {$name eq ""} { + return + } + if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" } else { diff --git a/lib/gui.tcl b/lib/gui.tcl index b1f92e5..21fb11e 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -78,6 +78,7 @@ set tree_work [ # table rows background colors $tree_work tag configure dark -background $color(dark_table_bg) $tree_work tag configure light -background $color(light_table_bg) +bind $tree_work Edit #$tree_work heading par -text "Параметр" -anchor center #$tree_work heading val -text "Значение" -anchor center @@ -97,5 +98,3 @@ pack $frm_tree $frm_work -side left -expand true -fill both #.panel add $frm_tool -weight 1 .panel add $frm_tree -weight 1 .panel add $frm_work -weight 1 - -