From 913a7348172ab35272ba808dd563a4ad1e589200 Mon Sep 17 00:00:00 2001 From: Sergey Kalinin Date: Wed, 25 Sep 2019 15:07:59 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=B0=D0=BA=D0=B5=D1=82=D0=BE=D0=B2.=20=D0=94?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=86=D0=B5=D0=B4=D1=83=D1=80=D0=B0=20=D0=B0=D0=B2=D1=82?= =?UTF-8?q?=D0=BE=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=81=D0=BD=D0=BE=D0=B2=D0=B5=20=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=98=D0=91=20=D0=BA=D0=BB=D0=B0=D1=81=D1=82?= =?UTF-8?q?=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 +