Добавлены изменения в файлы для пакетов. Добавлена процедура автогенерации конфига на основе списка ИБ кластера

This commit is contained in:
Sergey Kalinin 2019-09-25 15:07:59 +03:00
parent a32447dc05
commit 913a734817
6 changed files with 73 additions and 65 deletions

View File

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

18
debian/changelog vendored
View File

@ -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 <svk@nuk-svk.ru> 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 <svk@nuk-svk.ru> Thu, 15 Jul 2019 09:20:31 +0300
-- Sergey Kalinin <svk@nuk-svk.ru> 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 <svk@nuk-svk.ru> Mon, 22 Jul 2019 14:56:31 +0300

1
debian/docs vendored
View File

@ -2,3 +2,4 @@ README.md
doc/CHANGELOG
doc/TODO
doc/rac-manual.txt
doc/racgui_manual.txt

View File

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

View File

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

View File

@ -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 <svk@nuk-svk.ru> 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 <svk@nuk-svk.ru> 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 <svk@nuk-svk.ru> 1.0.0
- Initial release