From cc4130f0a4061c76d03a745cf56ceea03b9544b3 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 12 Sep 2018 12:46: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=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D1=83=D1=82=D0=B8=20=D0=B4=D0=BE=20RAC=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь можно работать с серверами запущенными на платформах разных версий 1С:Предприятия. Для этого при добавлении основного сервера можно указать путь до RAC соответствующей платформы. Если путь не указан то при работе будет использоваться путь из файла конфигурации, указанный при первом запуске программы. --- lib/function.tcl | 25 +++++++++++++++++++------ lib/msg/ru.msg | 3 +-- rac_gui.cfg | 1 + rac_gui.tcl | 6 ++++++ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index 008e85b..e18bb33 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -72,8 +72,12 @@ proc InsertItemsWorkList {lst} { proc RunCommand {par} { global dir rac_cmd cluster work_list_row_count \ - agent_user agent_pwd cluster_user cluster_pwd - + agent_user agent_pwd cluster_user cluster_pwd server_platform + set host [lindex [split $par " "] end] + if [info exists server_platform($host)] { + set rac_cmd $server_platform($host) + puts "host - $host" + } puts "$rac_cmd $par" set work_list_row_count 0 @@ -275,10 +279,13 @@ proc FormFieldsDataInsert {frm lst} { } } -proc SaveMainServer {host port} { - global dir +proc SaveMainServer {host port path_to_rac} { + global dir rac_cmd + if {$path_to_rac ne ""} { + set rac_cmd $path_to_rac + } set file [open [file join $dir(work) 1c_srv.cfg] "a+"] - puts $file "$host:$port" + puts $file "$host:$port $rac_cmd" close $file return "$host:$port" } @@ -325,6 +332,7 @@ namespace eval Run {} {} # Получение данных по кластерам proc Run::server {tree host values} { + set lst [RunCommand "cluster list $host"] if {$lst eq ""} {return} set l [lindex $lst 0] @@ -864,16 +872,20 @@ proc Add::server {} { ttk::entry $frm.ent_host ttk::label $frm.lbl_port -text [::msgcat::mc "Port"] ttk::entry $frm.ent_port + ttk::label $frm.lbl_path_to_rac -text [::msgcat::mc "Path to RAC"] + ttk::entry $frm.ent_path_to_rac $frm.ent_port insert end $default(port) grid $frm.lbl_host -row 0 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_host -row 0 -column 1 -sticky new -padx 5 -pady 5 grid $frm.lbl_port -row 1 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_port -row 1 -column 1 -sticky new -padx 5 -pady 5 + grid $frm.lbl_path_to_rac -row 2 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_path_to_rac -row 2 -column 1 -sticky new -padx 5 -pady 5 grid columnconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1 #set frm_btn [frame .add.frm_btn -border 0] .add.frm_btn.btn_ok configure -command { - set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get]] + set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get] [.add.frm.ent_path_to_rac get]] .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" destroy .add return $host @@ -2379,3 +2391,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index 77a7a7c..d9285f4 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -111,5 +111,4 @@ ::msgcat::mcset ru "External code security profile" "Профиль безопасности внешнего кода" ::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов" ::msgcat::mcset ru "External session management required" "Внешнее управление сеансами" - - +::msgcat::mcset ru "Path to RAC" "Путь до RAC" diff --git a/rac_gui.cfg b/rac_gui.cfg index 54e7e2d..5a1d0ae 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -119,3 +119,4 @@ set default(auth) { set color(dark_table_bg) "#6f6f6f" set color(light_table_bg) "#424242" + diff --git a/rac_gui.tcl b/rac_gui.tcl index 7db8fcb..710ea91 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -78,6 +78,11 @@ source [file join $dir(work) rac_gui.cfg] if [file exists [file join $dir(work) 1c_srv.cfg]] { set f [open [file join $dir(work) 1c_srv.cfg] "RDONLY"] while {[gets $f line] >=0} { + set l [split $line " "] + set line [lindex $l 0] + if {[lindex $l 1] ne ""} { + set server_platform($line) [lindex $l 1] + } .frm_tree.tree insert {} end -id "server::$line" -text "$line" -values "$line" } } @@ -111,3 +116,4 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { +