Добавлена настройка пути до RAC для каждого сервера.

Теперь можно работать с серверами запущенными на платформах
разных версий 1С:Предприятия. Для этого при добавлении основного
сервера можно указать путь до RAC соответствующей платформы.
Если путь не указан то при работе будет использоваться путь из
файла конфигурации, указанный при первом запуске программы.
master
Sergey Kalinin 2018-09-12 12:46:20 +03:00
parent 2b5bffddfa
commit cc4130f0a4
4 changed files with 27 additions and 8 deletions

View File

@ -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} {

View File

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

View File

@ -119,3 +119,4 @@ set default(auth) {
set color(dark_table_bg) "#6f6f6f"
set color(light_table_bg) "#424242"

View File

@ -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]] {