From caa39b49aa67763c5768fc48f44661f28415eaa1 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 21 Aug 2019 16:49:13 +0300 Subject: [PATCH 01/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20?= =?UTF-8?q?=D1=81=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 19 ++-------------- lib/json.tcl | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 lib/json.tcl diff --git a/lib/function.tcl b/lib/function.tcl index 5457257..31350f1 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -340,23 +340,6 @@ proc GetWorkTreeRow {} { return $lst } -proc JsonGet {json args} { - foreach key $args { - if {[dict exists $json $key]} { - set json [dict get $json $key] - } elseif {[string is integer $key]} { - if {$key >= 0 && $key < [llength $json]} { - set json [lindex $json $key] - } else { - error "can't get item number $key from {$json}" - } - } else { - error "can't get \"$key\": no such key in {$json}" - } - } - return $json -} - proc CreateInfoBasesJSONfile {} { global default dir set info_base_json_file [file join $dir(work) infobases.lst] @@ -2479,3 +2462,5 @@ proc Del::inet {tree host profile_name} { + + diff --git a/lib/json.tcl b/lib/json.tcl new file mode 100644 index 0000000..eff505b --- /dev/null +++ b/lib/json.tcl @@ -0,0 +1,59 @@ +proc tcl2json value { + # https://rosettacode.org/wiki/JSON#Tcl + # Guess the type of the value; deep *UNSUPPORTED* magic! + regexp {^value is a (.*?) with a refcount} \ + [::tcl::unsupported::representation $value] -> type + + switch $type { + string { + return [json::write string $value] + } + dict { + return [json::write object {*}[ + dict map {k v} $value {tcl2json $v}]] + } + list { + return [json::write array {*}[lmap v $value {tcl2json $v}]] + } + int - double { + return [expr {$value}] + } + booleanString { + return [expr {$value ? "true" : "false"}] + } + default { + # Some other type; do some guessing... + if {$value eq "null"} { + # Tcl has *no* null value at all; empty strings are semantically + # different and absent variables aren't values. So cheat! + return $value + } elseif {[string is integer -strict $value]} { + return [expr {$value}] + } elseif {[string is double -strict $value]} { + return [expr {$value}] + } elseif {[string is boolean -strict $value]} { + return [expr {$value ? "true" : "false"}] + } + return [json::write string $value] + } + } +} + +proc jsonget {json args} { + # https://wiki.tcl-lang.org/page/JSON + foreach key $args { + if {[dict exists $json $key]} { + set json [dict get $json $key] + } elseif {[string is integer $key]} { + if {$key >= 0 && $key < [llength $json]} { + set json [lindex $json $key] + } else { + error "can't get item number $key from {$json}" + } + } else { + error "can't get \"$key\": no such key in {$json}" + } + } + return $json +} + From 8de360a2e141b8121f0a6f5661b65a6ed99f18e5 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Thu, 22 Aug 2019 17:00:57 +0300 Subject: [PATCH 02/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BD=D0=B0=20tcllib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rac_gui.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rac_gui.spec b/rac_gui.spec index f62dd2f..3a04474 100644 --- a/rac_gui.spec +++ b/rac_gui.spec @@ -7,7 +7,7 @@ Group: System Url: https://bitbucket.org/svk28/rac-gui BuildArch: noarch Source: %name-%version-%release.tar.gz -Requires: tcl => 8.6.8, tk >= 8.6.8 +Requires: tcl => 8.6.8, tk >= 8.6.8, tcllib %description This program ia a grafics user interface for 1C rac util. From 9ab792d761a88fa6896a5904194d00a46f0c9430 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Thu, 22 Aug 2019 17:01:37 +0300 Subject: [PATCH 03/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=BD=D0=B0=20tcllib?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5cc9022..6971366 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Vcs-Git: https://bitbucket.org/svk28/rac-gui.git Package: rac-gui Architecture: any -Depends: tcl(>=8.6), tk(>=8.6), ${misc:Depends} +Depends: tcl(>=8.6), tk(>=8.6), tcllib, ${misc:Depends} Description: This program is a GUI for 1C RAC util. Rac-GUI is a graphical user interface for 1C rac (remote access controll) programm. 1C RAC is a software for 1C-servers cluster management. From 2503187e596cdf718e6b55d6cd3a065a3fb9a72e Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 23 Aug 2019 17:31:13 +0300 Subject: [PATCH 04/25] =?UTF-8?q?=D0=A4=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B5=20?= =?UTF-8?q?=D1=81=20JSON?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 51 +++++++++++++++++++++++++++++------------------- lib/json.tcl | 1 + lib/theme.tcl | 32 ++++++++++++++++++++++++++++++ rac_gui.tcl | 48 +++++++++++++++++---------------------------- 4 files changed, 82 insertions(+), 50 deletions(-) create mode 100644 lib/theme.tcl diff --git a/lib/function.tcl b/lib/function.tcl index 31350f1..af6861f 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -7,6 +7,8 @@ ########################################### proc Quit {} { + global servers_list + puts [tcl2json $servers_list] exit } @@ -30,7 +32,7 @@ proc TreePress {tree} { } proc SetGlobalVarFromTreeItems {tree id} { - global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd + global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd servers_list set parent [$tree parent $id] set values [$tree item $id -values] set key [lindex [split $id "::"] 0] @@ -52,15 +54,23 @@ proc SetGlobalVarFromTreeItems {tree id} { close $orig_file } work_server {set server $values} - cluster {set active_cluster $values} - infobase {set infobase $values} + cluster { + set active_cluster $values + #dict set servers_list $host $values + } + infobase { + set infobase $values + #dict set servers_list $host $active_cluster infobases $values + } profile {set profile_name $values} } + if {$parent eq ""} { return } else { SetGlobalVarFromTreeItems $tree $parent } + } proc InsertItemsWorkList {lst} { @@ -340,31 +350,31 @@ proc GetWorkTreeRow {} { return $lst } -proc CreateInfoBasesJSONfile {} { +proc CreateInfoBasesJSONfile {serversList} { global default dir + puts $serversList + puts [tcl2json $serversList] set info_base_json_file [file join $dir(work) infobases.lst] - set jsonStr { \ - { - "servers":[ - { "server-id": "server_id1", + set jsonStr { + { + "servers":[ + { "server-id": "server_id1", + "clusters": [ + {"cluster-id": "cluster_id_1", "infobases": [ + {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, + {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] + } + ] + }, + { "server-id": "server_id2", "clusters": [ {"cluster-id": "cluster_id_1", "infobases": [ {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] } - ] - }, - { "server-id": "server_id2", - "clusters": [ - {"cluster-id": "cluster_id_1", "infobases": [ - {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, - {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] - } + ]} ]} - ]} -} - - + } } namespace eval Run {} {} @@ -2464,3 +2474,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/json.tcl b/lib/json.tcl index eff505b..3920849 100644 --- a/lib/json.tcl +++ b/lib/json.tcl @@ -57,3 +57,4 @@ proc jsonget {json args} { return $json } + diff --git a/lib/theme.tcl b/lib/theme.tcl new file mode 100644 index 0000000..56f9387 --- /dev/null +++ b/lib/theme.tcl @@ -0,0 +1,32 @@ +###################################################### +# Rac GUI +# Graphical theme settings +# +# Distributed under GNU Public License +# Author: Sergey Kalinin svk@nuk-svk.ru +# Home page: https://nuk-svk.ru +# Git repos: https://bitbucket.org/svk28/rac-gui + + +###################################################### + +# set editor(fg) grey +# set editor(bg) black +# option add *Entry.Foreground $editor(fg) interactive +# option add *Entry.Background $editor(bg) interactive +# option add *Label.Foreground $editor(fg) interactive +# option add *Label.Background $editor(bg) interactive +# option add *Checkbox.Foreground $editor(fg) interactive +# option add *Checkbox.Background $editor(bg) interactive +# option add *Checkbutton.Foreground $editor(fg) interactive +# option add *Checkbutton.Background $editor(bg) interactive +# option add *Combobox.Foreground $editor(fg) interactive +# option add *Combobox.Background $editor(bg) interactive +# option add *Listbox.Foreground $editor(fg) interactive +# option add *Listbox.Background $editor(bg) interactive +# option add *TreeView.Background $editor(bg) interactive +#option add *Treeview.Foreground red interactive +# #option add *Frame.Background $editor(bg) interactive +# option add *ScrollableFrame.Background $editor(bg) interactive +# option add *ScrolledWindow.Background $editor(bg) interactive + diff --git a/rac_gui.tcl b/rac_gui.tcl index 1ee51db..aa5dec9 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -2,20 +2,23 @@ # Tcl ignores the next line -*- tcl -*- \ exec wish "$0" -- "$@" +###################################################### +# Rac GUI +# 1C RAC (tm) grafical user interface +# Distributed under GNU Public License +# Author: Sergey Kalinin svk@nuk-svk.ru +# Home page: https://nuk-svk.ru +# Git repos: https://bitbucket.org/svk28/rac-gui +# +# version: 1.1.0 +# release: 1 +# +###################################################### + package require msgcat package require json package require json::write -###################################################### -# Rac GUI -# Distributed under GNU Public License -# Author: Sergey Kalinin svk@nuk-svk.ru -# Home page: https://bitbucket.org/svk28/rac-gui -# -# version: 1.0.3 -# release: 1 -# -###################################################### # Устанавливаем текущий каталог set dir(root) [pwd] @@ -83,6 +86,8 @@ source [file join $dir(lib) gui.tcl] source [file join $dir(work) rac_gui.cfg] # Читаем файл со списком серверов 1С +#set serversList [dict create servers] + 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} { @@ -92,27 +97,10 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { set rac_cmd_for_host($host) [lindex $l 1] } .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" + # готовим конфиг + dict set servers_list $host clusters {} } } -# set editor(fg) grey -# set editor(bg) black -# option add *Entry.Foreground $editor(fg) interactive -# option add *Entry.Background $editor(bg) interactive -# option add *Label.Foreground $editor(fg) interactive -# option add *Label.Background $editor(bg) interactive -# option add *Checkbox.Foreground $editor(fg) interactive -# option add *Checkbox.Background $editor(bg) interactive -# option add *Checkbutton.Foreground $editor(fg) interactive -# option add *Checkbutton.Background $editor(bg) interactive -# option add *Combobox.Foreground $editor(fg) interactive -# option add *Combobox.Background $editor(bg) interactive -# option add *Listbox.Foreground $editor(fg) interactive -# option add *Listbox.Background $editor(bg) interactive -# option add *TreeView.Background $editor(bg) interactive -#option add *Treeview.Foreground red interactive -# #option add *Frame.Background $editor(bg) interactive -# option add *ScrollableFrame.Background $editor(bg) interactive -# option add *ScrolledWindow.Background $editor(bg) interactive +CreateInfoBasesJSONfile $servers_list -CreateInfoBasesJSONfile From 0a61eff7db288f389ad123dbc59c8232bedbf3c6 Mon Sep 17 00:00:00 2001 From: Sergey Date: Sat, 24 Aug 2019 15:37:04 +0300 Subject: [PATCH 05/25] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=BD=D0=B0=20json.=20=D0=9A=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=20=D0=B1=D1=83=D0=B4=D0=B5=D1=82=20=D0=B2=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B5=20tcl-=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 37 +++++++++++++++++++++++++++++ lib/json.tcl | 60 ------------------------------------------------ rac_gui.cfg | 3 --- 3 files changed, 37 insertions(+), 63 deletions(-) delete mode 100644 lib/json.tcl diff --git a/lib/function.tcl b/lib/function.tcl index af6861f..8429a90 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -311,6 +311,39 @@ proc SaveMainServer {host port path_to_rac} { return "$host:$port" } +proc SaveConfig {} { + global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd servers_list + set file [open [file join $dir(work) 1c_srv_new.cfg] "a+"] + + puts "$host:$port $rac_cmd" + puts $file "$host:$port,$rac_cmd" + close $file + return "$host:$port" + + + +} + +set servers_list { + server_id { + command rac_cmd + cluster_id { + cluster_name "" + infobase-id1 { + infobase_name "" + infobase_user "" + infobase_pwd "" + } + infobase-id2 { + infobase_name "" + infobase_user "" + infobase_pwd "" + } + } + } +} + + proc GetWorkTreeItems {par} { set work_tree_id [.frm_work.tree_work selection] set work_tree_values [.frm_work.tree_work item $work_tree_id -values] @@ -377,6 +410,9 @@ proc CreateInfoBasesJSONfile {serversList} { } } + + + namespace eval Run {} {} # Получение данных по кластерам @@ -2475,3 +2511,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/json.tcl b/lib/json.tcl deleted file mode 100644 index 3920849..0000000 --- a/lib/json.tcl +++ /dev/null @@ -1,60 +0,0 @@ -proc tcl2json value { - # https://rosettacode.org/wiki/JSON#Tcl - # Guess the type of the value; deep *UNSUPPORTED* magic! - regexp {^value is a (.*?) with a refcount} \ - [::tcl::unsupported::representation $value] -> type - - switch $type { - string { - return [json::write string $value] - } - dict { - return [json::write object {*}[ - dict map {k v} $value {tcl2json $v}]] - } - list { - return [json::write array {*}[lmap v $value {tcl2json $v}]] - } - int - double { - return [expr {$value}] - } - booleanString { - return [expr {$value ? "true" : "false"}] - } - default { - # Some other type; do some guessing... - if {$value eq "null"} { - # Tcl has *no* null value at all; empty strings are semantically - # different and absent variables aren't values. So cheat! - return $value - } elseif {[string is integer -strict $value]} { - return [expr {$value}] - } elseif {[string is double -strict $value]} { - return [expr {$value}] - } elseif {[string is boolean -strict $value]} { - return [expr {$value ? "true" : "false"}] - } - return [json::write string $value] - } - } -} - -proc jsonget {json args} { - # https://wiki.tcl-lang.org/page/JSON - foreach key $args { - if {[dict exists $json $key]} { - set json [dict get $json $key] - } elseif {[string is integer $key]} { - if {$key >= 0 && $key < [llength $json]} { - set json [lindex $json $key] - } else { - error "can't get item number $key from {$json}" - } - } else { - error "can't get \"$key\": no such key in {$json}" - } - } - return $json -} - - diff --git a/rac_gui.cfg b/rac_gui.cfg index d7b8982..955c4aa 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -126,6 +126,3 @@ set default(auth) { set color(dark_table_bg) "#6f6f6f" set color(light_table_bg) "#424242" - - - From 818973e54ab0b163e4950dbf35eb09ef51a1806e Mon Sep 17 00:00:00 2001 From: Sergey Date: Sat, 24 Aug 2019 15:39:00 +0300 Subject: [PATCH 06/25] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=BD=D0=B0=20json.=20=D0=9A=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=20=D0=B1=D1=83=D0=B4=D0=B5=D1=82=20=D0=B2=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B5=20tcl-=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rac_gui.tcl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/rac_gui.tcl b/rac_gui.tcl index aa5dec9..c65e7fc 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -16,8 +16,6 @@ exec wish "$0" -- "$@" ###################################################### package require msgcat -package require json -package require json::write # Устанавливаем текущий каталог set dir(root) [pwd] @@ -101,6 +99,3 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { dict set servers_list $host clusters {} } } - -CreateInfoBasesJSONfile $servers_list - From ab83488765bf358434a8d28c3d7ddb0fab0a2d67 Mon Sep 17 00:00:00 2001 From: Sergey Date: Sat, 24 Aug 2019 15:40:09 +0300 Subject: [PATCH 07/25] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=BD=D0=B0=20json.=20=D0=9A=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=20=D0=B1=D1=83=D0=B4=D0=B5=D1=82=20=D0=B2=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=B5=20tcl-=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/function.tcl b/lib/function.tcl index 8429a90..2662087 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -8,7 +8,6 @@ proc Quit {} { global servers_list - puts [tcl2json $servers_list] exit } From 216f54874b1d3df805f49849c465d4e803c4eec5 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 26 Aug 2019 11:24:19 +0300 Subject: [PATCH 08/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B3=D0=BE=D1=80=D1=8F=D1=87=D0=B0=D1=8F?= =?UTF-8?q?=20=D0=BA=D0=BB=D0=B0=D0=B2=D0=B8=D1=88=D0=B0=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=92=D1=8B=D1=85=D0=BE=D0=B4=D0=B0=20Control=20+=20Q?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gui.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/gui.tcl b/lib/gui.tcl index 059c776..efcf68c 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -22,6 +22,9 @@ wm protocol . WM_DELETE_WINDOW Quit wm overrideredirect . 0 wm positionfrom . user +bind . Quit +bind . Quit + #ttk::style configure TPanedwindow -background blue #ttk::style configure Sash -sashthickness 5 #ttk::style configure TButton -padding 60 -relief flat -bg black @@ -88,6 +91,7 @@ bind $tree_work { $tree_work item [.frm_work.tree_work selection] -tags selected } + #$tree_work heading par -text "Параметр" -anchor center #$tree_work heading val -text "Значение" -anchor center #set tree_work [ttk::treeview $frm_work.tree_work \ @@ -108,3 +112,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both .panel add $frm_work -weight 1 + From b0709d9d95ba86065c4d5ad7da32114773b0be7b Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 26 Aug 2019 17:30:34 +0300 Subject: [PATCH 09/25] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D1=84=D0=B8=D0=B3=D0=BE=D0=BC=20=D0=B2=20=D0=BE=D1=82=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1c_srv_new.cfg | 47 +++++++++++++++++++++++++++ lib/config.tcl | 54 +++++++++++++++++++++++++++++++ lib/function.tcl | 83 ++++++++---------------------------------------- rac_gui.tcl | 17 ++++++++-- 4 files changed, 128 insertions(+), 73 deletions(-) create mode 100644 1c_srv_new.cfg create mode 100644 lib/config.tcl diff --git a/1c_srv_new.cfg b/1c_srv_new.cfg new file mode 100644 index 0000000..7b1c776 --- /dev/null +++ b/1c_srv_new.cfg @@ -0,0 +1,47 @@ +localhost:1545 { + name "Локальный сервер" + rac_cmd /opt/1C/v8.3/x86_64/rac + agent_user "" + agent_pwd "" + clusters { + 3ed9081a-c5b0-11e9-cf8a-1c1b0d94027e { + cluster_name "eeee" + cluster_user "" + cluster_pwd "" + } + 4581a966-a6bf-11e9-3c95-1c1b0d94027e { + cluster_name "Локальный кластер" + cluster_user "" + cluster_pwd "" + infobases { + 1e1d1cea-b856-11e9-748a-1c1b0d94027e { + infobase_name "wewe" + infobase_user "ibuser" + infobase_pwd "ibpwd" + } + 0129b2b2-b8d6-11e9-748a-1c1b0d94027e { + infobase_name "testdb" + infobase_user "testdb2-user" + infobase_pwd "testdb2-pwd" + } + cac80302-b855-11e9-748a-1c1b0d94027e { + infobase_name "testdb" + } + } + } + } +} +192.168.5.145:1545 { + name "1C test" + path_to_rac /opt/1C/v8.3/x86_64/rac + clusters { + } +} +1csrv:1545 { + name "1C SRV" + path_to_rac /opt/1C/v8.3.13_1644/x86_64/rac + clusters { + } +} + + diff --git a/lib/config.tcl b/lib/config.tcl new file mode 100644 index 0000000..0edc794 --- /dev/null +++ b/lib/config.tcl @@ -0,0 +1,54 @@ +############################################# +# Rac GUI +# Distributed under GNU Public License +# Author: Sergey Kalinin svk@nuk-svk.ru +# Copyright (c) "http://nuk-svk.ru", 2018 +# https://bitbucket.org/svk28/rac-gui +############################################# +# Config file and dictionary working functions +# global dict - $servers_list +############################################## + +# Получаем юзера и пароль из конфига +proc GetInfobaseUser {host cluster infobase} { + global servers_list + if [dict exists $servers_list servers $host clusters $cluster infobases $infobase infobase_user] { + return [dict get $servers_list servers $host clusters $cluster infobases $infobase infobase_user] + } +} +proc GetInfobasePassword {host cluster infobase} { + global servers_list + if [dict exists $servers_list servers $host clusters $cluster infobases $infobase infobase_pwd] { + return [dict get $servers_list servers $host clusters $cluster infobases $infobase infobase_pwd] + } +} + + +# Конвертация словаря в удобочитаемый формат +proc dict2file {dictionary} { + #regexp -nocase -indices -all -- {\{} $dictionary list + #set str [string map {"\{" "\{\r\n" "\}" "\r\n\}\r\n"} $dictionary] + set str $dictionary + # Pretty indenting... + set indent "" + if {[regexp {\}} $str]} { + set indent [string range $indent 0 end-4] + } + append result $indent$str\n + if {[regexp {\{} $str]} { + append indent " " + } + + return $result +} + +# Сохраянем конфиг +proc SaveConfig {} { + global dir servers_list + set file [open [file join $dir(work) 1c_srv_new.cfg] "w"] + + puts $file [dict2file [dict get $servers_list servers]] + close $file +} + + diff --git a/lib/function.tcl b/lib/function.tcl index 2662087..633d7fb 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -7,7 +7,8 @@ ########################################### proc Quit {} { - global servers_list + # Сохраняем конфиг + SaveConfig exit } @@ -31,7 +32,7 @@ proc TreePress {tree} { } proc SetGlobalVarFromTreeItems {tree id} { - global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd servers_list + global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd set parent [$tree parent $id] set values [$tree item $id -values] set key [lindex [split $id "::"] 0] @@ -310,39 +311,6 @@ proc SaveMainServer {host port path_to_rac} { return "$host:$port" } -proc SaveConfig {} { - global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd servers_list - set file [open [file join $dir(work) 1c_srv_new.cfg] "a+"] - - puts "$host:$port $rac_cmd" - puts $file "$host:$port,$rac_cmd" - close $file - return "$host:$port" - - - -} - -set servers_list { - server_id { - command rac_cmd - cluster_id { - cluster_name "" - infobase-id1 { - infobase_name "" - infobase_user "" - infobase_pwd "" - } - infobase-id2 { - infobase_name "" - infobase_user "" - infobase_pwd "" - } - } - } -} - - proc GetWorkTreeItems {par} { set work_tree_id [.frm_work.tree_work selection] set work_tree_values [.frm_work.tree_work item $work_tree_id -values] @@ -382,35 +350,6 @@ proc GetWorkTreeRow {} { return $lst } -proc CreateInfoBasesJSONfile {serversList} { - global default dir - puts $serversList - puts [tcl2json $serversList] - set info_base_json_file [file join $dir(work) infobases.lst] - set jsonStr { - { - "servers":[ - { "server-id": "server_id1", - "clusters": [ - {"cluster-id": "cluster_id_1", "infobases": [ - {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, - {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] - } - ] - }, - { "server-id": "server_id2", - "clusters": [ - {"cluster-id": "cluster_id_1", "infobases": [ - {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, - {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] - } - ]} - ]} - } -} - - - namespace eval Run {} {} # Получение данных по кластерам @@ -468,7 +407,7 @@ proc Run::services {tree host values} { } proc Run::infobases {tree host values} { - global active_cluster cluster_user cluster_pwd + global active_cluster cluster_user cluster_pwd .frm_work.tree_work delete [ .frm_work.tree_work children {}] if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" @@ -501,15 +440,18 @@ proc Run::infobases {tree host values} { } proc Run::infobase {tree host values} { - global active_cluster cluster_user cluster_pwd default + global active_cluster cluster_user cluster_pwd default servers_list if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" } else { set auth "" } - #### Временный костыль #### - if {[info exists default(infobase_user)] == 1 && [info exists default(infobase_pwd)] == 1} { - set ib_auth "--infobase-user=$default(infobase_user) --infobase-pwd=$default(infobase_pwd)" + #### Проверяем наличие юзера и пароля в конфиге и если есть то используем #### + set infobase_user [GetInfobaseUser $host $active_cluster $values] + set infobase_pwd [GetInfobasePassword $host $active_cluster $values] + + if {$infobase_user ne "" && $infobase_pwd ne ""} { + set ib_auth "--infobase-user=$infobase_user --infobase-pwd=$infobase_pwd" } else { set ib_auth "" } @@ -529,7 +471,6 @@ proc Run::List:Base {tree host values par} { } else { set auth "" } - .frm_work.tree_work delete [ .frm_work.tree_work children {}] set lst [RunCommand "$par list --cluster=$active_cluster $auth --infobase=$values $host"] @@ -2511,3 +2452,5 @@ proc Del::inet {tree host profile_name} { + + diff --git a/rac_gui.tcl b/rac_gui.tcl index c65e7fc..5447115 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -95,7 +95,18 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { set rac_cmd_for_host($host) [lindex $l 1] } .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" - # готовим конфиг - dict set servers_list $host clusters {} - } + } + close $f } + +if [file exists [file join $dir(work) 1c_srv_new.cfg]] { + set f_new [open [file join $dir(work) 1c_srv_new.cfg] "RDONLY"] + while {[gets $f_new line] >=0} { + append str " [string trim $line]" + } + set str [string map {"\{ " "\{" " \}" "\}"} $str] + close $f + dict set servers_list servers $str + puts $servers_list +} + From b3e890ed14437c50bc63ee19f2fea16f837be50c Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 28 Aug 2019 17:27:05 +0300 Subject: [PATCH 10/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1c_srv_new.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1c_srv_new.cfg b/1c_srv_new.cfg index 7b1c776..b34913a 100644 --- a/1c_srv_new.cfg +++ b/1c_srv_new.cfg @@ -1,6 +1,6 @@ localhost:1545 { name "Локальный сервер" - rac_cmd /opt/1C/v8.3/x86_64/rac + rac_cmd "/opt/1C/v8.3/x86_64/rac" agent_user "" agent_pwd "" clusters { @@ -33,13 +33,13 @@ localhost:1545 { } 192.168.5.145:1545 { name "1C test" - path_to_rac /opt/1C/v8.3/x86_64/rac + path_to_rac "/opt/1C/v8.3/x86_64/rac" clusters { } } 1csrv:1545 { name "1C SRV" - path_to_rac /opt/1C/v8.3.13_1644/x86_64/rac + path_to_rac "/opt/1C/v8.3.13_1644/x86_64/rac" clusters { } } From 6fc029c32eab187cfcced5ad325d7e9ba6d2aa64 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 28 Aug 2019 17:27:36 +0300 Subject: [PATCH 11/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BD=D0=BE=D0=B2=D1=8B=D0=BC=20=D0=BA=D0=BE=D0=BD=D1=84?= =?UTF-8?q?=D0=B8=D0=B3=20=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.tcl | 115 ++++++++++++++++++++++++++++++++++++++++++------- rac_gui.tcl | 1 + 2 files changed, 101 insertions(+), 15 deletions(-) diff --git a/lib/config.tcl b/lib/config.tcl index 0edc794..17f016a 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -25,30 +25,115 @@ proc GetInfobasePassword {host cluster infobase} { # Конвертация словаря в удобочитаемый формат -proc dict2file {dictionary} { - #regexp -nocase -indices -all -- {\{} $dictionary list - #set str [string map {"\{" "\{\r\n" "\}" "\r\n\}\r\n"} $dictionary] - set str $dictionary - # Pretty indenting... - set indent "" - if {[regexp {\}} $str]} { - set indent [string range $indent 0 end-4] - } - append result $indent$str\n - if {[regexp {\{} $str]} { - append indent " " - } - return $result +proc DictFormatter {dict {indent}} { + set str "" + set i 0 + foreach {k v} $dict { + #if {$v eq ""} {set v "NULL"} + #puts "\nkey - $k value - [string trim $v]" + + if [regexp {\{} $v] { + append indent "-" + DictFormatter $v $indent + } elseif [regexp {\}} $v] { + set indent [string trimright $indent "-"] + DictFormatter $v $indent + } else { + set str "$k $v" + } + } + puts "$indent$str" } +proc dict2json {dictionary} { + dict for {key value} $dictionary { + puts "$key $value" + if {[string match {\{*\}} $value]} { + lappend Result "\"$key\":$value" + } elseif {![catch {dict size $value}]} { + lappend Result "\"$key\":\"[dict2json $value]\"" + } else { + lappend Result "\"$key\":\"$value\"" + } + puts $Result + } + return "\{[join $Result ",\n"]\}" +} + # Сохраянем конфиг proc SaveConfig {} { global dir servers_list set file [open [file join $dir(work) 1c_srv_new.cfg] "w"] + set f [open [file join $dir(work) 1c_srv_new_.cfg] "w"] + set dict [dict get $servers_list servers] + #puts "\n\n[split $dict " "]\n\n" + set dict [string map {"\{" "\{\n" "\}" "\n\}"} $dict] + regsub -- {(\} )} $dict "\}\n" dict - puts $file [dict2file [dict get $servers_list servers]] + #puts $dict + #DictFormatter [dict get $servers_list servers] "-" + #DictFormatter $dict "-" + #regexp -all -indices -line -- {\}(.+?)\{} $dict m + #puts " \n $m" + puts $file $dict close $file + #return + set file [open [file join $dir(work) 1c_srv_new.cfg] "r"] + + set str "" + seek $file 0 + set close_brace 0 + set open_brace 0 + while {[gets $file line] >=0} { + if [regexp -- {\{} $line] { + if {$open_brace == 0} { + append indent "" + } else { + append indent " " + } + incr open_brace + } + if [regexp -- {\}} $line] { + #incr open_brace -1 + set indent [string range $indent 0 end-2] + incr close_brace + } + if [regexp -nocase -all -- {(\})(.+?\{)} $line match brace phrase] { + # puts "> $v1 >>$v2" + #append indent " " + set line "$brace\n$indent$phrase" + #set line [string map {"\}" "\}\n"} $line] + #regsub -- {\} } $line "\}\n$indent" line + } + if {$open_brace > $close_brace} { + #set line "$indent$line" + } + if [regexp -nocase -indices -all -- {((.*?)\s(".*?"))} $line match v1 v2 v3] { + puts "> $v1 >>$v2 >>> $v3" + set index [lindex [split $v3 " "] 1] + puts $index + set last_pair [string trim [string range $line $index+1 end]] + set line [GetDictFromString $line $indent] + puts ">$last_pair<" + if {$last_pair ne ""} { + append line "$indent[string trim $last_pair]" + } + } + append str $indent [string trim $line] "\n" + } + puts $f $str } +proc GetDictFromString {str indent} { + puts $str + if [regexp -nocase -indices -- {((.*?)\s(".*?"))} $str match v1 v2 v3] { + set index [lindex [split $v3 " "] 1] + set first_pair [string range $str 0 $index] + append res $indent $first_pair "\n" + append res [GetDictFromString [string range $str $index+1 end] $indent] "\n" + #append res [string range $str $index+1 end] "\n" + return $res + } +} diff --git a/rac_gui.tcl b/rac_gui.tcl index 5447115..e78a029 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -110,3 +110,4 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { puts $servers_list } + From b2159137db6a07ef4c52299604808bf4cb48c569 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 30 Aug 2019 16:03:07 +0300 Subject: [PATCH 12/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8?= =?UTF-8?q?=D0=B3=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B8?= =?UTF-8?q?=20=D1=82=D0=B5=D0=BC=D1=8B.=20=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=B0=20=D1=81=20=D1=82=D0=B5=D0=BC=D0=B0=D0=BC=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gui.tcl | 13 ++++++++++--- lib/theme.tcl | 8 ++++++++ lib/ttk_theme_dark.tcl | 1 + rac_gui.cfg | 10 ++++------ rac_gui.tcl | 1 - 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/gui.tcl b/lib/gui.tcl index efcf68c..3aada00 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -31,7 +31,10 @@ bind . Quit #ttk::style configure Custom.Treeview -foreground red #ttk::style configure Custom.Treeview -rowheight 20 -ttk::style theme use dark + +if [info exists default(theme)] { + ttk::style theme use $default(theme) +} # Панель инсрументов set frm_tool [ttk::frame .frm_tool] @@ -79,8 +82,11 @@ set tree_work [ -yscrollcommand [list $frm_work.vsb set] ] # table rows background colors -$tree_work tag configure dark -background $color(dark_table_bg) -$tree_work tag configure light -background $color(light_table_bg) + +if {[info exists default(theme)] == 1} { + $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 tag configure selected -background white -foreground black @@ -113,3 +119,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both + diff --git a/lib/theme.tcl b/lib/theme.tcl index 56f9387..5671a3f 100644 --- a/lib/theme.tcl +++ b/lib/theme.tcl @@ -30,3 +30,11 @@ # option add *ScrollableFrame.Background $editor(bg) interactive # option add *ScrolledWindow.Background $editor(bg) interactive + +if {[info exists default(theme)] == 1 && $default(theme) eq "dark"} { + set color(dark_table_bg) "#6f6f6f" + set color(light_table_bg) "#424242" +} else { + set color(dark_table_bg) "#e2e2e2" + set color(light_table_bg) "#ffffff" +} diff --git a/lib/ttk_theme_dark.tcl b/lib/ttk_theme_dark.tcl index e4c06c3..13a256d 100644 --- a/lib/ttk_theme_dark.tcl +++ b/lib/ttk_theme_dark.tcl @@ -139,3 +139,4 @@ namespace eval ::tablelist:: { + diff --git a/rac_gui.cfg b/rac_gui.cfg index 955c4aa..40d7a74 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -114,15 +114,13 @@ set default(auth) { os } - ## Раскоментировать строки и прописать свои значения если ## для Информационных Баз используются эти параметры #set default(infobase_user) "ib_user" #set default(infobase_pwd) "ib_password" -# цвета строк в таблице -#set color(dark_table_bg) "#e2e2e2" -#set color(light_table_bg) "#ffffff" -set color(dark_table_bg) "#6f6f6f" -set color(light_table_bg) "#424242" +# Используемая тема +# доступны: dark, clam, classic, default, alt +set default(theme) dark + diff --git a/rac_gui.tcl b/rac_gui.tcl index e78a029..5447115 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -110,4 +110,3 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { puts $servers_list } - From b199afb4922671c7c2620a188cf035c536f2b636 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 30 Aug 2019 17:29:01 +0300 Subject: [PATCH 13/25] =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=81=D0=BE=D0=B3=D0=BB=D0=B0=D1=81=D0=BD=D0=BE=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BD=D0=B4=D0=B0=D1=80=D1=82=D0=B0=20XDG.?= =?UTF-8?q?=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=20=D0=BA=D0=BE=D0=BF=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=81=D1=83=D1=89?= =?UTF-8?q?=D0=B5=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D1=85=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + rac_gui.tcl | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b6f341b..8615b3a 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,4 @@ http://nuk-svk.ru/soft/rac-gui/ Иконки взяты с сайта https://www.iconsdb.com/royal-blue-icons/ + diff --git a/rac_gui.tcl b/rac_gui.tcl index 5447115..277ca5e 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -20,17 +20,42 @@ package require msgcat # Устанавливаем текущий каталог set dir(root) [pwd] -# Устанавливаем рабочий каталог, если его нет то создаём -set dir(work) [file join $env(HOME) .rac_gui] -if {[file exists $dir(work)] == 0 } { +# Устанавливаем рабочий каталог, если его нет то создаём. +# Согласно спецификации XDG проверяем наличие переменных и каталогов +if [info exists env(XDG_CONFIG_HOME)] { + set dir(work) [file join $env(XDG_CONFIG_HOME) rac_gui] +} elseif [file exists [file join $env(HOME) .config]] { + set dir(work) [file join $env(HOME) .config rac_gui] +} else { + set dir(work) [file join $env(HOME) .rac_gui] +} + +if {[file exists $dir(work)] == 0} { file mkdir $dir(work) } +# Проверяем старые конфиги и при наличии переносим +if {[file exists [file join $env(HOME) .rac_gui]] ==1 && $dir(work) ne [file join $env(HOME) .rac_gui]} { + cd [file join $env(HOME) .rac_gui] + foreach f [glob -type f *] { + if {![file exists [file join $dir(work) $f]]} { + puts "File copy - [file copy $f $dir(work)]" + file rename $f [list $f old] + } + } + cd $env(HOME) + #file rename -force [file join $env(HOME) .rac_gui] [file join $env(HOME) .rac_gui.old] + file delete -force [file join $env(HOME) .rac_gui] +} + + +puts "Work dir is $dir(work)" + # каталог с модулями set dir(lib) "[file join $dir(root) lib]" # загружаем пользовательский конфиг, если он отсутствует, то копируем дефолтный if {[file exists [file join $dir(work) rac_gui.cfg]] ==0} { - file copy [file join [pwd] rac_gui.cfg] [file join $dir(work) rac_gui.cfg] + file copy [file join $dir(root) rac_gui.cfg] [file join $dir(work) rac_gui.cfg] } source [file join $dir(work) rac_gui.cfg] @@ -110,3 +135,5 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { puts $servers_list } + + From bd839a9e6615851f2cb809fb4fd0b6de92b1362c Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 2 Sep 2019 18:33:47 +0300 Subject: [PATCH 14/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=BE=D0=B2=D0=B0=D1=8F=20=D0=BE?= =?UTF-8?q?=D0=BF=D1=86=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B5=20=D1=81=20=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=82=D0=B5=D1=80=D0=BE=D0=BC=20--kill-by-memory-with-dump.=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BC=D0=B5?= =?UTF-8?q?=D1=85=D0=B0=D0=BD=D0=B8=D0=B7=D0=BC=20=D0=BF=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=BE=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86?= =?UTF-8?q?=20=D0=B8=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=BE=D0=B2.=20?= =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 65 +++++++++++++++++++++++++++++++++++------------- lib/gui.tcl | 1 + lib/msg/ru.msg | 23 +++++++++-------- 3 files changed, 62 insertions(+), 27 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index 633d7fb..30f2764 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -90,11 +90,29 @@ proc InsertItemsWorkList {lst} { .frm_work.tree_work insert {} end -values $value_list -tags $tag .frm_work.tree_work column #0 -stretch foreach j $column_list { - .frm_work.tree_work heading $j -text $j + .frm_work.tree_work heading $j -text [::msgcat::mc [HumanReadableTextConvert $j]] } incr work_list_row_count } + +# Преобразование выражений (названий параметров) полученных из консоли +# для отображания в графических элементах. +# Т.е. выражение "session-fault-tolerance-level" +# будет преобразовано в "Session fault tolerance level" +proc HumanReadableTextConvert {txt} { + set lst [split $txt "-"] + if {[llength $lst] >0} { + foreach item $lst { + append str " " $item + } + } + set str [string trim $str] + set first_letter [string range $str 0 0] + set str "[string toupper $first_letter][string range $str 1 end]" + return $str +} + proc RunCommand {par} { global dir rac_cmd cluster work_list_row_count \ agent_user agent_pwd cluster_user cluster_pwd server_platform @@ -1140,7 +1158,7 @@ proc Add::infobases {tree host values} { proc Add::cluster {tree host values} { global default lifetime_limit expiration_timeout session_fault_tolerance_level global max_memory_size max_memory_time_limit errors_count_threshold security_level - global load_balancing_mode kill_problem_processes \ + global load_balancing_mode kill_problem_processes kill_by_memory_with_dump \ agent_user agent_pwd cluster_user cluster_pwd auth_agent if {$agent_user ne "" && $agent_pwd ne ""} { set auth_agent "--agent-user=$agent_user --agent-pwd=$agent_pwd" @@ -1159,7 +1177,7 @@ proc Add::cluster {tree host values} { set frm [AddToplevel [::msgcat::mc "Cluster"] cluster_grey_64] - ttk::label $frm.lbl_host -text [::msgcat::mc "Main server address"] + ttk::label $frm.lbl_host -text [::msgcat::mc "Host"] ttk::entry $frm.ent_host ttk::label $frm.lbl_port -text [::msgcat::mc "Port"] ttk::entry $frm.ent_port @@ -1167,27 +1185,34 @@ proc Add::cluster {tree host values} { ttk::label $frm.lbl_name -text [::msgcat::mc "Name"] ttk::entry $frm.ent_name - ttk::label $frm.lbl_secure_connect -text [::msgcat::mc "Secure level"] + ttk::label $frm.lbl_security_level -text [::msgcat::mc "Security level"] ttk::combobox $frm.cb_security_level -textvariable security_level -values $default(security_level) - ttk::label $frm.lbl_expiration_timeout -text [::msgcat::mc "Forced termination time"] + ttk::label $frm.lbl_expiration_timeout -text [::msgcat::mc "Expiration timeout"] ttk::entry $frm.ent_expiration_timeout -textvariable expiration_timeout - ttk::label $frm.lbl_session_fault_tolerance_level -text [::msgcat::mc "Fault-tolerance level"] - ttk::entry $frm.ent_session_fault_tolerance_level -textvariable session_fault_tolerance_level + ttk::label $frm.lbl_session_fault_tolerance_level \ + -text [::msgcat::mc "Session fault tolerance level"] + ttk::entry $frm.ent_session_fault_tolerance_level \ + -textvariable session_fault_tolerance_level ttk::label $frm.lbl_load_balancing_mode -text [::msgcat::mc "Load balancing mode"] ttk::combobox $frm.cb_load_balancing_mode -textvariable load_balancing_mode \ -values $default(load_balancing_mode) - ttk::label $frm.lbl_errors_count_threshold -text [::msgcat::mc "Server errors threshold"] + ttk::label $frm.lbl_errors_count_threshold -text [::msgcat::mc "Errors count threshold"] ttk::entry $frm.ent_errors_count_threshold -textvariable errors_count_threshold - ttk::label $frm.lbl_processes -text [::msgcat::mc "Working process"] - ttk::label $frm.lbl_lifetime_limit -text [::msgcat::mc "Restart time"] + ttk::label $frm.lbl_processes -text [::msgcat::mc "Processes"] + ttk::label $frm.lbl_lifetime_limit -text [::msgcat::mc "Lifetime limit"] ttk::entry $frm.ent_lifetime_limit -textvariable lifetime_limit - ttk::label $frm.lbl_max_memory_size -text [::msgcat::mc "Maximum virtual address space"] + ttk::label $frm.lbl_max_memory_size -text [::msgcat::mc "Max memory size"] ttk::entry $frm.ent_max_memory_size -textvariable max_memory_size - ttk::label $frm.lbl_max_memory_time_limit -text [::msgcat::mc "Maximum period of memori size exeeding"] + ttk::label $frm.lbl_max_memory_time_limit -text [::msgcat::mc "Max memory time limit"] ttk::entry $frm.ent_max_memory_time_limit -textvariable max_memory_time_limit - ttk::label $frm.lbl_kill_problem_processes -justify left -anchor nw -text [::msgcat::mc "Terminate corrupted processes"] - ttk::checkbutton $frm.check_kill_problem_processes -variable kill_problem_processes -onvalue yes -offvalue no - + ttk::label $frm.lbl_kill_problem_processes -justify left -anchor nw \ + -text [::msgcat::mc "Kill problem processes"] + ttk::checkbutton $frm.check_kill_problem_processes \ + -variable kill_problem_processes -onvalue yes -offvalue no + ttk::checkbutton $frm.check_kill_by_memory_with_dump \ + -variable kill_by_memory_with_dump -onvalue yes -offvalue no + ttk::label $frm.lbl_kill_by_memory_with_dump -justify left -anchor nw \ + -text [::msgcat::mc "Kill by memory with dump"] grid $frm.lbl_host -row 0 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_host -row 0 -column 1 -sticky nsew -padx 5 -pady 5 @@ -1195,7 +1220,7 @@ proc Add::cluster {tree host values} { grid $frm.ent_port -row 1 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_name -row 2 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_name -row 2 -column 1 -sticky nsew -padx 5 -pady 5 - grid $frm.lbl_secure_connect -row 3 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.lbl_security_level -row 3 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.cb_security_level -row 3 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_expiration_timeout -row 4 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_expiration_timeout -row 4 -column 1 -sticky nsew -padx 5 -pady 5 @@ -1214,6 +1239,8 @@ proc Add::cluster {tree host values} { grid $frm.ent_max_memory_time_limit -row 11 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_kill_problem_processes -row 12 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.check_kill_problem_processes -row 12 -column 1 -sticky nw -padx 5 -pady 5 + grid $frm.lbl_kill_by_memory_with_dump -row 13 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.check_kill_by_memory_with_dump -row 13 -column 1 -sticky nw -padx 5 -pady 5 .add.frm_btn.btn_ok configure -command { RunCommand "cluster insert \ @@ -1229,6 +1256,7 @@ proc Add::cluster {tree host values} { --load-balancing-mode=$load_balancing_mode \ --errors-count-threshold=$errors_count_threshold \ --kill-problem-processes=$kill_problem_processes \ + --kill-by-memory-with-dump=$kill_by_memory_with_dump \ $auth_agent $host" Run::server $tree $host "" destroy .add @@ -1766,7 +1794,8 @@ proc Edit::server {tree host value} { proc Edit::cluster {tree host values} { global default lifetime_limit expiration_timeout session_fault_tolerance_level - global max_memory_size max_memory_time_limit errors_count_threshold security_level + global max_memory_size max_memory_time_limit errors_count_threshold security_level \ + kill_by_memmory_with_dump global load_balancing_mode kill_problem_processes active_cluster \ agent_user agent_pwd cluster_user cluster_pwd auth if {$cluster_user ne "" && $cluster_pwd ne ""} { @@ -1800,6 +1829,7 @@ proc Edit::cluster {tree host values} { --load-balancing-mode=$load_balancing_mode \ --errors-count-threshold=$errors_count_threshold \ --kill-problem-processes=$kill_problem_processes \ + --kill-by-memory-with-dump=$kill_by_memory_with_dump \ $auth $host" $tree delete "cluster::$active_cluster" Run::server $tree $host "" @@ -2454,3 +2484,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/gui.tcl b/lib/gui.tcl index 3aada00..d08dee2 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -120,3 +120,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both + diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index d9285f4..b51c59b 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -27,13 +27,14 @@ ::msgcat::mcset ru "OS user name" "Пользователь ОС" ::msgcat::mcset ru "Authentication method" "Способ аутентификации" ::msgcat::mcset ru "Add record" "Добавить запись" -::msgcat::mcset ru "Main server" "Основной сервер" -::msgcat::mcset ru "Main server address" "Адрес основного сервера" +::msgcat::mcset ru "Host" "Основной сервер" +::msgcat::mcset ru "Host address" "Адрес основного сервера" ::msgcat::mcset ru "Address" "Адрес сервера" ::msgcat::mcset ru "Port" "Порт" ::msgcat::mcset ru "Ports range" "Диапазон портов" ::msgcat::mcset ru "Protocol" "Протокол" ::msgcat::mcset ru "Working processes" "Рабочие процессы" +::msgcat::mcset ru "Processes" "Рабочие процессы" ::msgcat::mcset ru "Cluster managers" "Менеджеры кластера" ::msgcat::mcset ru "Maximum memory in working processes" "Максимальный объём памяти раб. процессов" ::msgcat::mcset ru "Safe memory consuption per call" "Безопасный расход памяти за вызов" @@ -54,15 +55,16 @@ ::msgcat::mcset ru "Create database" "Создать БД в случае её отсутствия" ::msgcat::mcset ru "Sheduled jobs deny" "Блокировка регламентных заданий" ::msgcat::mcset ru "Date offset" "Смещение дат" -::msgcat::mcset ru "Secure level" "Безопасное соединение" -::msgcat::mcset ru "Forced termination time" "Останавливать выключенные процессы через:" -::msgcat::mcset ru "Fault-tolerance level" "Уровень отказоустойчивости" +::msgcat::mcset ru "Security level" "Безопасное соединение" +::msgcat::mcset ru "Expiration timeout" "Останавливать выключенные процессы через:" +::msgcat::mcset ru "Session fault tolerance level" "Уровень отказоустойчивости" ::msgcat::mcset ru "Load balancing mode" "Режим распределения нагрузки" -::msgcat::mcset ru "Server errors threshold" "Допустимое отклонение количества ошибок сервера, %" -::msgcat::mcset ru "Restart time" "Период перезапуска, сек." -::msgcat::mcset ru "Maximum virtual address space" "Допустимый объём памяти, КБ" -::msgcat::mcset ru "Maximum period of memori size exeeding" "Интервал превышения допустимого объёма памяти, сек." -::msgcat::mcset ru "Terminate corrupted processes" "Принудительно завершать проблемные процессы" +::msgcat::mcset ru "Errors count threshold" "Допустимое отклонение количества ошибок сервера, %" +::msgcat::mcset ru "Lifetime limit" "Период перезапуска, сек." +::msgcat::mcset ru "Max memory size" "Допустимый объём памяти, КБ" +::msgcat::mcset ru "Max memory time limit" "Интервал превышения допустимого объёма памяти, сек." +::msgcat::mcset ru "Kill problem processes" "Принудительно завершать проблемные процессы" +::msgcat::mcset ru "Kill by memory with dump" "Формировать дамп процесса при превышении объема памяти" ::msgcat::mcset ru "Object type" "Объект требования" ::msgcat::mcset ru "Rule type" "Тип требования" ::msgcat::mcset ru "Application with an ajustment" "Значение доп. параметра" @@ -112,3 +114,4 @@ ::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов" ::msgcat::mcset ru "External session management required" "Внешнее управление сеансами" ::msgcat::mcset ru "Path to RAC" "Путь до RAC" + From a54c5b4136ea67528365d73c1e777a2c22226bbe Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 2 Sep 2019 19:06:33 +0300 Subject: [PATCH 15/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=BC=D0=B5=D1=85=D0=B0=D0=BD=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE=D0=B2=D0=BA=D0=BE=D0=B2=20=D1=82?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=20=D0=B8=20=D1=81=D0=BF=D0=B8?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D0=B2.=20=D0=98=D1=81=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BD=D0=B5=D0=BA=D0=BE=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D1=8B=D0=B5=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 15 ++++++++------- lib/msg/ru.msg | 23 +++++++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index 30f2764..3fa7354 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -966,28 +966,29 @@ proc Add::servers {tree host values} { ttk::label $frm.lbl_agent_port -text [::msgcat::mc "Port"] ttk::entry $frm.ent_agent_port $frm.ent_agent_port insert end $default(port) - ttk::label $frm.lbl_port_range -text [::msgcat::mc "Ports range"] + ttk::label $frm.lbl_port_range -text [::msgcat::mc "Port range"] ttk::entry $frm.ent_port_range $frm.ent_port_range insert end $default(port_range) - ttk::label $frm.lbl_safe_working_processes_memory_limit -text [::msgcat::mc "Maximum memory in working processes"] + ttk::label $frm.lbl_safe_working_processes_memory_limit \ + -text [::msgcat::mc "Safe working processes memory limit"] ttk::entry $frm.ent_safe_working_processes_memory_limit $frm.ent_safe_working_processes_memory_limit insert end $default(safe_working_processes_memory_limit) - ttk::label $frm.lbl_safe_call_memory_limit -text [::msgcat::mc "Safe memory consuption per call"] + ttk::label $frm.lbl_safe_call_memory_limit -text [::msgcat::mc "Safe call memory limit"] ttk::entry $frm.ent_safe_call_memory_limit $frm.ent_safe_call_memory_limit insert end $default(safe_call_memory_limit) - ttk::label $frm.lbl_memory_limit -text [::msgcat::mc "Memory use limit per working process"] + ttk::label $frm.lbl_memory_limit -text [::msgcat::mc "Memory limit"] ttk::entry $frm.ent_memory_limit $frm.ent_memory_limit insert end $default(ram_work) - ttk::label $frm.lbl_infobases_limit -text [::msgcat::mc "Maximum number of infobases per working process"] + ttk::label $frm.lbl_infobases_limit -text [::msgcat::mc "Infobases limit"] ttk::entry $frm.ent_infobases_limit $frm.ent_infobases_limit insert end $default(infobases_limit) - ttk::label $frm.lbl_connections_limit -text [::msgcat::mc "Maximum nuber of connections per working process"] + ttk::label $frm.lbl_connections_limit -text [::msgcat::mc "Connections limit"] ttk::entry $frm.ent_connections_limit $frm.ent_connections_limit insert end $default(connections_limit) ttk::label $frm.lbl_cluster_port -text [::msgcat::mc "Main cluster manager port number"] ttk::entry $frm.ent_cluster_port $frm.ent_cluster_port insert end $default(port) - ttk::label $frm.lbl_dedicate_managers -text [::msgcat::mc "Service manager allocation"] + ttk::label $frm.lbl_dedicate_managers -text [::msgcat::mc "Dedicated managers"] ttk::checkbutton $frm.check_dedicate_managers -variable dedicate_managers -onvalue all -offvalue none ttk::label $frm.lbl_using -text [::msgcat::mc "Working server use variant"] ttk::checkbutton $frm.check_using -variable using -onvalue main -offvalue normal diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index b51c59b..e06659d 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -31,18 +31,21 @@ ::msgcat::mcset ru "Host address" "Адрес основного сервера" ::msgcat::mcset ru "Address" "Адрес сервера" ::msgcat::mcset ru "Port" "Порт" -::msgcat::mcset ru "Ports range" "Диапазон портов" +::msgcat::mcset ru "Cluster port" "Порт кластера" +::msgcat::mcset ru "Port range" "Диапазон портов" +::msgcat::mcset ru "Agent host" "Адрес сервера" +::msgcat::mcset ru "Agent port" "Порт сервера" ::msgcat::mcset ru "Protocol" "Протокол" ::msgcat::mcset ru "Working processes" "Рабочие процессы" ::msgcat::mcset ru "Processes" "Рабочие процессы" ::msgcat::mcset ru "Cluster managers" "Менеджеры кластера" -::msgcat::mcset ru "Maximum memory in working processes" "Максимальный объём памяти раб. процессов" -::msgcat::mcset ru "Safe memory consuption per call" "Безопасный расход памяти за вызов" -::msgcat::mcset ru "Memory use limit per working process" "Предел использования памяти рабочим процессом" -::msgcat::mcset ru "Maximum number of infobases per working process" "Количество ИБ на процесс" -::msgcat::mcset ru "Maximum nuber of connections per working process" "Количество соединений на процесс" +::msgcat::mcset ru "Safe working processes memory limit" "Максимальный объём памяти раб. процессов" +::msgcat::mcset ru "Safe call memory limit" "Безопасный расход памяти за вызов" +::msgcat::mcset ru "Memory limit" "Предел использования памяти рабочим процессом" +::msgcat::mcset ru "Infobases limit" "Количество ИБ на процесс" +::msgcat::mcset ru "Connections limit" "Количество соединений на процесс" ::msgcat::mcset ru "Main cluster manager port number" "Порт главного менеджера кластера" -::msgcat::mcset ru "Service manager allocation" "Менеджер под каждый сервис" +::msgcat::mcset ru "Dedicated managers" "Менеджер под каждый сервис" ::msgcat::mcset ru "Working server use variant" "Вариант использования рабочего сервера" ::msgcat::mcset ru "Work servers" "Рабочие серверы" ::msgcat::mcset ru "Work server" "Рабочий сервер" @@ -114,4 +117,8 @@ ::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов" ::msgcat::mcset ru "External session management required" "Внешнее управление сеансами" ::msgcat::mcset ru "Path to RAC" "Путь до RAC" - +::msgcat::mcset ru "Using" "Использование" +::msgcat::mcset ru "Critical total memory" "Макс. объём памяти процессов рабочего сервера" +::msgcat::mcset ru "Temporary allowed total memory" "Предел превышения допустимого объёма памяти процессов (сек.)" +::msgcat::mcset ru "Temporary allowed total memory time limit" "Допустимый объем памяти процессов рабочего сервера" +::msgcat::mcset ru "Server" "Сервер" From dd20452625ff39a9dc9c82a6157a56051a9234e3 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 2 Sep 2019 20:58:15 +0300 Subject: [PATCH 16/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20?= =?UTF-8?q?=D1=81=D0=BD=D0=BE=D0=B2=D1=8B=D0=BC=D0=B8=20=D0=BE=D0=BF=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=D0=B8=20RAC=20=D0=BF=D1=80=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B8?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=BE=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=B0?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --critical-total-memory --temporary-allowed-total-memory --temporary-allowed-total-memory-time-limit Добавлены значения по умолчанию в конфиг. Добавлены переводы новых опций и адаптированы переводы заголовков соответствующих таблиц. Добавлена проверка путей расположения файлов и вывод сообщений о копировании и перемещении конфигов. --- lib/config.tcl | 41 +++++++++++++++++++++ lib/function.tcl | 95 +++++++++++++++++++++++++++++++++++++++--------- lib/msg/ru.msg | 9 ++++- rac_gui.cfg | 17 ++++++++- rac_gui.tcl | 35 +++--------------- 5 files changed, 145 insertions(+), 52 deletions(-) diff --git a/lib/config.tcl b/lib/config.tcl index 17f016a..c90e6a8 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -137,3 +137,44 @@ proc GetDictFromString {str indent} { } } + +# Проверка установки переменных в конфиге +proc CheckVariablesSet {} { + global default dir + set lst_vars { + rac_dir + critical_total_memory + temporary_allowed_total_memory + temporary_allowed_total_memory_time_limit + } + set result [::msgcat::mc "The default variables is undefinied:"] + set var "" + foreach item $lst_vars { + if {![info exists default($item)]} { + append var "\ndefault($item)" + } + } + puts $var + append result $var "\n" [::msgcat::mc "New config file will be copying from RAC GUI distributive."] + if {$var ne ""} { + set answer [tk_messageBox -message $result \ + -icon warning -type yesno ] + switch -- $answer { + no return + yes { + CopyNewConfig + source [file join $dir(work) rac_gui.cfg] + } + } + } +} + + +proc CopyNewConfig {} { + global dir + if {[file exists [file join $dir(work) rac_gui.cfg]] ==1} { + file rename -force [file join $dir(work) rac_gui.cfg] [file join $dir(work) rac_gui.cfg.old] + file copy [file join $dir(root) rac_gui.cfg] [file join $dir(work) rac_gui.cfg] + } + +} diff --git a/lib/function.tcl b/lib/function.tcl index 3fa7354..f1ca3b4 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -367,6 +367,25 @@ proc GetWorkTreeRow {} { } return $lst } +# Диалог указания пути до RAC +proc SetRacCommand {} { + global env tcl_platform default + + if {$tcl_platform(os) eq "Windows NT"} { + set init_dir $env(COMMONPROGRAMFILES) + } elseif {$tcl_platform(os) eq "Linux"} { + set init_dir $default(rac_dir) + } else { + set init_dir $env(HOME) + } + set rac_cmd "[tk_getOpenFile -initialdir $init_dir -parent .add \ + -title [::msgcat::mc "Show where is a RAC command"] -initialfile rac]" + if {$rac_cmd eq ""} { + return + } else { + return $rac_cmd + } +} namespace eval Run {} {} @@ -927,16 +946,23 @@ proc Add::server {} { 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 + ttk::button $frm.btn_path_to_rac -text "..." -width 3 $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 $frm.lbl_host -row 0 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_host -row 0 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_port -row 1 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_port -row 1 -column 1 -columnspan 2 -sticky nesw -padx 5 -pady 5 + grid $frm.lbl_path_to_rac -row 2 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_path_to_rac -row 2 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.btn_path_to_rac -row 2 -column 2 -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] + + $frm.btn_path_to_rac configure -command { + .add.frm.ent_path_to_rac delete 0 end + .add.frm.ent_path_to_rac insert end [SetRacCommand] + } + .add.frm_btn.btn_ok configure -command { set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get] [.add.frm.ent_path_to_rac get]] set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] @@ -947,7 +973,8 @@ proc Add::server {} { return $frm } proc Add::servers {tree host values} { - global default dedicate_managers using active_cluster cluster_user cluster_pwd auth + global default dedicate_managers using active_cluster cluster_user cluster_pwd auth \ + if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" } else { @@ -985,14 +1012,28 @@ proc Add::servers {tree host values} { ttk::label $frm.lbl_connections_limit -text [::msgcat::mc "Connections limit"] ttk::entry $frm.ent_connections_limit $frm.ent_connections_limit insert end $default(connections_limit) - ttk::label $frm.lbl_cluster_port -text [::msgcat::mc "Main cluster manager port number"] + ttk::label $frm.lbl_cluster_port -text [::msgcat::mc "Сluster port"] ttk::entry $frm.ent_cluster_port $frm.ent_cluster_port insert end $default(port) - ttk::label $frm.lbl_dedicate_managers -text [::msgcat::mc "Dedicated managers"] + ttk::label $frm.lbl_dedicate_managers -text [::msgcat::mc "Dedicate managers"] ttk::checkbutton $frm.check_dedicate_managers -variable dedicate_managers -onvalue all -offvalue none ttk::label $frm.lbl_using -text [::msgcat::mc "Working server use variant"] ttk::checkbutton $frm.check_using -variable using -onvalue main -offvalue normal + ttk::label $frm.lbl_critical_total_memory -text [::msgcat::mc "Critical total memory"] + ttk::entry $frm.ent_critical_total_memory + $frm.ent_critical_total_memory insert end $default(critical_total_memory) + + ttk::label $frm.lbl_temporary_allowed_total_memory \ + -text [::msgcat::mc "Temporary allowed total memory"] + ttk::entry $frm.ent_temporary_allowed_total_memory + $frm.ent_temporary_allowed_total_memory insert end $default(temporary_allowed_total_memory) + + ttk::label $frm.lbl_temporary_allowed_total_memory_time_limit \ + -text [::msgcat::mc "Temporary allowed total memory time limit"] + ttk::entry $frm.ent_temporary_allowed_total_memory_time_limit + $frm.ent_temporary_allowed_total_memory_time_limit insert end $default(temporary_allowed_total_memory_time_limit) + grid $frm.lbl_name -row 0 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_name -row 0 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_agent_host -row 1 -column 0 -sticky nw -padx 5 -pady 5 @@ -1001,8 +1042,12 @@ proc Add::servers {tree host values} { grid $frm.ent_agent_port -row 2 -column 1 -sticky new -padx 5 -pady 5 grid $frm.lbl_port_range -row 3 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_port_range -row 3 -column 1 -sticky nsew -padx 5 -pady 5 - grid $frm.lbl_safe_working_processes_memory_limit -row 4 -column 0 -sticky nw -padx 5 -pady 5 - grid $frm.ent_safe_working_processes_memory_limit -row 4 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_cluster_port -row 12 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_cluster_port -row 12 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_safe_working_processes_memory_limit \ + -row 4 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_safe_working_processes_memory_limit \ + -row 4 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_safe_call_memory_limit -row 5 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_safe_call_memory_limit -row 5 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_memory_limit -row 6 -column 0 -sticky nw -padx 5 -pady 5 @@ -1011,12 +1056,20 @@ proc Add::servers {tree host values} { grid $frm.ent_infobases_limit -row 7 -column 1 -sticky nsew -padx 5 -pady 5 grid $frm.lbl_connections_limit -row 8 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.ent_connections_limit -row 8 -column 1 -sticky nsew -padx 5 -pady 5 - grid $frm.lbl_cluster_port -row 9 -column 0 -sticky nw -padx 5 -pady 5 - grid $frm.ent_cluster_port -row 9 -column 1 -sticky nsew -padx 5 -pady 5 - grid $frm.lbl_dedicate_managers -row 10 -column 0 -sticky nw -padx 5 -pady 5 - grid $frm.check_dedicate_managers -row 10 -column 1 -sticky nw -padx 5 -pady 5 - grid $frm.lbl_using -row 11 -column 0 -sticky nw -padx 5 -pady 5 - grid $frm.check_using -row 11 -column 1 -sticky nw -padx 5 -pady 5 + + grid $frm.lbl_critical_total_memory -row 9 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_critical_total_memory -row 9 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_temporary_allowed_total_memory -row 10 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_temporary_allowed_total_memory -row 10 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_temporary_allowed_total_memory_time_limit \ + -row 11 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.ent_temporary_allowed_total_memory_time_limit \ + -row 11 -column 1 -sticky nsew -padx 5 -pady 5 + + grid $frm.lbl_dedicate_managers -row 13 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.check_dedicate_managers -row 13 -column 1 -sticky nw -padx 5 -pady 5 + grid $frm.lbl_using -row 14 -column 0 -sticky nw -padx 5 -pady 5 + grid $frm.check_using -row 14 -column 1 -sticky nw -padx 5 -pady 5 .add.frm_btn.btn_ok configure -command { RunCommand "server insert \ @@ -1032,6 +1085,9 @@ proc Add::servers {tree host values} { --dedicate-managers=$dedicate_managers \ --safe-working-processes-memory-limit=[.add.frm.ent_safe_working_processes_memory_limit get] \ --safe-call-memory-limit=[.add.frm.ent_safe_call_memory_limit get] \ + --critical-total-memory=[.add.frm.ent_critical_total_memory get] \ + --temporary-allowed-total-memory=[.add.frm.ent_temporary_allowed_total_memory get] \ + --temporary-allowed-total-memory-time-limit=[.add.frm.ent_temporary_allowed_total_memory_time_limit get] \ --cluster=$active_cluster $auth $host" Run::servers $tree $host $active_cluster destroy .add @@ -2000,6 +2056,9 @@ proc Edit::work_server {tree host values} { --dedicate-managers=$dedicate_managers \ --safe-working-processes-memory-limit=[.add.frm.ent_safe_working_processes_memory_limit get] \ --safe-call-memory-limit=[.add.frm.ent_safe_call_memory_limit get] \ + --critical-total-memory=[.add.frm.ent_critical_total_memory get] \ + --temporary-allowed-total-memory=[.add.frm.ent_temporary_allowed_total_memory get] \ + --temporary-allowed-total-memory-time-limit=[.add.frm.ent_temporary_allowed_total_memory_time_limit get] \ --cluster=$active_cluster $auth $host" Run::servers $tree $host $active_cluster destroy .add diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index e06659d..a70336e 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -44,8 +44,8 @@ ::msgcat::mcset ru "Memory limit" "Предел использования памяти рабочим процессом" ::msgcat::mcset ru "Infobases limit" "Количество ИБ на процесс" ::msgcat::mcset ru "Connections limit" "Количество соединений на процесс" -::msgcat::mcset ru "Main cluster manager port number" "Порт главного менеджера кластера" -::msgcat::mcset ru "Dedicated managers" "Менеджер под каждый сервис" +::msgcat::mcset ru "Сluster port" "Порт главного менеджера кластера" +::msgcat::mcset ru "Dedicate managers" "Менеджер под каждый сервис" ::msgcat::mcset ru "Working server use variant" "Вариант использования рабочего сервера" ::msgcat::mcset ru "Work servers" "Рабочие серверы" ::msgcat::mcset ru "Work server" "Рабочий сервер" @@ -122,3 +122,8 @@ ::msgcat::mcset ru "Temporary allowed total memory" "Предел превышения допустимого объёма памяти процессов (сек.)" ::msgcat::mcset ru "Temporary allowed total memory time limit" "Допустимый объем памяти процессов рабочего сервера" ::msgcat::mcset ru "Server" "Сервер" +::msgcat::mcset ru "Main server" "Основной сервер" +::msgcat::mcset ru "The default variables is undefinied:" "Не установлены значения по умолчанию для следующих перменных:" +::msgcat::mcset ru "New config file will be copying from RAC GUI distributive." "Скопирoвать новый файл настроек из дистрибутива программы?" +::msgcat::mcset ru "All files from old working dir will be moved into new location:" "Все файлы из текущего рабочего каталога перенсены в:" + diff --git a/rac_gui.cfg b/rac_gui.cfg index 40d7a74..e338c38 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -10,7 +10,7 @@ # ###################################################### -set rac_cmd "/opt/1C/v8.3/x86_64/rac" +set default(rac_dir) "/opt/1C/v8.3/x86_64" set default(locale) "ru" # Порт RAS @@ -108,12 +108,24 @@ set default(load_balancing_mode) { memory } - set default(auth) { pwd os } +# максимальный объем памяти процессов рабочего сервера +set default(critical_total_memory) 0 + +# допустимый объем памяти процессов рабочего сервера +set default(temporary_allowed_total_memory) 0 + +# предел превышения (секунд) допустимого объема памяти процессов +set default(temporary_allowed_total_memory_time_limit) 300 + + + + + ## Раскоментировать строки и прописать свои значения если ## для Информационных Баз используются эти параметры #set default(infobase_user) "ib_user" @@ -124,3 +136,4 @@ set default(auth) { set default(theme) dark + diff --git a/rac_gui.tcl b/rac_gui.tcl index 277ca5e..c3a930a 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -45,9 +45,11 @@ if {[file exists [file join $env(HOME) .rac_gui]] ==1 && $dir(work) ne [file joi cd $env(HOME) #file rename -force [file join $env(HOME) .rac_gui] [file join $env(HOME) .rac_gui.old] file delete -force [file join $env(HOME) .rac_gui] + tk_messageBox -message "[::msgcat::mc "All files from old working dir will be moved into new location:"]\n$dir(work)" -icon info -type ok } + puts "Work dir is $dir(work)" # каталог с модулями @@ -62,36 +64,6 @@ source [file join $dir(work) rac_gui.cfg] ::msgcat::mclocale $default(locale) ::msgcat::mcload [file join $dir(lib) msg] -# Код проверки наличия rac и правильности указания пути в конфиге -# если программа не найдена то будет выведен диалог для указанием корректного пути -# и этот путь будет записан в пользовательский конфиг -if {[file exists $rac_cmd] == 0} { - set rac_cmd "[tk_getOpenFile -initialdir $env(HOME) -parent . \ - -title [::msgcat::mc "Show where is a RAC command"] -initialfile rac]" - if {$rac_cmd eq ""} {exit} - file copy [file join $dir(work) rac_gui.cfg] [file join $dir(work) rac_gui.cfg.bak] - set orig_file [open [file join $dir(work) rac_gui.cfg.bak] "r"] - set file [open [file join $dir(work) rac_gui.cfg] "w"] - while {[gets $orig_file line] >=0 } { - if {[string match "set rac_cmd*" $line]} { - puts $file "set rac_cmd \"$rac_cmd\"" - } else { - puts $file $line - } - } - #puts $rac_cmd - close $file - close $orig_file - #return "$host:$port" - file delete [file join $dir(work) rac_gui.cfg.bak] - if {$tcl_platform(platform) == "windows"} { - tk_messageBox -message "[::msgcat::mc "Reexecute the programm"]!" \ - -icon info -type ok - exit - } -} else { - puts "Found $rac_cmd" -} set cluster_user "" set cluster_pwd "" @@ -108,6 +80,8 @@ foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] { source [file join $dir(lib) gui.tcl] source [file join $dir(work) rac_gui.cfg] +CheckVariablesSet + # Читаем файл со списком серверов 1С #set serversList [dict create servers] @@ -137,3 +111,4 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { + From ffd579704a104d1bbf13cc8671754002536cf11c Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 10 Sep 2019 12:50:17 +0300 Subject: [PATCH 17/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=D1=8B=20=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/msg/ru.msg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index a70336e..e736126 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -126,4 +126,8 @@ ::msgcat::mcset ru "The default variables is undefinied:" "Не установлены значения по умолчанию для следующих перменных:" ::msgcat::mcset ru "New config file will be copying from RAC GUI distributive." "Скопирoвать новый файл настроек из дистрибутива программы?" ::msgcat::mcset ru "All files from old working dir will be moved into new location:" "Все файлы из текущего рабочего каталога перенсены в:" +::msgcat::mcset ru "Command must be" "Команда должна быть" +::msgcat::mcset ru "or" "или" +::msgcat::mcset ru "You entered" "Вы ввели" +::msgcat::mcset ru "it's correct?" "это правильно?" From 2420f0b038a80b29ab35ec09eae2cc3bcf9c9021 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 10 Sep 2019 14:06:34 +0300 Subject: [PATCH 18/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4?= =?UTF-8?q?=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=D0=BA=D0=BE=D0=B2=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D1=86=20=D0=BF=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=B8=20=D1=81=D0=BE=D0=B5=D0=B4=D0=B8=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/msg/ru.msg | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index e736126..dcc2756 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -130,4 +130,19 @@ ::msgcat::mcset ru "or" "или" ::msgcat::mcset ru "You entered" "Вы ввели" ::msgcat::mcset ru "it's correct?" "это правильно?" +::msgcat::mcset ru "Manager" "Менеджер" +::msgcat::mcset ru "Descr" "Описание" +::msgcat::mcset ru "Process" "Процесс" +::msgcat::mcset ru "Is enable" "Включен" +::msgcat::mcset ru "Running" "Запущен" +::msgcat::mcset ru "Started at" "Время запуска" +::msgcat::mcset ru "Use" "Использование" +::msgcat::mcset ru "Started at" "Время запуска" +::msgcat::mcset ru "Memory size" "Размер памяти" +::msgcat::mcset ru "Connection" "Соединение" +::msgcat::mcset ru "Session" "Сессия" +::msgcat::mcset ru "Object" "Объект" +::msgcat::mcset ru "Locked" "Заблокировано" +::msgcat::mcset ru "Connected at" "Подключено в" +::msgcat::mcset ru "Session number" "Номер сессии" From 8a5a586a73a16d02559260f012e4a43a30468630 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 10 Sep 2019 19:06:48 +0300 Subject: [PATCH 19/25] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D0=BC=D0=BC=D0=B0=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B2=D0=B5=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BD=D0=B0=20=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1c_srv_new.cfg | 1 + lib/config.tcl | 60 ++++++++++++++-- lib/function.tcl | 178 +++++++++++++++++++++++++++-------------------- rac_gui.cfg | 5 +- rac_gui.tcl | 22 ++---- 5 files changed, 166 insertions(+), 100 deletions(-) diff --git a/1c_srv_new.cfg b/1c_srv_new.cfg index b34913a..760dd3b 100644 --- a/1c_srv_new.cfg +++ b/1c_srv_new.cfg @@ -45,3 +45,4 @@ localhost:1545 { } + diff --git a/lib/config.tcl b/lib/config.tcl index c90e6a8..ad40d61 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -23,6 +23,33 @@ proc GetInfobasePassword {host cluster infobase} { } } +proc GetClusterAdmin {host cluster} { + global servers_list + if [dict exists $servers_list servers $host clusters $cluster cluster_user] { + return [dict get $servers_list servers $host clusters $cluster cluster_user] + } +} +proc GetClusterPassword {host cluster} { + global servers_list + if [dict exists $servers_list servers $host clusters $cluster cluster_pwd] { + return [dict get $servers_list servers $host clusters $cluster cluster_pwd] + } +} + +proc GetAgentAdmin {host} { + global servers_list + if [dict exists $servers_list servers $host agent_user] { + return [dict get $servers_list servers $host agent_user] + } +} +proc GetAgentPassword {host} { + global servers_list + if [dict exists $servers_list servers $host agent_pwd] { + return [dict get $servers_list servers $host agent_pwd] + } +} + + # Конвертация словаря в удобочитаемый формат @@ -61,6 +88,11 @@ proc dict2json {dictionary} { } +proc SetServersConfigDict {} { + global servers_list + +} + # Сохраянем конфиг proc SaveConfig {} { global dir servers_list @@ -69,10 +101,12 @@ proc SaveConfig {} { set dict [dict get $servers_list servers] #puts "\n\n[split $dict " "]\n\n" set dict [string map {"\{" "\{\n" "\}" "\n\}"} $dict] - regsub -- {(\} )} $dict "\}\n" dict - - #puts $dict - #DictFormatter [dict get $servers_list servers] "-" + regsub -- {(\})} $dict "\}\n" dict + puts "_________" + puts $servers_list + puts "2_________" + puts $dict + #ictFormatter [dict get $servers_list servers] "-" #DictFormatter $dict "-" #regexp -all -indices -line -- {\}(.+?)\{} $dict m #puts " \n $m" @@ -90,13 +124,13 @@ proc SaveConfig {} { if {$open_brace == 0} { append indent "" } else { - append indent " " + append indent " " } incr open_brace } if [regexp -- {\}} $line] { #incr open_brace -1 - set indent [string range $indent 0 end-2] + set indent [string range $indent 0 end-4] incr close_brace } if [regexp -nocase -all -- {(\})(.+?\{)} $line match brace phrase] { @@ -123,6 +157,15 @@ proc SaveConfig {} { append str $indent [string trim $line] "\n" } puts $f $str + close $f + set file [open [file join $dir(work) 1c_srv_new.cfg] "w"] + set f [open [file join $dir(work) 1c_srv_new_.cfg] "r"] + while {[gets $f line] >=0} { + if {$line ne ""} { + puts $file $line + } + } + #file copy -force [file join $dir(work) 1c_srv_new_.cfg] [file join $dir(work) 1c_srv_new.cfg] } proc GetDictFromString {str indent} { @@ -178,3 +221,8 @@ proc CopyNewConfig {} { } } + + + + + diff --git a/lib/function.tcl b/lib/function.tcl index f1ca3b4..f162032 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -32,37 +32,37 @@ proc TreePress {tree} { } proc SetGlobalVarFromTreeItems {tree id} { - global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd + global host server active_cluster infobase profile_name dir rac_cmd_for_host rac_cmd servers_list \ + cluster_user cluster_pwd agent_user agent_pwd set parent [$tree parent $id] set values [$tree item $id -values] set key [lindex [split $id "::"] 0] + puts "$parent $values $key" switch -- $key { server { set host $values - set orig_file [open [file join $dir(work) 1c_srv.cfg] "r"] - while {[gets $orig_file line] >=0 } { - if [string match "$host*" $line] { - set path_to_rac [string trim [lindex [split $line ","] 1]] - if {$path_to_rac eq ""} { - set rac_cmd_for_host($host) "$rac_cmd" - } else { - set rac_cmd_for_host($host) $path_to_rac - set rac_cmd $path_to_rac - } - } - } - close $orig_file + set rac_cmd_for_host($host) [dict get $servers_list servers $host rac_cmd] + } + work_server { + set server $values } - work_server {set server $values} cluster { - set active_cluster $values - #dict set servers_list $host $values + set active_cluster $values + #dict set servers_list servers $host clusters "$values {}" + set cluster_user [GetClusterAdmin $host $active_cluster] + set cluster_pwd [GetClusterPassword $host $active_cluster] } infobase { set infobase $values - #dict set servers_list $host $active_cluster infobases $values + #dict set servers_list servers $host clusters $active_cluster infobases $values + } + profile { + set profile_name $values + } + agent_admins { + set agent_user [GetAgentAdmin $host] + set agent_pwd [GetAgentPassword $host] } - profile {set profile_name $values} } if {$parent eq ""} { @@ -146,7 +146,7 @@ proc RunCommand {par} { } proc ErrorParcing {err opt} { - global cluster_user cluster_pwd agent_user agent_pwd + global cluster_user cluster_pwd agent_user agent_pwd servers_list switch -regexp -- $err { "Cluster administrator is not authenticated" { @@ -189,7 +189,7 @@ proc ErrorParcing {err opt} { } } proc AuthorisationDialog {txt} { - global active_cluster agent_user agent_pwd cluster_user cluster_pwd + global active_cluster agent_user agent_pwd cluster_user cluster_pwd servers_list .frm_work.tree_work delete [ .frm_work.tree_work children {}] set frm [AddToplevel "$txt" administrator_grey_64 .auth_win] @@ -383,7 +383,25 @@ proc SetRacCommand {} { if {$rac_cmd eq ""} { return } else { - return $rac_cmd + #puts $rac_cmd + if {[file tail $rac_cmd] ne "rac" && [file tail $rac_cmd] ne "rac.exe"} { + set rac [file tail $rac_cmd] + set path_to_rac [file rootname $rac_cmd] + append msg [::msgcat::mc "Command must be"] " 'rac' " \ + [::msgcat::mc "or"] " 'rac.exe'\n" \ + [::msgcat::mc "You entered"] " '$rac' - " \ + [::msgcat::mc "it's correct?"] + set answer [tk_messageBox -message [::msgcat::mc $msg] -icon question -type yesno] + switch -- $answer { + yes { + return $rac_cmd + } + no SetRacCommand + } + } else { + return $rac_cmd + } + } } @@ -392,7 +410,7 @@ namespace eval Run {} {} # Получение данных по кластерам proc Run::server {tree host values} { - global rac_cmd_for_host rac_cmd + global rac_cmd_for_host rac_cmd servers_list if {[info exists rac_cmd_for_host($host)] == 1 && $rac_cmd_for_host($host) ne "" } { set rac_cmd $rac_cmd_for_host($host) } @@ -417,10 +435,15 @@ proc Run::server {tree host values} { } foreach x [array names cluster] { set id [lindex $cluster($x) 0] + set cluster_name [lindex $cluster($x) 1] if { [$tree exists "cluster::$id"] == 0 } { - $tree insert "server::$host" end -id "cluster::$id" -text "[lindex $cluster($x) 1]" -values "$id" + $tree insert "server::$host" end -id "cluster::$id" -text "$cluster_name" -values "$id" InsertClusterItems $tree $id } + #dict replace servers_list [dict get servers_list servers $host clusters] + #dict set servers_list servers $host clusters $id name $cluster_name + #puts $cluster_name + #puts $servers_list } if { [$tree exists "agent_admins::$id"] == 0 } { $tree insert "server::$host" end -id "agent_admins::$id" -text [::msgcat::mc "Administrators"] -values "$id" @@ -478,6 +501,7 @@ proc Run::infobases {tree host values} { proc Run::infobase {tree host values} { global active_cluster cluster_user cluster_pwd default servers_list + if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" } else { @@ -937,9 +961,11 @@ proc Add::admin {tree host value} { } proc Add::server {} { - global default rac_cmd_for_host + global default rac_cmd_for_host servers_list set frm [AddToplevel [::msgcat::mc "Main server"] server_grey_64] + ttk::label $frm.lbl_server_name -text [::msgcat::mc "Name"] + ttk::entry $frm.ent_server_name ttk::label $frm.lbl_host -text [::msgcat::mc "Address"] ttk::entry $frm.ent_host ttk::label $frm.lbl_port -text [::msgcat::mc "Port"] @@ -948,13 +974,15 @@ proc Add::server {} { ttk::entry $frm.ent_path_to_rac ttk::button $frm.btn_path_to_rac -text "..." -width 3 $frm.ent_port insert end $default(port) - grid $frm.lbl_host -row 0 -column 0 -sticky nsw -padx 5 -pady 5 - grid $frm.ent_host -row 0 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5 - grid $frm.lbl_port -row 1 -column 0 -sticky nsw -padx 5 -pady 5 - grid $frm.ent_port -row 1 -column 1 -columnspan 2 -sticky nesw -padx 5 -pady 5 - grid $frm.lbl_path_to_rac -row 2 -column 0 -sticky nsw -padx 5 -pady 5 - grid $frm.ent_path_to_rac -row 2 -column 1 -sticky nsew -padx 5 -pady 5 - grid $frm.btn_path_to_rac -row 2 -column 2 -sticky new -padx 5 -pady 5 + grid $frm.lbl_server_name -row 0 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_server_name -row 0 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_host -row 1 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_host -row 1 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5 + grid $frm.lbl_port -row 2 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_port -row 2 -column 1 -columnspan 2 -sticky nesw -padx 5 -pady 5 + grid $frm.lbl_path_to_rac -row 3 -column 0 -sticky nsw -padx 5 -pady 5 + grid $frm.ent_path_to_rac -row 3 -column 1 -sticky nsew -padx 5 -pady 5 + grid $frm.btn_path_to_rac -row 3 -column 2 -sticky new -padx 5 -pady 5 grid columnconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1 @@ -964,17 +992,25 @@ proc Add::server {} { } .add.frm_btn.btn_ok configure -command { - set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get] [.add.frm.ent_path_to_rac get]] + set server_name "[.add.frm.ent_server_name get]" + set host "[.add.frm.ent_host get]:[.add.frm.ent_port get]" set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] - .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" + + dict set servers_list servers $host "name \"$server_name\" rac_cmd $rac_cmd_for_host($host) clusters {}" + + #set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get] [.add.frm.ent_path_to_rac get]] + #set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] + #puts $servers_list + .frm_tree.tree insert {} end -id "server::$host" -text "$server_name" -values "$host" destroy .add + SaveConfig return $host } return $frm } proc Add::servers {tree host values} { global default dedicate_managers using active_cluster cluster_user cluster_pwd auth \ - + servers_list if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" } else { @@ -1231,7 +1267,9 @@ proc Add::cluster {tree host values} { set errors_count_threshold $default(errors_count_threshold) set security_level [lindex $default(security_level) 0] set load_balancing_mode [lindex $default(load_balancing_mode) 0] - + set kill_problem_processes no + set kill_by_memory_with_dump no + set frm [AddToplevel [::msgcat::mc "Cluster"] cluster_grey_64] ttk::label $frm.lbl_host -text [::msgcat::mc "Host"] @@ -1303,7 +1341,7 @@ proc Add::cluster {tree host values} { RunCommand "cluster insert \ --host=[.add.frm.ent_host get] \ --port=[.add.frm.ent_port get] \ - --name=[.add.frm.ent_name get] \ + --name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "] \ --expiration-timeout=$expiration_timeout \ --lifetime-limit=$lifetime_limit \ --max-memory-size=$max_memory_size \ @@ -1798,53 +1836,37 @@ proc Edit::managers {tree host values} { } proc Edit::server {tree host value} { - global dir prev_address rac_cmd rac_cmd_for_host + global dir prev_address rac_cmd rac_cmd_for_host servers_list set frm [Add::server] wm title .add [::msgcat::mc "Edit record"] set lst [split $value ":"] set prev_address $value - set orig_file [open [file join $dir(work) 1c_srv.cfg] "r"] - while {[gets $orig_file line] >=0 } { - if [string match "$prev_address*" $line] { - set path_to_rac [string trim [lindex [split $line ","] 1]] - if {$path_to_rac eq ""} { - set path_to_rac "$rac_cmd" - } - } - } - close $orig_file + .add.frm.ent_server_name delete 0 end .add.frm.ent_host delete 0 end .add.frm.ent_port delete 0 end .add.frm.ent_path_to_rac delete 0 end + + .add.frm.ent_server_name insert end [dict get $servers_list servers $prev_address name] + .add.frm.ent_host insert end [lindex $lst 0] .add.frm.ent_port insert end [lindex $lst 1] - .add.frm.ent_path_to_rac insert end $path_to_rac + .add.frm.ent_path_to_rac insert end [dict get $servers_list servers $prev_address rac_cmd] .add.frm_btn.btn_ok configure -command { set host "[.add.frm.ent_host get]:[.add.frm.ent_port get]" - #set rac_cmd [.add.frm.ent_path_to_rac get] + set server_name [.add.frm.ent_server_name get] set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] .frm_tree.tree delete "server::$prev_address" .frm_work.tree_work delete [ .frm_work.tree_work children {}] - .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" - if [file exists [file join $dir(work) 1c_srv.cfg.bak]] { - file delete [file join $dir(work) 1c_srv.cfg.bak] - } - file copy [file join $dir(work) 1c_srv.cfg] [file join $dir(work) 1c_srv.cfg.bak] - set orig_file [open [file join $dir(work) 1c_srv.cfg.bak] "r"] - set file [open [file join $dir(work) 1c_srv.cfg] "w"] - while {[gets $orig_file line] >=0 } { - if [string match "$prev_address*" $line] { - puts $file "$host,$rac_cmd_for_host($host)" - } else { - puts $file $line - } - } - close $file - close $orig_file - #return "$host:$port" - file delete [file join $dir(work) 1c_srv.cfg.bak] + .frm_tree.tree insert {} end -id "server::$host" -text "$server_name" -values "$host" + + set clusters [dict get $servers_list servers $prev_address clusters] + dict unset servers_list servers $prev_address + dict set servers_list servers $host "name \"$server_name\" rac_cmd $rac_cmd_for_host($host) clusters \{$clusters\}" + unset clusters server_name + #puts $servers_list destroy .add + SaveConfig return $host } } @@ -2396,6 +2418,7 @@ proc Del::sessions {tree host values} { } + proc Del::rule {tree host values} { global active_cluster server agent_user agent_pwd cluster_user cluster_pwd auth if {$cluster_user ne "" && $cluster_pwd ne ""} { @@ -2420,14 +2443,20 @@ proc Del::rule {tree host values} { no {return} } } - +# Удаление основного сервера кластера proc Del::server {tree host values} { - global dir + global dir servers_list set answer [tk_messageBox -message "[::msgcat::mc "Delete server"] $values?" \ -icon question -type yesno ] switch -- $answer { yes { - file copy [file join $dir(work) 1c_srv.cfg] [file join $dir(work) 1c_srv.cfg.bak] + dict unset servers_list servers $values + SaveConfig + $tree delete "server::$values" + .frm_work.tree_work delete [ .frm_work.tree_work children {}] + return + # данный код не используется. УДАЛИТЬ! + file copy [file join $dir(work) 1c_srv_new.cfg] [file join $dir(work) 1c_srv.cfg.bak] set orig_file [open [file join $dir(work) 1c_srv.cfg.bak] "r"] set file [open [file join $dir(work) 1c_srv.cfg] "w"] while {[gets $orig_file line] >=0 } { @@ -2437,10 +2466,10 @@ proc Del::server {tree host values} { } close $file close $orig_file - #return "$host:$port" - $tree delete "server::$values" - .frm_work.tree_work delete [ .frm_work.tree_work children {}] file delete [file join $dir(work) 1c_srv.cfg.bak] + #return "$host:$port" + ########## Конец Удаления ############# + } no {return} } @@ -2545,3 +2574,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/rac_gui.cfg b/rac_gui.cfg index e338c38..9e7605c 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -122,10 +122,6 @@ set default(temporary_allowed_total_memory) 0 # предел превышения (секунд) допустимого объема памяти процессов set default(temporary_allowed_total_memory_time_limit) 300 - - - - ## Раскоментировать строки и прописать свои значения если ## для Информационных Баз используются эти параметры #set default(infobase_user) "ib_user" @@ -137,3 +133,4 @@ set default(theme) dark + diff --git a/rac_gui.tcl b/rac_gui.tcl index c3a930a..471307f 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -84,31 +84,21 @@ CheckVariablesSet # Читаем файл со списком серверов 1С #set serversList [dict create servers] - -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 host [lindex $l 0] - if {[lindex $l 1] ne ""} { - set rac_cmd_for_host($host) [lindex $l 1] - } - .frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" - } - close $f -} - if [file exists [file join $dir(work) 1c_srv_new.cfg]] { set f_new [open [file join $dir(work) 1c_srv_new.cfg] "RDONLY"] while {[gets $f_new line] >=0} { append str " [string trim $line]" } set str [string map {"\{ " "\{" " \}" "\}"} $str] - close $f dict set servers_list servers $str + close $f_new puts $servers_list + puts [dict get $servers_list servers] + dict for {host host_data} [dict get $servers_list servers] { + .frm_tree.tree insert {} end -id "server::$host" -text [dict get $host_data name] -values "$host" + set rac_cmd_for_host($host) [dict get $host_data rac_cmd] + } } - From 50c061f49135aa68151b7481b4defdd0725ab7b8 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 13 Sep 2019 13:36:09 +0300 Subject: [PATCH 20/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B7=D0=BE=D0=B2=D0=B0=20=D0=BF=D0=BE=D0=BC=D0=BE=D1=89?= =?UTF-8?q?=D0=B8.=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=B3=D0=BE=D1=80=D1=8F=D1=87=D0=B8=D0=B5=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D0=B2=D0=B8=D1=88=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + doc/racgui_manual.txt | 25 +++++++++++++++++++++++++ lib/config.tcl | 4 ++++ lib/function.tcl | 24 +++++++++++++++++++++++- lib/gui.tcl | 6 ++++++ lib/images.tcl | 26 ++++++++++++++++++++++++++ lib/msg/ru.msg | 2 +- lib/ttk_theme_dark.tcl | 10 +++++++++- rac_gui.tcl | 26 +++++++++++++++++--------- 9 files changed, 112 insertions(+), 12 deletions(-) create mode 100644 doc/racgui_manual.txt diff --git a/README.md b/README.md index 8615b3a..29903ee 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,4 @@ http://nuk-svk.ru/soft/rac-gui/ Иконки взяты с сайта https://www.iconsdb.com/royal-blue-icons/ + diff --git a/doc/racgui_manual.txt b/doc/racgui_manual.txt new file mode 100644 index 0000000..83d3bb9 --- /dev/null +++ b/doc/racgui_manual.txt @@ -0,0 +1,25 @@ +####################################################### +# RAC GUI +# Distributed under GNU Public License +# Author: Sergey Kalinin svk@nuk-svk.ru +# Copyright (c) "SVK", 2019, http://nuk-svk.ru +###################################################### + +Программа Rac-GUI представляет собой мультиплатформенный графический интерфейс к консольной утилите 1С rac. +Основной интерфейс программы состоит из: +1. Панели инструментов +2. Дерева для отображения структуры +3. Табличного поля + +Для добавления, редактирования, удаления сущностей (сервера, информационные базы, сеансы) предназначены соответствующие кнопки, расположенные в панели инструментов слева. Кнопки контекстно-зависимые, т.е. в зависимости от того какой раздел активен для работы (сервер, информационные базы, кластер, сеансы и так далее), функции кнопок меняются. + +После первого запуска программы следует добавить основной сервер кластера 1С (где запущен ras). Для этого надо нажать кнопку "+" в панели инструментов, или сочетание клавиш Control-Insert. И в открывшейся форме заполнить соответствующие поля. Так как каждый сервер управления и клиент могут работать только на одинаковой платформе 1С, то в RAC-GUI для каждого сервера указывается команда (файл rac) для соответствующей платформы. + +"Горячие" клавиши: + +Control-Insert - добавление нового +Control-Delete - удаление текущего раздела (сущности) +Control-Enter - редактирование текущего раздела (сущности) +Control-Q - выход из программы +F1 - вызов дилога помощи + diff --git a/lib/config.tcl b/lib/config.tcl index ad40d61..88e0347 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -98,6 +98,9 @@ proc SaveConfig {} { global dir servers_list set file [open [file join $dir(work) 1c_srv_new.cfg] "w"] set f [open [file join $dir(work) 1c_srv_new_.cfg] "w"] + if {![dict exists $servers_list servers]} { + return + } set dict [dict get $servers_list servers] #puts "\n\n[split $dict " "]\n\n" set dict [string map {"\{" "\{\n" "\}" "\n\}"} $dict] @@ -226,3 +229,4 @@ proc CopyNewConfig {} { + diff --git a/lib/function.tcl b/lib/function.tcl index f162032..c752405 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -405,7 +405,28 @@ proc SetRacCommand {} { } } - +proc ShowHelpDialog {} { + global default dir + set frm [AddToplevel [::msgcat::mc "About"] help_grey_64] + wm title .add [::msgcat::mc "About"] + text $frm.txt -wrap word + ttk::scrollbar $frm.hsb -orient horizontal -command [list $frm.t xview] + ttk::scrollbar $frm.vsb -orient vertical -command [list $frm.t yview] + text $frm.t -xscrollcommand [list $frm.hsb set] -yscrollcommand [list $frm.vsb set] + grid $frm.t -row 0 -column 0 -sticky nsew + grid $frm.vsb -row 0 -column 1 -sticky nsew + grid $frm.hsb -row 1 -column 0 -sticky nsew + grid columnconfigure $frm 0 -weight 1 + grid rowconfigure $frm 0 -weight 1 + + set file_help [open [file join $dir(doc) racgui_manual.txt] "RDONLY"] + while {[gets $file_help line] >=0} { + $frm.t insert end "$line\n" + } + close $file_help + destroy .add.frm_btn.btn_ok + return $frm +} namespace eval Run {} {} # Получение данных по кластерам @@ -2575,3 +2596,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/gui.tcl b/lib/gui.tcl index d08dee2..d2cb701 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -24,6 +24,11 @@ wm positionfrom . user bind . Quit bind . Quit +bind . Quit +bind . Add +bind . Del +bind . Edit +bind . ShowHelpDialog #ttk::style configure TPanedwindow -background blue #ttk::style configure Sash -sashthickness 5 @@ -121,3 +126,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both + diff --git a/lib/images.tcl b/lib/images.tcl index 3da3f07..d559ca6 100644 --- a/lib/images.tcl +++ b/lib/images.tcl @@ -621,3 +621,29 @@ image create photo app_grey_64 -data { ZhhOnihW5Ql725851hOPesCgxn4/bfEYVJ5mwlTT7EDyT2bwR4yyTf3d6bFcLIPtYoR++ujBwUmV mhdPl2vMUeYmt/VyyQtF7jBPKF0n5wAAAABJRU5ErkJggg== } +image create photo help_grey_64 -data { + iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAQAAAAAYLlVAAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAA + DsQAAA7EAZUrDhsAAAAHdElNRQfjCQ0JDhex/+rmAAAEzklEQVRo3sWZf0iVVxjHP727CxGJCAmJ + IZeIajfnD/IO56BshX+ELhF1wsI/Jv1x2lgbrTURN4bbmtiajW2HYlmMrcCYCFMzg5KcjeLiRGRJ + hAvxDxmXFhdxcnF3++Ne7/ve9/465/5Y37/uOfd9nud73nOe5zzP865DE8JgO8XsopAC8tnAKj68 + LPIHs0wzJwN6+tZpmN7EQWqpYnOCh7yMMcSg9GaYgNiDoI4cRa1+RpCMqrwNBQKihg5eRB8zfEpf + MhJJCIhSzrKH1DHJMflLigREDp28g4P0EOA8J+SSNgHh4grFZAYPeE1Oxf7LiGO+jl8zZh62MyGa + Y//1TEzzb3FR+cSr4Vnq3cueO0oExAd8oRMflB2+2m14xpISEG9zmmxhr/tvz0RCAqKeC1lYvYn9 + 7jnPdFwvEMVMkEd2scJeeS8mAZHHXVyKala5yRCTLLBMDvkU8jI17FSSfUSZfBKLwDccVTTfR7t8 + GOOerKSTKgX5XtkaRUBUMh4vKtgi20l5OsFl/REfKujYL8ciCAiDu5Qrrb5DfhKS2UInFeQwR7cc + tZDo5r2kWn6nRK5aI2GTovkZPg//vsobuNjKAX4WFZZn2plKqsdFiyUUC4MOxd3vD/IGUUhleHY9 + beYj0s/HCprahMN8AweVT/9f4V+5EfOlEaMRlpJq2sarJgGh7MW5llXHngfkCvMKut4MERCbqVYm + 0CjWDFcmfO6Jgq4q4QQHUKeRdJTyo+jCTw3ttvhmd7TkMKjnjAOo1QqlDTTEmP3TNt6kpOsQZwzh + SCvnM/3aGo5y2aokVSFyDVxsyACBGxGjA4rpzHrKDZsDpQYfAxHjY8qSxQbPZ4DAV9Jn2YBmXlGW + 3GHgTNv8It0W8zuRGrJOgy1pEzhurl8Uco2NGrL5hqLDxMewvBw27+SW5hvdaNhCqi6WzDAuihhX + dD+LHxhKSUh8dMlQ1BdVjPOctrxh4E/D/DJfh8w3cF1r78Mh3KF0bcTDzWByKeq4kmIR6zOiorgO + ZkPZ9IWUa2ivoXRzJ05PXGl40ryD+2kQeEEcBnaloeG+QyGBjI9mmtOMItMGU1HJxP+HVSYNucKd + p0ZgUvoMYOipERgJZsX9BFISD3CbHr5lJmUCP4VKM3FLqaS017iN0hMqa1qQKbR0pmXJWl1wTlvY + T23QPMiAvKSRA5k4ZxYm/SxoCvfLyBf/HY80NTzm+zAB6eeUpvh45FAGtOPJl8Hm5dpl3MucpgeT + QiliTeN6LNUxyBWOayl4Kaox4dKSP7nWvA2nI3LAllonRpPYFjE+rNgfCmKUH8z6zLIMFjWq5Gui + KCzYpJUJP6bVbOJHtumqGdK42f0M8BAHFVrFXYBDctAc2pqS4n26shx+2+Vn1qGtU+qZcBcodotS + w3naPP8mIADu6zgpyZL5yxyR/0RORRHwBNyDFLA7C+Z7aZVR8SNGu94TcA/jZ19Gm9YBTvGuffUx + DqHlONZwkfwMmfdxRPbF69PEgRykjOGMmL9NWTzzJCrM5AK1vK59T9pjfiv7ZIJ7Juk+izyOciKl + zfBylh6ZpGWpdNBEHi0IirSaVpJLMnm/VOvjdTmN1CS99WYZ5Kr1m0jGCIRoFFBBMTtwkh/uLfjx + Ms8DfsMjNc/Mf4o2PgHmKkMjAAAAAElFTkSuQmCC +} diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index dcc2756..e086a05 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -145,4 +145,4 @@ ::msgcat::mcset ru "Locked" "Заблокировано" ::msgcat::mcset ru "Connected at" "Подключено в" ::msgcat::mcset ru "Session number" "Номер сессии" - +::msgcat::mcset ru "About" "О программе" diff --git a/lib/ttk_theme_dark.tcl b/lib/ttk_theme_dark.tcl index 13a256d..5c7d13e 100644 --- a/lib/ttk_theme_dark.tcl +++ b/lib/ttk_theme_dark.tcl @@ -91,11 +91,18 @@ namespace eval ttk::theme::dark { -background $colors(-lightframe) -itembackground {gray60 gray50} \ -itemfill #ffffff -itemaccentfill yellow \ -fieldbackground $colors(-lightframe) + + ttk::style configure Text \ + -background [list active $colors(-lighter)] \ + -foreground [list disabled $colors(-disabledfg)] + # ttk::style configure TreeCtrl \ # -background gray30 -itembackground {gray60 gray50} \ # -itemfill #ffffff -itemaccentfill yellow + option add *Toplevel.Background $colors(-dark) interactive + option add *Text.Foreground $colors(-foreground) interactive + option add *Text.Background $colors(-frame) interactive } - option add *Toplevel.Background $colors(-dark) interactive #option add *Treeview.Background red interactive # option add *Frame.Background $colors(-frame) interactive # option add *Label.Background $colors(-frame) interactive @@ -140,3 +147,4 @@ namespace eval ::tablelist:: { + diff --git a/rac_gui.tcl b/rac_gui.tcl index 471307f..d42d34b 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -20,6 +20,8 @@ package require msgcat # Устанавливаем текущий каталог set dir(root) [pwd] +set dir(doc) [file join $dir(root) doc] + # Устанавливаем рабочий каталог, если его нет то создаём. # Согласно спецификации XDG проверяем наличие переменных и каталогов if [info exists env(XDG_CONFIG_HOME)] { @@ -86,19 +88,25 @@ CheckVariablesSet #set serversList [dict create servers] if [file exists [file join $dir(work) 1c_srv_new.cfg]] { set f_new [open [file join $dir(work) 1c_srv_new.cfg] "RDONLY"] + set str "" while {[gets $f_new line] >=0} { append str " [string trim $line]" } - set str [string map {"\{ " "\{" " \}" "\}"} $str] - dict set servers_list servers $str - close $f_new - puts $servers_list - puts [dict get $servers_list servers] - dict for {host host_data} [dict get $servers_list servers] { - .frm_tree.tree insert {} end -id "server::$host" -text [dict get $host_data name] -values "$host" - set rac_cmd_for_host($host) [dict get $host_data rac_cmd] + if {$str ne ""} { + set str [string map {"\{ " "\{" " \}" "\}"} $str] + dict set servers_list servers $str + close $f_new + puts $servers_list + puts [dict get $servers_list servers] + dict for {host host_data} [dict get $servers_list servers] { + .frm_tree.tree insert {} end -id "server::$host" -text [dict get $host_data name] -values "$host" + set rac_cmd_for_host($host) [dict get $host_data rac_cmd] + } + } else { + set servers_list "" } +} else { + set servers_list "" } - From 30ff9428fcee806472bf776093526ae989ba8ba3 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Fri, 13 Sep 2019 13:43:17 +0300 Subject: [PATCH 21/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=B7=D0=B0=D0=BA=D1=80=D1=8B=D1=82=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BE=D0=BA=D0=BE=D0=BD=20?= =?UTF-8?q?=D0=BF=D0=BE=20Escape?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 3 ++- lib/gui.tcl | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index c752405..3f59444 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -898,7 +898,7 @@ proc AddToplevel {lbl img {win_name .add}} { grid $frm_btn -row 1 -column 1 -sticky sew -padx 0 -pady 0 pack $frm_btn.btn_cancel $frm_btn.btn_ok -side right -padx 5 -pady 5 #pack $frm_btn.btn_ok -side right -padx 2 - + bind .add $cmd return $frm } @@ -2596,4 +2596,5 @@ proc Del::inet {tree host profile_name} { + diff --git a/lib/gui.tcl b/lib/gui.tcl index d2cb701..771e4fe 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -122,8 +122,3 @@ pack $frm_tree $frm_work -side left -expand true -fill both .panel add $frm_tree -weight 1 .panel add $frm_work -weight 1 - - - - - From 3da4b6f5202679a9cf8a2c97e20c4190dba8cd74 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 16 Sep 2019 13:46:22 +0300 Subject: [PATCH 22/25] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3.=20=D0=94?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B8=D0=BD?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B2=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=20=D0=BE=20=D0=BF=D1=80=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BC=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1c_srv_new.cfg | 7 +++-- README.md | 1 + doc/rac-manual.txt | 1 + doc/racgui_manual.txt | 72 +++++++++++++++++++++++++++++++++++++++++-- 4 files changed, 75 insertions(+), 6 deletions(-) diff --git a/1c_srv_new.cfg b/1c_srv_new.cfg index 760dd3b..a445e5a 100644 --- a/1c_srv_new.cfg +++ b/1c_srv_new.cfg @@ -31,18 +31,19 @@ localhost:1545 { } } } -192.168.5.145:1545 { +192.168.52.45:1545 { name "1C test" - path_to_rac "/opt/1C/v8.3/x86_64/rac" + rac_cmd "/opt/1C/v8.3/x86_64/rac" clusters { } } 1csrv:1545 { name "1C SRV" - path_to_rac "/opt/1C/v8.3.13_1644/x86_64/rac" + rac_cmd "/opt/1C/v8.3.13_1644/x86_64/rac" clusters { } } + diff --git a/README.md b/README.md index 29903ee..9de252d 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,4 @@ http://nuk-svk.ru/soft/rac-gui/ Иконки взяты с сайта https://www.iconsdb.com/royal-blue-icons/ + diff --git a/doc/rac-manual.txt b/doc/rac-manual.txt index b3792ac..c5a4a57 100644 --- a/doc/rac-manual.txt +++ b/doc/rac-manual.txt @@ -1435,3 +1435,4 @@ rac rule [command] [options] [arguments] + diff --git a/doc/racgui_manual.txt b/doc/racgui_manual.txt index 83d3bb9..44c9fab 100644 --- a/doc/racgui_manual.txt +++ b/doc/racgui_manual.txt @@ -15,11 +15,77 @@ После первого запуска программы следует добавить основной сервер кластера 1С (где запущен ras). Для этого надо нажать кнопку "+" в панели инструментов, или сочетание клавиш Control-Insert. И в открывшейся форме заполнить соответствующие поля. Так как каждый сервер управления и клиент могут работать только на одинаковой платформе 1С, то в RAC-GUI для каждого сервера указывается команда (файл rac) для соответствующей платформы. -"Горячие" клавиши: += "Горячие" клавиши = -Control-Insert - добавление нового -Control-Delete - удаление текущего раздела (сущности) +Insert - добавление нового +Delete - удаление текущего раздела (сущности) Control-Enter - редактирование текущего раздела (сущности) Control-Q - выход из программы F1 - вызов дилога помощи += Формат файла конфигурации = +Формат файла настроект серверов похож на JSON, но представляет собой несколько TCL-словарей вложенных друг в друга. +Обязательными значениями являются адрес хоста, номер порта и путь к RAC. Остальные настройки опциональны. +Опции сервера: +name - наименование сервера +rac_cmd - полный путь к утилите rac +agent_user - имя администратора агента кластера +agent_pwd - пароль администратора агента кластера + +Опции кластера: +cluster_name - наименование кластера +cluster_user - имя администратора кластера +cluster_pwd - пароль администратора кластера + +Опции инф. базы: +infobase_name - наименование ИБ +infobase_user - имя пользователя ИБ +infobase_pwd - пароль пользователя ИБ + +Адреса хостов, номера портов, идентификаторы кластеров и ИБ должны соответствовать реальным. + +Пример настроек: + +localhost:1545 { + name "Локальный сервер" + rac_cmd "/opt/1C/v8.3/x86_64/rac" + agent_user "" + agent_pwd "" + clusters { + 3ed9081a-c5b0-11e9-cf8a-1c1b0d94027e { + cluster_name "eeee" + } + 4581a966-a6bf-11e9-3c95-1c1b0d94027e { + cluster_name "Локальный кластер" + cluster_user "" + cluster_pwd "" + infobases { + 1e1d1cea-b856-11e9-748a-1c1b0d94027e { + infobase_name "wewe" + infobase_user "ibuser" + infobase_pwd "ibpwd" + } + 0129b2b2-b8d6-11e9-748a-1c1b0d94027e { + infobase_name "testdb" + infobase_user "testdb2-user" + infobase_pwd "testdb2-pwd" + } + cac80302-b855-11e9-748a-1c1b0d94027e { + infobase_name "testdb" + } + } + } + } +} +192.168.125.145:1545 { + name "Test" + rac_cmd /opt/1C/v8.3/x86_64/rac" + clusters { + } +} +1c-srv:1545 { + name "Cервер для бухгалтерии" + rac_cmd "/opt/1C/v8.3.13_1644/x86_64/rac" + clusters { + } +} From a4c325d161dd6dbd45144d1cfc48b225ef3a70bf Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 16 Sep 2019 13:47:38 +0300 Subject: [PATCH 23/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2=D0=B0=20=D0=B4=D0=B8=D0=B0=D0=BB?= =?UTF-8?q?=D0=BE=D0=B3=D0=B0=20=D0=BF=D0=BE=D0=BC=D0=BE=D1=89=D0=B8.=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gui.tcl | 10 ++++---- lib/images.tcl | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++ rac_gui.cfg | 4 ---- rac_gui.tcl | 6 ++++- 4 files changed, 76 insertions(+), 9 deletions(-) diff --git a/lib/gui.tcl b/lib/gui.tcl index 771e4fe..6fcacc0 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -25,8 +25,8 @@ wm positionfrom . user bind . Quit bind . Quit bind . Quit -bind . Add -bind . Del +bind . Add +bind . Del bind . Edit bind . ShowHelpDialog @@ -51,11 +51,12 @@ pack propagate .panel false ttk::button $frm_tool.btn_add -command Add -image add_grey_32 ttk::button $frm_tool.btn_del -command Del -image del_grey_32 ttk::button $frm_tool.btn_edit -command Edit -image edit_grey_32 +ttk::button $frm_tool.btn_help -command ShowHelpDialog -image question_grey_32 ttk::button $frm_tool.btn_quit -command Quit -image quit_grey_32 -pack $frm_tool.btn_add $frm_tool.btn_del $frm_tool.btn_edit -side top -padx 5 -pady 5 +pack $frm_tool.btn_add $frm_tool.btn_del $frm_tool.btn_edit $frm_tool.btn_help -side top -padx 5 -pady 5 #label $frm_tool.lbl_logo -image tcl -pack $frm_tool.btn_quit -side bottom -padx 5 -pady 5 +pack $frm_tool.btn_quit -side bottom -padx 5 -pady 5 #pack $frm_tool.lbl_logo -side bottom -padx 5 -pady 5 # Дерево с полосами прокрутки @@ -122,3 +123,4 @@ pack $frm_tree $frm_work -side left -expand true -fill both .panel add $frm_tree -weight 1 .panel add $frm_work -weight 1 + diff --git a/lib/images.tcl b/lib/images.tcl index d559ca6..3d74f98 100644 --- a/lib/images.tcl +++ b/lib/images.tcl @@ -647,3 +647,68 @@ image create photo help_grey_64 -data { zfBylh6ZpGWpdNBEHi0IirSaVpJLMnm/VOvjdTmN1CS99WYZ5Kr1m0jGCIRoFFBBMTtwkh/uLfjx Ms8DfsMjNc/Mf4o2PgHmKkMjAAAAAElFTkSuQmCC } + +image create photo question_grey_64 -data { + iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI + WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4wkQCiAKecu+CAAACLFJREFUeNrVm3+QVWUZxz979/Kj + TWCBgIDGQULc1mSM0ZU05WTqCO6QY2RWZMo4DLMlMbRTpIx9RWwoGEcJTTbCxhxDZ2WMaFEL5urk + RtTgTlnhBoGM/FoBJUgQlt3+OM+duW7nfe+5P86Fnpk7O3vOe94fz/u8z/N9frxVJEySUsBEYDLw + SWAcMAaoBQYCKeAk8G+gC9gDbAc6gA5JJ5OcX1VCix4MNNrvWmBUkV2dANqBNmCdpN3nNAMkXQPM + AW4GPlzmuZ4Bfg+0AK2STp0zDJA0A7gHuILK0JvAcqClVEZUlbjwS4GHgamcHdoJNEt6vqIMkNQf + ENAM9OPs06+AJkn7EmeApAnA08DlRSi0v9tvH3Ac6DYrMBAYDAwDzjdrMbzA/t8G7pK0PjEGSLoO + WFvA5HYBrcALwBZJ78UcJw1MAm4EbgEuBapjKsr7JP2g7AyQdBvwc2BAjEm0ASuAzZJ6yqBkJwFz + gdtjWpcfA/PjjF0VcwKzgDUxzvuLwEJJHQnhizHAQmNGvrn8FJibjwlVMQadaWfeN+B+YJ6kVgcS + rDU02GC/S4Ch1mc38D5wGHgd+LP9dgBHoxZgEtESw+w+avNyMqE6BrB5Lo/YbwSmS9oa8X0NcL3t + 2n12nuuMIYPsb1b5jQU+BdwEzAAuAk4EQbAvk8mczu03k8kcDILgSfv3M6ZIo6jB2mcKlgBJ5wNb + 88DYZSbyUbs0Avga8H1b5EHgt0AGOARcaFC5AfiQo/93gAeApyS97ZjnzcCTxlCXTpolaW1sBpid + 3wxc5el0gaQVju/H2o7PyUFu86MAi6RlwJ15LMvjwAMuOy/pSmC9p493gMlRvoRLdBZ6Fo8tZoXn + /Txgds7/HcArjraLgV8aU110J9DkkdZ2k6ZjjiZDgdWmj/wMkFRvuN4p9pJWeibzaeAbQDrn8Tjg + 4472x4BVQKdnzAGmzCZ5xt0CfAU47WjyOWBWHAl42KP0XvQxR1KVLb6vrZ5kitKlc/4JbMqj0QdZ + 3z6lvcEguouWmqsezQBDetd7oOZsSd2eAbIwNkrX3GAWIIq6gVdjQIErJF2Qp82PgJcd70YD3/RJ + wCJPx80xnI3RpvGjqB64POocSjoDxAl2fAS4II8UdAN3me8RRQtypSDVx7V1ubWvAk/FmGB/j2Kt + scnXON6fjNn/eTHA2w47ylE03CD1/0jAHE+fi2Ji+ncN1blMbj8Pg3pj9N+Tx1rk0nIzf1HU9AEG + mN2/1dH4D5IyMbH6XzzK7ChhsPO44306xhD/MV0UZy5HgMccrz8h6bJcCQg8IOKxAn2WJXZkTtuu + 9ppUrAde8kjSoBh9HzJQFZdaPGbx1lwGTPcgqHUFemz7gK8bIzaZr3CvHaMuxzfVZkHyUbukgwXM + ZQ/wO8fr6blid62j0Ya4QYw+A+80hBeXBuRBntndf6QIL7oVmBbx/GJJY1JmEuodH7dVKKY3Cpji + ed8NPFpkXqDNozinpDzhpjMe/F7OIEe1ga+JjiangNVF6KJs/wdM+UbR5JQHne0pJspaBI0EvmSB + 0Siz12KeYFcJY7Q7nk9Mm6MSRTsqJP5XA1dGPH/PnKSHyrARrrVMSBMmKl2gJmnxT1nApO/u/xX4 + IfAbSeWYh6uP2rQHu5+swO5/uY8CPkEYQl9uAKy3TOM402dpD7buSXj3hwJ39EF5yyz601XGxWet + iJMB3Zwd+jxhVLcXeAO4V9K6Sk/Cx4BUgrs/0JTfIFNQ35bUlvA6nYs84nE9k6JhFiXqtShN0oCr + v48BXZ5JJsmA8cA/JP2sApJe64LXKeBfjpfjE5zQEMK44fMVOuoTHM93p3BHY8dJ+mhCExpgVuZP + FWJAg+P59hSwzeEsVAPXJDipt4C9FQBbIz3OXkfKkFanz2dOgLYD3/Mcv3LSDbgTu+1ZU+cKGjSa + ySo37ScsazlSAQbMdDz/m6QD6Ryf+e6IRsMJS97WllkseysBwEyH3eiLdWQlYDPuYGMT/780F3eW + ax3kZIct3+dKPU2V9EqZdqWfeaDnmRR0Ae+WGftnq1V3ACMiXr8B1EvqyYW7j3tCR0uiMjpFTGo8 + sAD4he3As4T1PEnommbH4iHMFPd8AO9Let2jDK8Gbitx8RcR5u2WWH8TDQ5/FfgJEZnbEsaaYIyO + omOExV6RDo8vkvtQscDIdvdu4AsOx2Qs8KCkKWUKsrTgriZbKelQJAOs0ODXjg9HAWushq9QujgG + qBriMVmF0HeAzzreHTQp9Lq8zbgzq9MoLN6fpdG4Q2+5yHOMpNoSdn9Gnvnd0zfEFpWq7gSW+jgs + qRjTGEfLV5Ww+AbCDLYL9b2ce/bzBT2WAn/07NQKSXMLmN8BEz8f9QB7iwmCWqJzA+784lHCOuKe + WAywGvzbcaeXq02ZLI5pHl8zs+eTgl2ECZBCF99o1muEp1mT1QxELiSSMpnM4SAIXiPMoqYdwZSp + QEMQBJsymcxxT1+9QRDsskBIXUR/u4D7JW0uYOHpIAgWEVaD1niaPijpEV9EyDfIS4Tlbqc9zaYB + 2yTdkqev3cB3gfmEBZj7CVPdawwDPFPA4usNvt+Pv4R3FWG9YmlKR9JsQ4r5CpQ3mqZNqlh6JGEN + YxP5q9afcJ37orSuVYyvJl65/HpgJZApU7l8nS36DuIVUqyyc1+ecvmciUwnrBwfEvOTnYT5+Q3A + 1rgXnEyx1pkrO9NCWnEvTCwBFsdlfDFXZuotPnBJgZ8es/BbJ2Gxw6mcmECKMHQ9mDAYexmF3zU8 + THg/oLWQj4q9NFVjiGse58alqY3AHElvFfphqdfmJhNejbnqLC38TcICztZiO0iVyIBt5uR8kTCl + XSnaC3wLqCtl8SVLQITiuo6w4LIxhrUolM4AW8wcP3tOXZ2NYMYwwmsvjSYhI4rs6n3C8pYXCO8L + lz2MXpW0rJpk1Fv0J3t9/mOm8bO1Cd2EIfJDhLmCTsJLFtuSvj7/XyMp1u66KXlpAAAAAElFTkSu + QmCC +} +image create photo question_grey_32 -data { + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAA + CxMAAAsTAQCanBgAAAAHdElNRQfjCRAKKwvtOFdVAAADe0lEQVRIx4XVbWiVZRwG8N/z7CST6TA3 + Sc1sGS56Q7KtUiRi1BIjP2QhWCyVoXsUJEKkwiTCbBVoFHmf5CD7YAjRp0SlkBW+fKiOYZhoZiai + lrpy1nIqbk8fznFubkfvT/fLdf3/98t1X//IkC2ZoEGdScpddsGf9mkPR4dCRoOow8yzyCPKBmH3 + ymkLF28YIHne++5Sup20MrSVCJCMkPVi3/CgnQ7rQLVa0z3Yt7JFU+gcFCCptk09uGSj9eHn6/ZW + a4lmFeCAmeHEgABJpW89BHZZGI4kscc1mWaM2Bl7tNkTepMaWU+DX80IZyAuJthUpH+sIRxJKrSm + WxxP51rsvHsstMOapCIcM8s7YLLPkwwKd520eBWsC6/ke6lf6u3ooGXZo/mD9bs1ySjzmI78d/k0 + 317fowE1LuV3EZOMtgZstxySSWan0inpoy0xYW+6O5VKM+mzSQ2E1TaDN5IJhSMscyvOaQ69kFYb + G4l4znBayhyORCLRnen44oGX+AMVVhAnGYvA2nCquHwmLfSuSEFvKpVKr0Q9BUDotBrMT0bEnjAO + 3dZffbDsMe/ZnG6KsvFFUkYXd/B7erLvVdv8hZFmZjwJvg5/X3vz3h1l+6Kewkx8S1Edl23NnriK + CBeSLy1AY0YdaO8vmg2ps32DxnQyen0SDZCwdgtQl1EDDpdU/5uRtCt6N10XugfMFxgTMyrBhRLf + epa69Kjm8M2gpcKvjDNu3FbYlc7+tLM0IKPLGJQPmX+Uez1Qgj6scN+xgs/UDgmqSr8PZ0ukLjCO + x/KgYUjQxeiLknsvMPJR0ugrdJvQXwk3a0m5E6owN9buNIYXBT0QNjGZmowaMkKTKvxrWxyuyIHl + SfVATMtcORvlFt83KHClVQUXCV0xPnQeVbL9QYvHRa95yhRz4rcG5f/I7ejWSkzosBLMSdZcw8R3 + G1vsTmkZYPHJci+D1nD8qqWttx28nqxNiiYX7U/PFRk/ZXv60Vf6AOwp2FAZ5NP6rZ5xG6aZUb8z + 38kPl+r2RfertMXSfFHoyfj6z7SA38wM/wy09bG2FY31Pxtkw3XfK6nRYomR4Bczw7HBhaVSzgt9 + w/12O6RDr9FqTTe1r9ht99I1zVxf2uZpdccNFHTaKrmCd5YqruXma/bwEOQDcnKh6ybVuRhmkkZ1 + xivHZaf8aEc4NBTyf7MOJUH/zPUoAAAAAElFTkSuQmCC +} diff --git a/rac_gui.cfg b/rac_gui.cfg index 9e7605c..3747832 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -130,7 +130,3 @@ set default(temporary_allowed_total_memory_time_limit) 300 # Используемая тема # доступны: dark, clam, classic, default, alt set default(theme) dark - - - - diff --git a/rac_gui.tcl b/rac_gui.tcl index d42d34b..89a2243 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -99,7 +99,10 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { puts $servers_list puts [dict get $servers_list servers] dict for {host host_data} [dict get $servers_list servers] { - .frm_tree.tree insert {} end -id "server::$host" -text [dict get $host_data name] -values "$host" + .frm_tree.tree insert {} end -id "server::$host" \ + -text [dict get $host_data name] -values "$host" + puts "$host > $host_data" + puts [dict get $host_data name] set rac_cmd_for_host($host) [dict get $host_data rac_cmd] } } else { @@ -110,3 +113,4 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { } + From a32447dc05fdcc97d3ae6a759eac4794cd6f24f8 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Mon, 16 Sep 2019 15:24:24 +0300 Subject: [PATCH 24/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=83=D1=89=D0=B5=D0=B9=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=B2=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3=20=D0=BE?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/function.tcl | 34 +++++++++------------------------- lib/gui.tcl | 1 - lib/msg/ru.msg | 2 ++ rac_gui.tcl | 15 +++++++++++++-- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/lib/function.tcl b/lib/function.tcl index 3f59444..2181548 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -406,16 +406,21 @@ proc SetRacCommand {} { } proc ShowHelpDialog {} { - global default dir + global default dir racgui_version racgui_release set frm [AddToplevel [::msgcat::mc "About"] help_grey_64] wm title .add [::msgcat::mc "About"] + ttk::label $frm.lbl_version -text "[::msgcat::mc "Version"]: $racgui_version" + ttk::label $frm.lbl_release -text "[::msgcat::mc "Release"]: $racgui_release" + text $frm.txt -wrap word ttk::scrollbar $frm.hsb -orient horizontal -command [list $frm.t xview] ttk::scrollbar $frm.vsb -orient vertical -command [list $frm.t yview] text $frm.t -xscrollcommand [list $frm.hsb set] -yscrollcommand [list $frm.vsb set] - grid $frm.t -row 0 -column 0 -sticky nsew - grid $frm.vsb -row 0 -column 1 -sticky nsew - grid $frm.hsb -row 1 -column 0 -sticky nsew + grid $frm.lbl_version -row 0 -column 0 -sticky nsew -padx 5 -pady 2 + grid $frm.lbl_release -row 1 -column 0 -sticky nsew -padx 5 -pady 2 + grid $frm.t -row 2 -column 0 -sticky nsew + grid $frm.vsb -row 2 -column 1 -sticky nsew + grid $frm.hsb -row 3 -column 0 -sticky nsew grid columnconfigure $frm 0 -weight 1 grid rowconfigure $frm 0 -weight 1 @@ -2577,24 +2582,3 @@ proc Del::app {tree host profile_name} { proc Del::inet {tree host profile_name} { Del::acl $host inet [GetWorkTreeItems "name"] $profile_name } - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/gui.tcl b/lib/gui.tcl index 6fcacc0..a1a1200 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -123,4 +123,3 @@ pack $frm_tree $frm_work -side left -expand true -fill both .panel add $frm_tree -weight 1 .panel add $frm_work -weight 1 - diff --git a/lib/msg/ru.msg b/lib/msg/ru.msg index e086a05..d9567d8 100644 --- a/lib/msg/ru.msg +++ b/lib/msg/ru.msg @@ -146,3 +146,5 @@ ::msgcat::mcset ru "Connected at" "Подключено в" ::msgcat::mcset ru "Session number" "Номер сессии" ::msgcat::mcset ru "About" "О программе" +::msgcat::mcset ru "Version" "Версия" +::msgcat::mcset ru "Release" "Выпуск" diff --git a/rac_gui.tcl b/rac_gui.tcl index 89a2243..6c184ff 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -15,6 +15,19 @@ exec wish "$0" -- "$@" # ###################################################### + +# определим текущую версию и релиз +set f [open $argv0 "RDONLY"] +while {[gets $f line] >=0} { + if [regexp -nocase -all -- {version: ([0-9]+?.[0-9]+?.[0-9]+?)} $line match v1] { + set racgui_version $v1 + } + if [regexp -nocase -all -- {release: ([0-9]+?)} $line match v1] { + set racgui_release $v1 + } +} +close $f + package require msgcat # Устанавливаем текущий каталог @@ -112,5 +125,3 @@ if [file exists [file join $dir(work) 1c_srv_new.cfg]] { set servers_list "" } - - From 913a7348172ab35272ba808dd563a4ad1e589200 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 25 Sep 2019 15:07:59 +0300 Subject: [PATCH 25/25] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=BE=D0=B2.=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80=D0=B0=20=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=B5=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0=20=D0=98=D0=91=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D1=81=D1=82=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1c_srv_new.cfg | 53 ++++++++++++++++++++---------------------------- debian/changelog | 18 +++++++++++++--- debian/docs | 1 + lib/config.tcl | 30 ++++++--------------------- lib/function.tcl | 26 ++++++++++++++++++------ rac_gui.spec | 10 ++++++++- 6 files changed, 73 insertions(+), 65 deletions(-) diff --git a/1c_srv_new.cfg b/1c_srv_new.cfg index a445e5a..dbca3c2 100644 --- a/1c_srv_new.cfg +++ b/1c_srv_new.cfg @@ -1,49 +1,40 @@ localhost:1545 { name "Локальный сервер" - rac_cmd "/opt/1C/v8.3/x86_64/rac" - agent_user "" - agent_pwd "" + rac_cmd "/opt/1C/v8.3/x86_64/rac" + agent_user "" + agent_pwd "" clusters { 3ed9081a-c5b0-11e9-cf8a-1c1b0d94027e { - cluster_name "eeee" - cluster_user "" - cluster_pwd "" - } + cluster_name "eeee" + cluster_user "" + cluster_pwd "" + } 4581a966-a6bf-11e9-3c95-1c1b0d94027e { cluster_name "Локальный кластер" - cluster_user "" - cluster_pwd "" + cluster_user "" + cluster_pwd "" infobases { 1e1d1cea-b856-11e9-748a-1c1b0d94027e { - infobase_name "wewe" - infobase_user "ibuser" - infobase_pwd "ibpwd" + infobase_name "wewe" + infobase_user "ibuser" + infobase_pwd "ibpwd" } - 0129b2b2-b8d6-11e9-748a-1c1b0d94027e { - infobase_name "testdb" - infobase_user "testdb2-user" - infobase_pwd "testdb2-pwd" - } - cac80302-b855-11e9-748a-1c1b0d94027e { - infobase_name "testdb" + 0129b2b2-b8d6-11e9-748a-1c1b0d94027e { + infobase_name "testdb" + infobase_user "testdb2-user" + infobase_pwd "testdb2-pwd" } + cac80302-b855-11e9-748a-1c1b0d94027e { + infobase_name "testdb" } } } } -192.168.52.45:1545 { +} + 192.168.5.145:1545 { name "1C test" - rac_cmd "/opt/1C/v8.3/x86_64/rac" + rac_cmd "/opt/1C/v8.3/x86_64/rac" clusters { - } + } -1csrv:1545 { - name "1C SRV" - rac_cmd "/opt/1C/v8.3.13_1644/x86_64/rac" - clusters { - } } - - - - diff --git a/debian/changelog b/debian/changelog index 38db2dc..7367b9a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,20 @@ +rac-gui (1.1.0-1) stable; urgency=medium + +* Added new rac command options +* Added HELP dialog +* Moved configuration files according to XDG standard +* Change 1c-srv.cfg format +* Fixed some errors +* Added translated method for table headers + +-- Sergey Kalinin Wed, 25 Sep 2019 09:00:31 +0300 + rac-gui (1.0.3-1) stable; urgency=medium - * CI/CD integration - * New server config added +* CI/CD integration +* New server config added - -- Sergey Kalinin Thu, 15 Jul 2019 09:20:31 +0300 +-- Sergey Kalinin Thu, 15 Jul 2019 09:20:31 +0300 rac-gui (1.0.2-2) stable; urgency=medium @@ -17,3 +28,4 @@ rac-gui (1.0.1-1) stable; urgency=medium -- Sergey Kalinin Mon, 22 Jul 2019 14:56:31 +0300 + diff --git a/debian/docs b/debian/docs index eb55b93..176bd30 100644 --- a/debian/docs +++ b/debian/docs @@ -2,3 +2,4 @@ README.md doc/CHANGELOG doc/TODO doc/rac-manual.txt +doc/racgui_manual.txt \ No newline at end of file diff --git a/lib/config.tcl b/lib/config.tcl index 88e0347..7b48e78 100644 --- a/lib/config.tcl +++ b/lib/config.tcl @@ -22,7 +22,6 @@ proc GetInfobasePassword {host cluster infobase} { return [dict get $servers_list servers $host clusters $cluster infobases $infobase infobase_pwd] } } - proc GetClusterAdmin {host cluster} { global servers_list if [dict exists $servers_list servers $host clusters $cluster cluster_user] { @@ -96,32 +95,24 @@ proc SetServersConfigDict {} { # Сохраянем конфиг proc SaveConfig {} { global dir servers_list + #puts ">>>>>>>>>>> $servers_list <<<<<<<<<<<<" set file [open [file join $dir(work) 1c_srv_new.cfg] "w"] set f [open [file join $dir(work) 1c_srv_new_.cfg] "w"] if {![dict exists $servers_list servers]} { return } set dict [dict get $servers_list servers] - #puts "\n\n[split $dict " "]\n\n" set dict [string map {"\{" "\{\n" "\}" "\n\}"} $dict] regsub -- {(\})} $dict "\}\n" dict - puts "_________" - puts $servers_list - puts "2_________" - puts $dict - #ictFormatter [dict get $servers_list servers] "-" - #DictFormatter $dict "-" - #regexp -all -indices -line -- {\}(.+?)\{} $dict m - #puts " \n $m" puts $file $dict close $file - #return set file [open [file join $dir(work) 1c_srv_new.cfg] "r"] set str "" seek $file 0 set close_brace 0 set open_brace 0 + set indent "" while {[gets $file line] >=0} { if [regexp -- {\{} $line] { if {$open_brace == 0} { @@ -130,29 +121,23 @@ proc SaveConfig {} { append indent " " } incr open_brace - } + } if [regexp -- {\}} $line] { #incr open_brace -1 set indent [string range $indent 0 end-4] incr close_brace } if [regexp -nocase -all -- {(\})(.+?\{)} $line match brace phrase] { - # puts "> $v1 >>$v2" - #append indent " " set line "$brace\n$indent$phrase" - #set line [string map {"\}" "\}\n"} $line] - #regsub -- {\} } $line "\}\n$indent" line } if {$open_brace > $close_brace} { #set line "$indent$line" } if [regexp -nocase -indices -all -- {((.*?)\s(".*?"))} $line match v1 v2 v3] { - puts "> $v1 >>$v2 >>> $v3" set index [lindex [split $v3 " "] 1] - puts $index + #puts $index set last_pair [string trim [string range $line $index+1 end]] set line [GetDictFromString $line $indent] - puts ">$last_pair<" if {$last_pair ne ""} { append line "$indent[string trim $last_pair]" } @@ -168,6 +153,8 @@ proc SaveConfig {} { puts $file $line } } + #puts $file $servers_list + #file delete -force [file join $dir(work) 1c_srv_new_.cfg] #file copy -force [file join $dir(work) 1c_srv_new_.cfg] [file join $dir(work) 1c_srv_new.cfg] } @@ -225,8 +212,3 @@ proc CopyNewConfig {} { } - - - - - diff --git a/lib/function.tcl b/lib/function.tcl index 2181548..f0ac0b1 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -54,7 +54,7 @@ proc SetGlobalVarFromTreeItems {tree id} { } infobase { set infobase $values - #dict set servers_list servers $host clusters $active_cluster infobases $values + #puts [dict set servers_list servers $host clusters $active_cluster infobases $values] } profile { set profile_name $values @@ -493,7 +493,7 @@ proc Run::services {tree host values} { } proc Run::infobases {tree host values} { - global active_cluster cluster_user cluster_pwd + global active_cluster cluster_user cluster_pwd servers_list .frm_work.tree_work delete [ .frm_work.tree_work children {}] if {$cluster_user ne "" && $cluster_pwd ne ""} { set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" @@ -520,9 +520,15 @@ proc Run::infobases {tree host values} { set id [lindex $base($x) 0] if { [$tree exists "infobase::$id"] == 0 } { $tree insert "infobases::$values" end -id "infobase::$id" -text "[lindex $base($x) 1]" -values "$id" + if {![dict exists $servers_list servers $host clusters $active_cluster infobases $id]} { + dict set servers_list servers $host clusters $active_cluster \ + infobases $id "name \"[lindex $base($x) 1]\"" + } } InsertBaseItems $tree $id } + #dict update dictionaryVariable key varName ?key varName ...? body + } proc Run::infobase {tree host values} { @@ -1018,18 +1024,25 @@ proc Add::server {} { } .add.frm_btn.btn_ok configure -command { + set msg "" set server_name "[.add.frm.ent_server_name get]" set host "[.add.frm.ent_host get]:[.add.frm.ent_port get]" - set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] - - dict set servers_list servers $host "name \"$server_name\" rac_cmd $rac_cmd_for_host($host) clusters {}" + set rac_cmd_for_host($host) "[.add.frm.ent_path_to_rac get]" + if {$rac_cmd_for_host($host) eq ""} { + append msg [::msgcat::mc "Command must be"] " 'rac' " \ + [::msgcat::mc "or"] " 'rac.exe'\n" + tk_messageBox -message [::msgcat::mc $msg] -icon question -type ok + return + } + dict set servers_list servers $host "name \"$server_name\" rac_cmd \"$rac_cmd_for_host($host)\" clusters {}" #set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get] [.add.frm.ent_path_to_rac get]] #set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] #puts $servers_list .frm_tree.tree insert {} end -id "server::$host" -text "$server_name" -values "$host" destroy .add - SaveConfig + unset msg + #SaveConfig return $host } return $frm @@ -2582,3 +2595,4 @@ proc Del::app {tree host profile_name} { proc Del::inet {tree host profile_name} { Del::acl $host inet [GetWorkTreeItems "name"] $profile_name } + diff --git a/rac_gui.spec b/rac_gui.spec index 3a04474..30fde35 100644 --- a/rac_gui.spec +++ b/rac_gui.spec @@ -7,7 +7,7 @@ Group: System Url: https://bitbucket.org/svk28/rac-gui BuildArch: noarch Source: %name-%version-%release.tar.gz -Requires: tcl => 8.6.8, tk >= 8.6.8, tcllib +Requires: tcl => 8.6.8, tk >= 8.6.8 %description This program ia a grafics user interface for 1C rac util. @@ -59,6 +59,13 @@ install -p -m644 lib/msg/*.* $RPM_BUILD_ROOT%_datadir/%name/lib/msg/ %changelog +* Wed Sep 25 2019 Sergey Kalinin 1.1.0 +- Added new rac command options +- Added HELP dialog +- Moved configuration files according to XDG standard +- Change 1c-srv.cfg format +- Fixed some errors +- Added translated method for table headers * Thu Aug 15 2019 Sergey Kalinin 1.0.3 - New server config @@ -69,3 +76,4 @@ install -p -m644 lib/msg/*.* $RPM_BUILD_ROOT%_datadir/%name/lib/msg/ * Mon Aug 06 2018 Sergey Kalinin 1.0.0 - Initial release +