- Добавлены процедуры работы (добавления, удаления) с кластером (базой, сервера)

This commit is contained in:
Sergey Kalinin 2018-05-20 18:03:02 +03:00
parent 0fc0ce77e6
commit 63075d99ca
7 changed files with 323 additions and 20 deletions

View File

@ -1,12 +0,0 @@
######################################################
# 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
######################################################
set host localhost
set port 1541

View File

@ -4,6 +4,9 @@
# Author: Sergey Kalinin svk@nuk-svk.ru # Author: Sergey Kalinin svk@nuk-svk.ru
# Home page: https://bitbucket.org/svk28/rac-gui # Home page: https://bitbucket.org/svk28/rac-gui
###################################################### ######################################################
20/05/2018
- Добавлены процедуры работы (добавления, удаления) с кластером (базой, сервера)
- Добавлен диалог добавления базы
15/05/2018 15/05/2018
- Добавлен вывод списка кластеров, серверов, баз и т.д - Добавлен вывод списка кластеров, серверов, баз и т.д
@ -12,3 +15,4 @@
16/05/2018 16/05/2018
- Beginning the project - Beginning the project

View File

@ -13,9 +13,13 @@ proc Quit {} {
proc TreePress {tree} { proc TreePress {tree} {
global host global host
set id [$tree selection] set id [$tree selection]
set values [$tree item [$tree selection] -values] set values [$tree item [$tree selection] -values]
set key [lindex [split $id "::"] 0] set key [lindex [split $id "::"] 0]
if {$key eq "server"} {
set host $values
}
Run::$key $tree $host $values Run::$key $tree $host $values
#RunCommand $root "infobase summary list --cluster=$cluster $host" #RunCommand $root "infobase summary list --cluster=$cluster $host"
} }
@ -259,29 +263,113 @@ proc Del {} {
namespace eval Del {} { namespace eval Del {} {
proc work_server {tree host values} { proc work_server {tree host values} {
global active_cluster global active_cluster
.frm_work.tree_work delete [ .frm_work.tree_work children {}]
set answer [tk_messageBox -message "Удалить рабочий сервер $values?" \ set answer [tk_messageBox -message "Удалить рабочий сервер $values?" \
-icon question -type yesno ] -icon question -type yesno ]
switch -- $answer { switch -- $answer {
yes { yes {
set lst [RunCommand infobase::$values "server remove --cluster=$active_cluster --server=$values $host"] set lst [RunCommand infobase::$values "server remove --cluster=$active_cluster --server=$values $host"]
$tree delete "work_server::$values" $tree delete "work_server::$values"
.frm_work.tree_work delete [ .frm_work.tree_work children {}]
} }
no {return} no {return}
} }
} }
proc cluster {tree host values} {
set answer [tk_messageBox -message "Удалить кластер $values?" \
-icon question -type yesno ]
switch -- $answer {
yes {
set lst [RunCommand infobase::$values "cluster remove --cluster=$values $host"]
$tree delete "cluster::$values"
.frm_work.tree_work delete [ .frm_work.tree_work children {}]
}
no {return}
}
}
proc infobase {tree host values} {
global active_cluster
set answer [tk_messageBox -message "Удалить информационную базу $values?" \
-icon question -type yesno ]
switch -- $answer {
yes {
set lst [RunCommand infobase::$values "infobase drop --infobase=$values --cluster=$active_cluster $host"]
$tree delete "infobase::$values"
.frm_work.tree_work delete [ .frm_work.tree_work children {}]
}
no {return}
}
}
proc server {tree host values} {
global dir
set answer [tk_messageBox -message "Удалить сервер $values?" \
-icon question -type yesno ]
switch -- $answer {
yes {
#set lst [RunCommand infobase::$values "cluster remove --cluster=$values $host"]
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 } {
puts $line
if { $line ne "" && $line ne "$values"} {
puts $file $line
}
}
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]
}
no {return}
}
}
} }
proc Add {} { proc Add {} {
global active_cluster host global active_cluster host
set id [.frm_tree.tree selection] set id [.frm_tree.tree selection]
set values [.frm_tree.tree item [.frm_tree.tree selection] -values] set values [.frm_tree.tree item [.frm_tree.tree selection] -values]
set key [lindex [split $id "::"] 0] set key [lindex [split $id "::"] 0]
if {$key eq "" || $key eq "server"} {
set host [ Add::server ]
}
puts "$key, $id , $values" puts "$key, $id , $values"
Add::$key .frm_tree.tree $host $values Add::$key .frm_tree.tree $host $values
} }
namespace eval Add {} { namespace eval Add {} {
proc server {} { proc server {} {
global default
toplevel .add
set frm [ttk::labelframe .add.frm -text "Добавление основного сервера" -labelanchor nw]
label $frm.lbl_host -text "Адрес сервера"
entry $frm.ent_host
label $frm.lbl_port -text "Порт"
entry $frm.ent_port
$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 nsew -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 nsew -padx 5 -pady 5
#grid $frm.btn_ok -row 2 -column 1 -sticky nw -padx 5 -pady 5
#grid $frm.btn_cancel -row 2 -column 1 -sticky se -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]
ttk::button $frm_btn.btn_ok -image add_grey_24 -command {
set host [SaveMainServer [.add.frm.ent_host get] [.add.frm.ent_port get]]
.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host"
destroy .add
return $host
}
ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24
pack $frm $frm_btn -padx 5 -pady 5 -expand true -fill x
pack $frm_btn.btn_cancel -side right
pack $frm_btn.btn_ok -side right -padx 10
puts $host
} }
proc work_server {tree host values} { proc work_server {tree host values} {
} }
@ -289,7 +377,129 @@ namespace eval Add {} {
Add::infobases $tree $host $values Add::infobases $tree $host $values
} }
proc infobases {tree host values} { proc infobases {tree host values} {
puts "$tree $host $values" global default active_cluster
toplevel .add
wm title .add "Добавление информационной базы"
ttk::label .add.lbl -image add_database_grey_64
set frm [ttk::labelframe .add.frm -text "Добавление информационной базы" -labelanchor nw]
label $frm.lbl_host -text "Адрес сервера баз даннных"
entry $frm.ent_host
label $frm.lbl_db_user -text "Имя пользователя базы даннных"
entry $frm.ent_db_user
label $frm.lbl_db_pass -text "Пароль"
entry $frm.ent_db_pass
#$frm.ent_host insert end $host
label $frm.lbl_locale -text "Язык базы данных"
entry $frm.ent_locale
$frm.ent_locale insert end $default(locale)
label $frm.lbl_infobase_name -text "Имя информационной базы"
entry $frm.ent_infobase_name
label $frm.lbl_base_name -text "Имя базы данных"
entry $frm.ent_base_name
label $frm.lbl_base_type -text "Тип СУБД"
set combo [ttk::combobox $frm.cb_base_type -textvariable dbms -values $default(dbms)]]
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
grid $frm.lbl_db_user -row 1 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_db_user -row 1 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_db_pass -row 2 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_db_pass -row 2 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_locale -row 3 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_locale -row 3 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_infobase_name -row 4 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_infobase_name -row 4 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_base_name -row 5 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_base_name -row 5 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_base_type -row 6 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.cb_base_type -row 6 -column 1 -sticky nsew -padx 5 -pady 5
# grid $frm.lbl_host $frm.ent_host -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_db_user $frm.ent_db_user -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_db_pass $frm.ent_db_pass -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_locale $frm.ent_locale -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_infobase_name $frm.ent_infobase_name -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_base_name $frm.ent_base_name -sticky nwse -padx 5 -pady 5
# grid $frm.lbl_base_type $frm.cb_base_type -sticky nwse -padx 5 -pady 5
#
grid columnconfigure $frm 0 -weight 1
grid rowconfigure $frm 0 -weight 1
set active_cluster $values
set frm_btn [frame .add.frm_btn -border 0]
ttk::button $frm_btn.btn_ok -image add_grey_24 -command {
#puts [RunCommand "" "cluster insert --host=[.add.frm.ent_host get] --port=[.add.frm.ent_port get] --name=[.add.frm.ent_cluster_name get] $host"]
RunCommand "" "infobase create --create-database \
--name=[.add.frm.ent_infobase_name get] \
--dbms=$dbms \
--db-server=[.add.frm.ent_host get] \
--db-name=[.add.frm.ent_base_name get] \
--locale=[.add.frm.ent_locale get] \
--db-user=[.add.frm.ent_db_user get] \
--db-pwd=[.add.frm.ent_db_pass get] \
--cluster=$active_cluster $host"
#SaveCluster [.add.frm.ent_host get] [.add.frm.ent_port get]]
#.frm_tree.tree insert "server::$host" end -id "er::$host" -text "$host" -values "$host"
destroy .add
#return $host
} }
ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24
grid .add.lbl -row 0 -column 0 -sticky nw -padx 5 -pady 10
grid $frm -row 0 -column 1 -sticky nw -padx 5 -pady 5
grid $frm_btn -row 1 -column 1 -sticky se -padx 5 -pady 5
# pack .add.lbl -side left
# pack $frm -padx 5 -pady 5 -expand true -fill x -side left
# pack $frm_btn -padx 5 -pady 5 -expand true -fill x
pack $frm_btn.btn_cancel -side right
pack $frm_btn.btn_ok -side right -padx 10
} }
proc cluster {tree host values} {
global default
toplevel .add
set frm [ttk::labelframe .add.frm -text "Добавление кластера" -labelanchor nw]
label $frm.lbl_host -text "Адрес основного сервера"
entry $frm.ent_host
#$frm.ent_host insert end $host
label $frm.lbl_port -text "Порт"
entry $frm.ent_port
$frm.ent_port insert end $default(port)
label $frm.lbl_cluster_name -text "Название кластера"
entry $frm.ent_cluster_name
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
grid $frm.lbl_port -row 1 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_port -row 1 -column 1 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_cluster_name -row 2 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.ent_cluster_name -row 2 -column 1 -sticky nsew -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]
ttk::button $frm_btn.btn_ok -image add_grey_24 -command {
puts [RunCommand "" "cluster insert --host=[.add.frm.ent_host get] --port=[.add.frm.ent_port get] --name=[.add.frm.ent_cluster_name get] $host"]
#SaveCluster [.add.frm.ent_host get] [.add.frm.ent_port get]]
#.frm_tree.tree insert "server::$host" end -id "er::$host" -text "$host" -values "$host"
destroy .add
#return $host
}
ttk::button $frm_btn.btn_cancel -command {destroy .add} -image quit_grey_24
pack $frm $frm_btn -padx 5 -pady 5 -expand true -fill x
pack $frm_btn.btn_cancel -side right
pack $frm_btn.btn_ok -side right -padx 10
puts $host
}
}
proc SaveMainServer {host port} {
global dir
set file [open [file join $dir(work) 1c_srv.cfg] "a+"]
puts $file "$host:$port"
close $file
return "$host:$port"
}

