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 - -