View File

@ -95,3 +95,5 @@ pack $frm_tree $frm_work -side left -expand true -fill both

View File

@ -149,4 +149,80 @@ image create photo quit_grey_24 -data {
Ncqh5U/vo0wfUOc7rtiCsE5F7CEHzNuEpkLrEYihRyc5zBa7Y8RgURftlK6GjVdjNUj9jLCXHRQN Ncqh5U/vo0wfUOc7rtiCsE5F7CEHzNuEpkLrEYihRyc5zBa7Y8RgURftlK6GjVdjNUj9jLCXHRQN
Ve03VewLZaEJ8x+41wfP/ZumbAAAAABJRU5ErkJggg== Ve03VewLZaEJ8x+41wfP/ZumbAAAAABJRU5ErkJggg==
} }
image create photo add-database-64 -data {
iVBORw0K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9eD5uCJZmWUb3O13QdNC7i5OPgJQPPHrOLq
Wdl3vKXjLHcPfm3z5VRq6GAdrVnl/jDF4mg6ImVZf32a5CYdi9UHbNfWRRMtXE8dCzOa2gB7tDMR
Fb9Dy5ziR7lNxxIFiqysVzmVVFKCCzcGJhGCTBHgAv5Ucy1OdvLTDJmUyZ/YPDOmiAJA6tjOeku9
P8QOHUgr0RQGUk4HbTTEtD/Eafo5oLOq8v8Hsjgpyl4aWQUAAAAASUVORK5CYII=
}

View File

@ -5,6 +5,7 @@
# Copyright (c) "http://nuk-svk.ru", 2018, # Copyright (c) "http://nuk-svk.ru", 2018,
# https://bitbucket.org/svk28/rac-gui # https://bitbucket.org/svk28/rac-gui
###################################################### ######################################################
set locale "ru"
set rac_cmd "/opt/1C/v8.3/x86_64/rac" set rac_cmd "/opt/1C/v8.3/x86_64/rac"
set default(locale) "ru"
set default(port) 1545 set default(port) 1545
set default(dbms) [list MSSQLServer PostgreSQL IBMDB2 OracleDatabase]

View File

@ -9,11 +9,21 @@ exec wish "$0" -- "$@"
# Home page: https://bitbucket.org/svk28/rac-gui # Home page: https://bitbucket.org/svk28/rac-gui
###################################################### ######################################################
source [file join [pwd] rac_gui.cfg] #source [file join [pwd] 1c_srv.cfg]
source [file join [pwd] 1c_srv.cfg]
set dir(root) [pwd] set dir(root) [pwd]
set dir(work) [file join $env(HOME) .rac_gui]
if {[file exists $dir(work)] == 0 } {
file mkdir $dir(work)
}
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]
}
source [file join $dir(work) rac_gui.cfg]
set dir(msg) "[file join $dir(root) msgs]" set dir(msg) "[file join $dir(root) msgs]"
set dir(lib) "[file join $dir(root) lib]" set dir(lib) "[file join $dir(root) lib]"
@ -38,9 +48,21 @@ foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
source [file join $dir(lib) gui.tcl] source [file join $dir(lib) gui.tcl]
puts "$rac_cmd $dir(lib)" puts "$rac_cmd $dir(lib)"
.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host:$port" source [file join $dir(work) rac_gui.cfg]
if [file exists [file join $dir(work) 1c_srv.cfg]] {
set f [open [file join $dir(work) 1c_srv.cfg] "RDONLY"]
while {[gets $f line] >=0} {
#puts $line
.frm_tree.tree insert {} end -id "server::$line" -text "$line" -values "$line"
}
} else {
#Add::main_server
}
#.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host:$port"
#.frm_tree.tree insert {} end -id "$host" -text "$host" -values "$host" #.frm_tree.tree insert {} end -id "$host" -text "$host" -values "$host"
#RunCommand $host "cluster list $host $port" #RunCommand $host "cluster list $host $port"