1
0
mirror of https://bitbucket.org/svk28/rac-gui synced 2024-12-04 18:46:52 +00:00

Слияние веток

This commit is contained in:
Sergey Kalinin 2019-09-30 11:02:57 +03:00
parent 7426f036fb
commit 7929538f8d
17 changed files with 965 additions and 234 deletions

40
1c_srv_new.cfg Normal file
View File

@ -0,0 +1,40 @@
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"
rac_cmd "/opt/1C/v8.3/x86_64/rac"
clusters {
}
}

View File

@ -13,3 +13,6 @@
http://nuk-svk.ru/soft/rac-gui/ http://nuk-svk.ru/soft/rac-gui/
Иконки взяты с сайта https://www.iconsdb.com/royal-blue-icons/ Иконки взяты с сайта https://www.iconsdb.com/royal-blue-icons/

12
debian/changelog vendored
View File

@ -1,3 +1,14 @@
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 rac-gui (1.0.3-1) stable; urgency=medium
* CI/CD integration * CI/CD integration
@ -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 -- Sergey Kalinin <svk@nuk-svk.ru> Mon, 22 Jul 2019 14:56:31 +0300

2
debian/control vendored
View File

@ -9,7 +9,7 @@ Vcs-Git: https://bitbucket.org/svk28/rac-gui.git
Package: rac-gui Package: rac-gui
Architecture: any 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. Description: This program is a GUI for 1C RAC util.
Rac-GUI is a graphical user interface for 1C rac (remote access controll) programm. Rac-GUI is a graphical user interface for 1C rac (remote access controll) programm.
1C RAC is a software for 1C-servers cluster management. 1C RAC is a software for 1C-servers cluster management.

1
debian/docs vendored
View File

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

View File

@ -1435,3 +1435,4 @@ rac rule [command] [options] [arguments]

91
doc/racgui_manual.txt Normal file
View File

@ -0,0 +1,91 @@
#######################################################
# 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) для соответствующей платформы.
= "Горячие" клавиши =
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 {
}
}

214
lib/config.tcl Normal file
View File

@ -0,0 +1,214 @@
#############################################
# 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 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]
}
}
# Конвертация словаря в удобочитаемый формат
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 SetServersConfigDict {} {
global servers_list
}
# Сохраянем конфиг
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]
set dict [string map {"\{" "\{\n" "\}" "\n\}"} $dict]
regsub -- {(\})} $dict "\}\n" dict
puts $file $dict
close $file
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} {
append indent ""
} else {
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] {
set line "$brace\n$indent$phrase"
}
if {$open_brace > $close_brace} {
#set line "$indent$line"
}
if [regexp -nocase -indices -all -- {((.*?)\s(".*?"))} $line match 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]
if {$last_pair ne ""} {
append line "$indent[string trim $last_pair]"
}
}
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
}
}
#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]
}
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
}
}
# Проверка установки переменных в конфиге
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]
}
}

View File

@ -7,6 +7,8 @@
########################################### ###########################################
proc Quit {} { proc Quit {} {
# Сохраняем конфиг
SaveConfig
exit exit
} }
@ -30,37 +32,45 @@ proc TreePress {tree} {
} }
proc SetGlobalVarFromTreeItems {tree id} { 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 parent [$tree parent $id]
set values [$tree item $id -values] set values [$tree item $id -values]
set key [lindex [split $id "::"] 0] set key [lindex [split $id "::"] 0]
puts "$parent $values $key"
switch -- $key { switch -- $key {
server { server {
set host $values set host $values
set orig_file [open [file join $dir(work) 1c_srv.cfg] "r"] set rac_cmd_for_host($host) [dict get $servers_list servers $host rac_cmd]
while {[gets $orig_file line] >=0 } { }
if [string match "$host*" $line] { work_server {
set path_to_rac [string trim [lindex [split $line ","] 1]] set server $values
if {$path_to_rac eq ""} { }
set rac_cmd_for_host($host) "$rac_cmd" cluster {
} else { set active_cluster $values
set rac_cmd_for_host($host) $path_to_rac #dict set servers_list servers $host clusters "$values {}"
set rac_cmd $path_to_rac set cluster_user [GetClusterAdmin $host $active_cluster]
set cluster_pwd [GetClusterPassword $host $active_cluster]
}
infobase {
set infobase $values
#puts [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]
} }
} }
}
close $orig_file
}
work_server {set server $values}
cluster {set active_cluster $values}
infobase {set infobase $values}
profile {set profile_name $values}
}
if {$parent eq ""} { if {$parent eq ""} {
return return
} else { } else {
SetGlobalVarFromTreeItems $tree $parent SetGlobalVarFromTreeItems $tree $parent
} }
} }
proc InsertItemsWorkList {lst} { proc InsertItemsWorkList {lst} {
@ -80,11 +90,29 @@ proc InsertItemsWorkList {lst} {
.frm_work.tree_work insert {} end -values $value_list -tags $tag .frm_work.tree_work insert {} end -values $value_list -tags $tag
.frm_work.tree_work column #0 -stretch .frm_work.tree_work column #0 -stretch
foreach j $column_list { 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 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} { proc RunCommand {par} {
global dir rac_cmd cluster work_list_row_count \ global dir rac_cmd cluster work_list_row_count \
agent_user agent_pwd cluster_user cluster_pwd server_platform agent_user agent_pwd cluster_user cluster_pwd server_platform
@ -118,7 +146,7 @@ proc RunCommand {par} {
} }
proc ErrorParcing {err opt} { 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 { switch -regexp -- $err {
"Cluster administrator is not authenticated" { "Cluster administrator is not authenticated" {
@ -161,7 +189,7 @@ proc ErrorParcing {err opt} {
} }
} }
proc AuthorisationDialog {txt} { 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 {}] .frm_work.tree_work delete [ .frm_work.tree_work children {}]
set frm [AddToplevel "$txt" administrator_grey_64 .auth_win] set frm [AddToplevel "$txt" administrator_grey_64 .auth_win]
@ -340,11 +368,77 @@ proc GetWorkTreeRow {} {
return $lst 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 {
#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
}
}
}
proc ShowHelpDialog {} {
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.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
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 {} {} namespace eval Run {} {}
# Получение данных по кластерам # Получение данных по кластерам
proc Run::server {tree host values} { 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 "" } { if {[info exists rac_cmd_for_host($host)] == 1 && $rac_cmd_for_host($host) ne "" } {
set rac_cmd $rac_cmd_for_host($host) set rac_cmd $rac_cmd_for_host($host)
} }
@ -369,10 +463,15 @@ proc Run::server {tree host values} {
} }
foreach x [array names cluster] { foreach x [array names cluster] {
set id [lindex $cluster($x) 0] set id [lindex $cluster($x) 0]
set cluster_name [lindex $cluster($x) 1]
if { [$tree exists "cluster::$id"] == 0 } { 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 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 } { if { [$tree exists "agent_admins::$id"] == 0 } {
$tree insert "server::$host" end -id "agent_admins::$id" -text [::msgcat::mc "Administrators"] -values "$id" $tree insert "server::$host" end -id "agent_admins::$id" -text [::msgcat::mc "Administrators"] -values "$id"
@ -396,7 +495,7 @@ proc Run::services {tree host values} {
} }
proc Run::infobases {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 {}] .frm_work.tree_work delete [ .frm_work.tree_work children {}]
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd"
@ -423,21 +522,31 @@ proc Run::infobases {tree host values} {
set id [lindex $base($x) 0] set id [lindex $base($x) 0]
if { [$tree exists "infobase::$id"] == 0 } { if { [$tree exists "infobase::$id"] == 0 } {
$tree insert "infobases::$values" end -id "infobase::$id" -text "[lindex $base($x) 1]" -values "$id" $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 InsertBaseItems $tree $id
} }
#dict update dictionaryVariable key varName ?key varName ...? body
} }
proc Run::infobase {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 ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd"
} else { } else {
set auth "" set auth ""
} }
#### Временный костыль #### #### Проверяем наличие юзера и пароля в конфиге и если есть то используем ####
if {[info exists default(infobase_user)] == 1 && [info exists default(infobase_pwd)] == 1} { set infobase_user [GetInfobaseUser $host $active_cluster $values]
set ib_auth "--infobase-user=$default(infobase_user) --infobase-pwd=$default(infobase_pwd)" 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 { } else {
set ib_auth "" set ib_auth ""
} }
@ -457,7 +566,6 @@ proc Run::List:Base {tree host values par} {
} else { } else {
set auth "" set auth ""
} }
.frm_work.tree_work delete [ .frm_work.tree_work children {}] .frm_work.tree_work delete [ .frm_work.tree_work children {}]
set lst [RunCommand "$par list --cluster=$active_cluster $auth --infobase=$values $host"] set lst [RunCommand "$par list --cluster=$active_cluster $auth --infobase=$values $host"]
@ -803,7 +911,7 @@ proc AddToplevel {lbl img {win_name .add}} {
grid $frm_btn -row 1 -column 1 -sticky sew -padx 0 -pady 0 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_cancel $frm_btn.btn_ok -side right -padx 5 -pady 5
#pack $frm_btn.btn_ok -side right -padx 2 #pack $frm_btn.btn_ok -side right -padx 2
bind .add <Escape> $cmd
return $frm return $frm
} }
@ -887,36 +995,63 @@ proc Add::admin {tree host value} {
} }
proc Add::server {} { 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] 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::label $frm.lbl_host -text [::msgcat::mc "Address"]
ttk::entry $frm.ent_host ttk::entry $frm.ent_host
ttk::label $frm.lbl_port -text [::msgcat::mc "Port"] ttk::label $frm.lbl_port -text [::msgcat::mc "Port"]
ttk::entry $frm.ent_port ttk::entry $frm.ent_port
ttk::label $frm.lbl_path_to_rac -text [::msgcat::mc "Path to RAC"] ttk::label $frm.lbl_path_to_rac -text [::msgcat::mc "Path to RAC"]
ttk::entry $frm.ent_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) $frm.ent_port insert end $default(port)
grid $frm.lbl_host -row 0 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.lbl_server_name -row 0 -column 0 -sticky nsw -padx 5 -pady 5
grid $frm.ent_host -row 0 -column 1 -sticky new -padx 5 -pady 5 grid $frm.ent_server_name -row 0 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_port -row 1 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.lbl_host -row 1 -column 0 -sticky nsw -padx 5 -pady 5
grid $frm.ent_port -row 1 -column 1 -sticky new -padx 5 -pady 5 grid $frm.ent_host -row 1 -column 1 -columnspan 2 -sticky nsew -padx 5 -pady 5
grid $frm.lbl_path_to_rac -row 2 -column 0 -sticky nw -padx 5 -pady 5 grid $frm.lbl_port -row 2 -column 0 -sticky nsw -padx 5 -pady 5
grid $frm.ent_path_to_rac -row 2 -column 1 -sticky new -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 columnconfigure $frm 0 -weight 1
grid rowconfigure $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 { .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 msg ""
set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get] set server_name "[.add.frm.ent_server_name get]"
.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" 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]"
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 destroy .add
unset msg
#SaveConfig
return $host return $host
} }
return $frm return $frm
} }
proc Add::servers {tree host values} { 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 \
servers_list
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd"
} else { } else {
@ -935,32 +1070,47 @@ proc Add::servers {tree host values} {
ttk::label $frm.lbl_agent_port -text [::msgcat::mc "Port"] ttk::label $frm.lbl_agent_port -text [::msgcat::mc "Port"]
ttk::entry $frm.ent_agent_port ttk::entry $frm.ent_agent_port
$frm.ent_agent_port insert end $default(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 ttk::entry $frm.ent_port_range
$frm.ent_port_range insert end $default(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 ttk::entry $frm.ent_safe_working_processes_memory_limit
$frm.ent_safe_working_processes_memory_limit insert end $default(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 ttk::entry $frm.ent_safe_call_memory_limit
$frm.ent_safe_call_memory_limit insert end $default(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 ttk::entry $frm.ent_memory_limit
$frm.ent_memory_limit insert end $default(ram_work) $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 ttk::entry $frm.ent_infobases_limit
$frm.ent_infobases_limit insert end $default(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 ttk::entry $frm.ent_connections_limit
$frm.ent_connections_limit insert end $default(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 ttk::entry $frm.ent_cluster_port
$frm.ent_cluster_port insert end $default(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 "Dedicate managers"]
ttk::checkbutton $frm.check_dedicate_managers -variable dedicate_managers -onvalue all -offvalue none 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::label $frm.lbl_using -text [::msgcat::mc "Working server use variant"]
ttk::checkbutton $frm.check_using -variable using -onvalue main -offvalue normal 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.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.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 grid $frm.lbl_agent_host -row 1 -column 0 -sticky nw -padx 5 -pady 5
@ -969,8 +1119,12 @@ proc Add::servers {tree host values} {
grid $frm.ent_agent_port -row 2 -column 1 -sticky new -padx 5 -pady 5 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.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.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.lbl_cluster_port -row 12 -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.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.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.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 grid $frm.lbl_memory_limit -row 6 -column 0 -sticky nw -padx 5 -pady 5
@ -979,12 +1133,20 @@ proc Add::servers {tree host values} {
grid $frm.ent_infobases_limit -row 7 -column 1 -sticky nsew -padx 5 -pady 5 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.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.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_critical_total_memory -row 9 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.lbl_dedicate_managers -row 10 -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.check_dedicate_managers -row 10 -column 1 -sticky nw -padx 5 -pady 5 grid $frm.lbl_temporary_allowed_total_memory -row 10 -column 0 -sticky nw -padx 5 -pady 5
grid $frm.lbl_using -row 11 -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.check_using -row 11 -column 1 -sticky nw -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 { .add.frm_btn.btn_ok configure -command {
RunCommand "server insert \ RunCommand "server insert \
@ -1000,6 +1162,9 @@ proc Add::servers {tree host values} {
--dedicate-managers=$dedicate_managers \ --dedicate-managers=$dedicate_managers \
--safe-working-processes-memory-limit=[.add.frm.ent_safe_working_processes_memory_limit get] \ --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] \ --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" --cluster=$active_cluster $auth $host"
Run::servers $tree $host $active_cluster Run::servers $tree $host $active_cluster
destroy .add destroy .add
@ -1127,7 +1292,7 @@ proc Add::infobases {tree host values} {
proc Add::cluster {tree host values} { proc Add::cluster {tree host values} {
global default lifetime_limit expiration_timeout session_fault_tolerance_level 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
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 agent_user agent_pwd cluster_user cluster_pwd auth_agent
if {$agent_user ne "" && $agent_pwd ne ""} { if {$agent_user ne "" && $agent_pwd ne ""} {
set auth_agent "--agent-user=$agent_user --agent-pwd=$agent_pwd" set auth_agent "--agent-user=$agent_user --agent-pwd=$agent_pwd"
@ -1143,10 +1308,12 @@ proc Add::cluster {tree host values} {
set errors_count_threshold $default(errors_count_threshold) set errors_count_threshold $default(errors_count_threshold)
set security_level [lindex $default(security_level) 0] set security_level [lindex $default(security_level) 0]
set load_balancing_mode [lindex $default(load_balancing_mode) 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] 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::entry $frm.ent_host
ttk::label $frm.lbl_port -text [::msgcat::mc "Port"] ttk::label $frm.lbl_port -text [::msgcat::mc "Port"]
ttk::entry $frm.ent_port ttk::entry $frm.ent_port
@ -1154,27 +1321,34 @@ proc Add::cluster {tree host values} {
ttk::label $frm.lbl_name -text [::msgcat::mc "Name"] ttk::label $frm.lbl_name -text [::msgcat::mc "Name"]
ttk::entry $frm.ent_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::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::entry $frm.ent_expiration_timeout -textvariable expiration_timeout
ttk::label $frm.lbl_session_fault_tolerance_level -text [::msgcat::mc "Fault-tolerance level"] ttk::label $frm.lbl_session_fault_tolerance_level \
ttk::entry $frm.ent_session_fault_tolerance_level -textvariable 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::label $frm.lbl_load_balancing_mode -text [::msgcat::mc "Load balancing mode"]
ttk::combobox $frm.cb_load_balancing_mode -textvariable load_balancing_mode \ ttk::combobox $frm.cb_load_balancing_mode -textvariable load_balancing_mode \
-values $default(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::entry $frm.ent_errors_count_threshold -textvariable errors_count_threshold
ttk::label $frm.lbl_processes -text [::msgcat::mc "Working process"] ttk::label $frm.lbl_processes -text [::msgcat::mc "Processes"]
ttk::label $frm.lbl_lifetime_limit -text [::msgcat::mc "Restart time"] ttk::label $frm.lbl_lifetime_limit -text [::msgcat::mc "Lifetime limit"]
ttk::entry $frm.ent_lifetime_limit -textvariable 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::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::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::label $frm.lbl_kill_problem_processes -justify left -anchor nw \
ttk::checkbutton $frm.check_kill_problem_processes -variable kill_problem_processes -onvalue yes -offvalue no -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.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.ent_host -row 0 -column 1 -sticky nsew -padx 5 -pady 5
@ -1182,7 +1356,7 @@ proc Add::cluster {tree host values} {
grid $frm.ent_port -row 1 -column 1 -sticky nsew -padx 5 -pady 5 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.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.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.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.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 grid $frm.ent_expiration_timeout -row 4 -column 1 -sticky nsew -padx 5 -pady 5
@ -1201,12 +1375,14 @@ 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.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.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.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 { .add.frm_btn.btn_ok configure -command {
RunCommand "cluster insert \ RunCommand "cluster insert \
--host=[.add.frm.ent_host get] \ --host=[.add.frm.ent_host get] \
--port=[.add.frm.ent_port 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 \ --expiration-timeout=$expiration_timeout \
--lifetime-limit=$lifetime_limit \ --lifetime-limit=$lifetime_limit \
--max-memory-size=$max_memory_size \ --max-memory-size=$max_memory_size \
@ -1216,6 +1392,7 @@ proc Add::cluster {tree host values} {
--load-balancing-mode=$load_balancing_mode \ --load-balancing-mode=$load_balancing_mode \
--errors-count-threshold=$errors_count_threshold \ --errors-count-threshold=$errors_count_threshold \
--kill-problem-processes=$kill_problem_processes \ --kill-problem-processes=$kill_problem_processes \
--kill-by-memory-with-dump=$kill_by_memory_with_dump \
$auth_agent $host" $auth_agent $host"
Run::server $tree $host "" Run::server $tree $host ""
destroy .add destroy .add
@ -1700,60 +1877,45 @@ proc Edit::managers {tree host values} {
} }
proc Edit::server {tree host value} { 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] set frm [Add::server]
wm title .add [::msgcat::mc "Edit record"] wm title .add [::msgcat::mc "Edit record"]
set lst [split $value ":"] set lst [split $value ":"]
set prev_address $value set prev_address $value
set orig_file [open [file join $dir(work) 1c_srv.cfg] "r"] .add.frm.ent_server_name delete 0 end
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_host delete 0 end .add.frm.ent_host delete 0 end
.add.frm.ent_port delete 0 end .add.frm.ent_port delete 0 end
.add.frm.ent_path_to_rac 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_host insert end [lindex $lst 0]
.add.frm.ent_port insert end [lindex $lst 1] .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 { .add.frm_btn.btn_ok configure -command {
set host "[.add.frm.ent_host get]:[.add.frm.ent_port get]" 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] set rac_cmd_for_host($host) [.add.frm.ent_path_to_rac get]
.frm_tree.tree delete "server::$prev_address" .frm_tree.tree delete "server::$prev_address"
.frm_work.tree_work delete [ .frm_work.tree_work children {}] .frm_work.tree_work delete [ .frm_work.tree_work children {}]
.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" .frm_tree.tree insert {} end -id "server::$host" -text "$server_name" -values "$host"
if [file exists [file join $dir(work) 1c_srv.cfg.bak]] {
file delete [file join $dir(work) 1c_srv.cfg.bak] set clusters [dict get $servers_list servers $prev_address clusters]
} dict unset servers_list servers $prev_address
file copy [file join $dir(work) 1c_srv.cfg] [file join $dir(work) 1c_srv.cfg.bak] dict set servers_list servers $host "name \"$server_name\" rac_cmd $rac_cmd_for_host($host) clusters \{$clusters\}"
set orig_file [open [file join $dir(work) 1c_srv.cfg.bak] "r"] unset clusters server_name
set file [open [file join $dir(work) 1c_srv.cfg] "w"] #puts $servers_list
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]
destroy .add destroy .add
SaveConfig
return $host return $host
} }
} }
proc Edit::cluster {tree host values} { proc Edit::cluster {tree host values} {
global default lifetime_limit expiration_timeout session_fault_tolerance_level 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 \ global load_balancing_mode kill_problem_processes active_cluster \
agent_user agent_pwd cluster_user cluster_pwd auth agent_user agent_pwd cluster_user cluster_pwd auth
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
@ -1787,6 +1949,7 @@ proc Edit::cluster {tree host values} {
--load-balancing-mode=$load_balancing_mode \ --load-balancing-mode=$load_balancing_mode \
--errors-count-threshold=$errors_count_threshold \ --errors-count-threshold=$errors_count_threshold \
--kill-problem-processes=$kill_problem_processes \ --kill-problem-processes=$kill_problem_processes \
--kill-by-memory-with-dump=$kill_by_memory_with_dump \
$auth $host" $auth $host"
$tree delete "cluster::$active_cluster" $tree delete "cluster::$active_cluster"
Run::server $tree $host "" Run::server $tree $host ""
@ -1956,6 +2119,9 @@ proc Edit::work_server {tree host values} {
--dedicate-managers=$dedicate_managers \ --dedicate-managers=$dedicate_managers \
--safe-working-processes-memory-limit=[.add.frm.ent_safe_working_processes_memory_limit get] \ --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] \ --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" --cluster=$active_cluster $auth $host"
Run::servers $tree $host $active_cluster Run::servers $tree $host $active_cluster
destroy .add destroy .add
@ -2293,6 +2459,7 @@ proc Del::sessions {tree host values} {
} }
proc Del::rule {tree host values} { proc Del::rule {tree host values} {
global active_cluster server agent_user agent_pwd cluster_user cluster_pwd auth global active_cluster server agent_user agent_pwd cluster_user cluster_pwd auth
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
@ -2317,14 +2484,20 @@ proc Del::rule {tree host values} {
no {return} no {return}
} }
} }
# Удаление основного сервера кластера
proc Del::server {tree host values} { proc Del::server {tree host values} {
global dir global dir servers_list
set answer [tk_messageBox -message "[::msgcat::mc "Delete server"] $values?" \ set answer [tk_messageBox -message "[::msgcat::mc "Delete server"] $values?" \
-icon question -type yesno ] -icon question -type yesno ]
switch -- $answer { switch -- $answer {
yes { 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 orig_file [open [file join $dir(work) 1c_srv.cfg.bak] "r"]
set file [open [file join $dir(work) 1c_srv.cfg] "w"] set file [open [file join $dir(work) 1c_srv.cfg] "w"]
while {[gets $orig_file line] >=0 } { while {[gets $orig_file line] >=0 } {
@ -2334,10 +2507,9 @@ proc Del::server {tree host values} {
} }
close $file close $file
close $orig_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] file delete [file join $dir(work) 1c_srv.cfg.bak]
#return "$host:$port"
########## Конец Удаления #############
} }
no {return} no {return}
} }
@ -2424,15 +2596,3 @@ proc Del::app {tree host profile_name} {
proc Del::inet {tree host profile_name} { proc Del::inet {tree host profile_name} {
Del::acl $host inet [GetWorkTreeItems "name"] $profile_name Del::acl $host inet [GetWorkTreeItems "name"] $profile_name
} }

View File

@ -22,13 +22,24 @@ wm protocol . WM_DELETE_WINDOW Quit
wm overrideredirect . 0 wm overrideredirect . 0
wm positionfrom . user wm positionfrom . user
bind . <Control-q> Quit
bind . <Control-Q> Quit
bind . <Control-eacute> Quit
bind . <Insert> Add
bind . <Delete> Del
bind . <Control-Return> Edit
bind . <F1> ShowHelpDialog
#ttk::style configure TPanedwindow -background blue #ttk::style configure TPanedwindow -background blue
#ttk::style configure Sash -sashthickness 5 #ttk::style configure Sash -sashthickness 5
#ttk::style configure TButton -padding 60 -relief flat -bg black #ttk::style configure TButton -padding 60 -relief flat -bg black
#ttk::style configure Custom.Treeview -foreground red #ttk::style configure Custom.Treeview -foreground red
#ttk::style configure Custom.Treeview -rowheight 20 #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] set frm_tool [ttk::frame .frm_tool]
@ -40,9 +51,10 @@ pack propagate .panel false
ttk::button $frm_tool.btn_add -command Add -image add_grey_32 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_del -command Del -image del_grey_32
ttk::button $frm_tool.btn_edit -command Edit -image edit_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 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 #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 #pack $frm_tool.lbl_logo -side bottom -padx 5 -pady 5
@ -76,8 +88,11 @@ set tree_work [
-yscrollcommand [list $frm_work.vsb set] -yscrollcommand [list $frm_work.vsb set]
] ]
# table rows background colors # table rows background colors
if {[info exists default(theme)] == 1} {
$tree_work tag configure dark -background $color(dark_table_bg) $tree_work tag configure dark -background $color(dark_table_bg)
$tree_work tag configure light -background $color(light_table_bg) $tree_work tag configure light -background $color(light_table_bg)
}
bind $tree_work <Double-ButtonPress-1> Edit bind $tree_work <Double-ButtonPress-1> Edit
$tree tag configure selected -background white -foreground black $tree tag configure selected -background white -foreground black
@ -88,6 +103,7 @@ bind $tree_work <ButtonRelease-1> {
$tree_work item [.frm_work.tree_work selection] -tags selected $tree_work item [.frm_work.tree_work selection] -tags selected
} }
#$tree_work heading par -text "Параметр" -anchor center #$tree_work heading par -text "Параметр" -anchor center
#$tree_work heading val -text "Значение" -anchor center #$tree_work heading val -text "Значение" -anchor center
#set tree_work [ttk::treeview $frm_work.tree_work \ #set tree_work [ttk::treeview $frm_work.tree_work \
@ -107,4 +123,3 @@ pack $frm_tree $frm_work -side left -expand true -fill both
.panel add $frm_tree -weight 1 .panel add $frm_tree -weight 1
.panel add $frm_work -weight 1 .panel add $frm_work -weight 1

View File

@ -621,3 +621,94 @@ image create photo app_grey_64 -data {
ZhhOnihW5Ql725851hOPesCgxn4/bfEYVJ5mwlTT7EDyT2bwR4yyTf3d6bFcLIPtYoR++ujBwUmV ZhhOnihW5Ql725851hOPesCgxn4/bfEYVJ5mwlTT7EDyT2bwR4yyTf3d6bFcLIPtYoR++ujBwUmV
mhdPl2vMUeYmt/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4NBTyf7MOJUH/zPUoAAAAAElFTkSuQmCC
}

View File

@ -27,21 +27,25 @@
::msgcat::mcset ru "OS user name" "Пользователь ОС" ::msgcat::mcset ru "OS user name" "Пользователь ОС"
::msgcat::mcset ru "Authentication method" "Способ аутентификации" ::msgcat::mcset ru "Authentication method" "Способ аутентификации"
::msgcat::mcset ru "Add record" "Добавить запись" ::msgcat::mcset ru "Add record" "Добавить запись"
::msgcat::mcset ru "Main server" "Основной сервер" ::msgcat::mcset ru "Host" "Основной сервер"
::msgcat::mcset ru "Main server address" "Адрес основного сервера" ::msgcat::mcset ru "Host address" "Адрес основного сервера"
::msgcat::mcset ru "Address" "Адрес сервера" ::msgcat::mcset ru "Address" "Адрес сервера"
::msgcat::mcset ru "Port" "Порт" ::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 "Protocol" "Протокол"
::msgcat::mcset ru "Working processes" "Рабочие процессы" ::msgcat::mcset ru "Working processes" "Рабочие процессы"
::msgcat::mcset ru "Processes" "Рабочие процессы"
::msgcat::mcset ru "Cluster managers" "Менеджеры кластера" ::msgcat::mcset ru "Cluster managers" "Менеджеры кластера"
::msgcat::mcset ru "Maximum memory in working processes" "Максимальный объём памяти раб. процессов" ::msgcat::mcset ru "Safe working processes memory limit" "Максимальный объём памяти раб. процессов"
::msgcat::mcset ru "Safe memory consuption per call" "Безопасный расход памяти за вызов" ::msgcat::mcset ru "Safe call memory limit" "Безопасный расход памяти за вызов"
::msgcat::mcset ru "Memory use limit per working process" "Предел использования памяти рабочим процессом" ::msgcat::mcset ru "Memory limit" "Предел использования памяти рабочим процессом"
::msgcat::mcset ru "Maximum number of infobases per working process" "Количество ИБ на процесс" ::msgcat::mcset ru "Infobases limit" "Количество ИБ на процесс"
::msgcat::mcset ru "Maximum nuber of connections per working process" "Количество соединений на процесс" ::msgcat::mcset ru "Connections limit" "Количество соединений на процесс"
::msgcat::mcset ru "Main cluster manager port number" "Порт главного менеджера кластера" ::msgcat::mcset ru "Сluster port" "Порт главного менеджера кластера"
::msgcat::mcset ru "Service manager allocation" "Менеджер под каждый сервис" ::msgcat::mcset ru "Dedicate managers" "Менеджер под каждый сервис"
::msgcat::mcset ru "Working server use variant" "Вариант использования рабочего сервера" ::msgcat::mcset ru "Working server use variant" "Вариант использования рабочего сервера"
::msgcat::mcset ru "Work servers" "Рабочие серверы" ::msgcat::mcset ru "Work servers" "Рабочие серверы"
::msgcat::mcset ru "Work server" "Рабочий сервер" ::msgcat::mcset ru "Work server" "Рабочий сервер"
@ -54,15 +58,16 @@
::msgcat::mcset ru "Create database" "Создать БД в случае её отсутствия" ::msgcat::mcset ru "Create database" "Создать БД в случае её отсутствия"
::msgcat::mcset ru "Sheduled jobs deny" "Блокировка регламентных заданий" ::msgcat::mcset ru "Sheduled jobs deny" "Блокировка регламентных заданий"
::msgcat::mcset ru "Date offset" "Смещение дат" ::msgcat::mcset ru "Date offset" "Смещение дат"
::msgcat::mcset ru "Secure level" "Безопасное соединение" ::msgcat::mcset ru "Security level" "Безопасное соединение"
::msgcat::mcset ru "Forced termination time" "Останавливать выключенные процессы через:" ::msgcat::mcset ru "Expiration timeout" "Останавливать выключенные процессы через:"
::msgcat::mcset ru "Fault-tolerance level" "Уровень отказоустойчивости" ::msgcat::mcset ru "Session fault tolerance level" "Уровень отказоустойчивости"
::msgcat::mcset ru "Load balancing mode" "Режим распределения нагрузки" ::msgcat::mcset ru "Load balancing mode" "Режим распределения нагрузки"
::msgcat::mcset ru "Server errors threshold" "Допустимое отклонение количества ошибок сервера, %" ::msgcat::mcset ru "Errors count threshold" "Допустимое отклонение количества ошибок сервера, %"
::msgcat::mcset ru "Restart time" "Период перезапуска, сек." ::msgcat::mcset ru "Lifetime limit" "Период перезапуска, сек."
::msgcat::mcset ru "Maximum virtual address space" "Допустимый объём памяти, КБ" ::msgcat::mcset ru "Max memory size" "Допустимый объём памяти, КБ"
::msgcat::mcset ru "Maximum period of memori size exeeding" "Интервал превышения допустимого объёма памяти, сек." ::msgcat::mcset ru "Max memory time limit" "Интервал превышения допустимого объёма памяти, сек."
::msgcat::mcset ru "Terminate corrupted processes" "Принудительно завершать проблемные процессы" ::msgcat::mcset ru "Kill problem processes" "Принудительно завершать проблемные процессы"
::msgcat::mcset ru "Kill by memory with dump" "Формировать дамп процесса при превышении объема памяти"
::msgcat::mcset ru "Object type" "Объект требования" ::msgcat::mcset ru "Object type" "Объект требования"
::msgcat::mcset ru "Rule type" "Тип требования" ::msgcat::mcset ru "Rule type" "Тип требования"
::msgcat::mcset ru "Application with an ajustment" "Значение доп. параметра" ::msgcat::mcset ru "Application with an ajustment" "Значение доп. параметра"
@ -112,3 +117,34 @@
::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов" ::msgcat::mcset ru "Session lock mode management" "Режим блокировки сеансов"
::msgcat::mcset ru "External session management required" "Внешнее управление сеансами" ::msgcat::mcset ru "External session management required" "Внешнее управление сеансами"
::msgcat::mcset ru "Path to RAC" "Путь до RAC" ::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" "Сервер"
::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." "Скопирать новый файл настроек из дистрибутива программы?"
::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?" "это правильно?"
::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" "Номер сессии"
::msgcat::mcset ru "About" "О программе"
::msgcat::mcset ru "Version" "Версия"
::msgcat::mcset ru "Release" "Выпуск"

40
lib/theme.tcl Normal file
View File

@ -0,0 +1,40 @@
######################################################
# 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
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"
}

View File

@ -91,11 +91,18 @@ namespace eval ttk::theme::dark {
-background $colors(-lightframe) -itembackground {gray60 gray50} \ -background $colors(-lightframe) -itembackground {gray60 gray50} \
-itemfill #ffffff -itemaccentfill yellow \ -itemfill #ffffff -itemaccentfill yellow \
-fieldbackground $colors(-lightframe) -fieldbackground $colors(-lightframe)
ttk::style configure Text \
-background [list active $colors(-lighter)] \
-foreground [list disabled $colors(-disabledfg)]
# ttk::style configure TreeCtrl \ # ttk::style configure TreeCtrl \
# -background gray30 -itembackground {gray60 gray50} \ # -background gray30 -itembackground {gray60 gray50} \
# -itemfill #ffffff -itemaccentfill yellow # -itemfill #ffffff -itemaccentfill yellow
}
option add *Toplevel.Background $colors(-dark) interactive option add *Toplevel.Background $colors(-dark) interactive
option add *Text.Foreground $colors(-foreground) interactive
option add *Text.Background $colors(-frame) interactive
}
#option add *Treeview.Background red interactive #option add *Treeview.Background red interactive
# option add *Frame.Background $colors(-frame) interactive # option add *Frame.Background $colors(-frame) interactive
# option add *Label.Background $colors(-frame) interactive # option add *Label.Background $colors(-frame) interactive
@ -139,3 +146,5 @@ namespace eval ::tablelist:: {

View File

@ -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" set default(locale) "ru"
# Порт RAS # Порт RAS
@ -108,24 +108,25 @@ set default(load_balancing_mode) {
memory memory
} }
set default(auth) { set default(auth) {
pwd pwd
os os
} }
# максимальный объем памяти процессов рабочего сервера
set default(critical_total_memory) 0
# допустимый объем памяти процессов рабочего сервера <bytes>
set default(temporary_allowed_total_memory) 0
# предел превышения (секунд) допустимого объема памяти процессов <seconds>
set default(temporary_allowed_total_memory_time_limit) 300
## Раскоментировать строки и прописать свои значения если ## Раскоментировать строки и прописать свои значения если
## для Информационных Баз используются эти параметры ## для Информационных Баз используются эти параметры
#set default(infobase_user) "ib_user" #set default(infobase_user) "ib_user"
#set default(infobase_pwd) "ib_password" #set default(infobase_pwd) "ib_password"
# цвета строк в таблице # Используемая тема
#set color(dark_table_bg) "#e2e2e2" # доступны: dark, clam, classic, default, alt
#set color(light_table_bg) "#ffffff" set default(theme) dark
set color(dark_table_bg) "#6f6f6f"
set color(light_table_bg) "#424242"

View File

@ -59,6 +59,13 @@ install -p -m644 lib/msg/*.* $RPM_BUILD_ROOT%_datadir/%name/lib/msg/
%changelog %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 * Thu Aug 15 2019 Sergey Kalinin <svk@nuk-svk.ru> 1.0.3
- New server config - New server config

View File

@ -2,69 +2,83 @@
# Tcl ignores the next line -*- tcl -*- \ # Tcl ignores the next line -*- tcl -*- \
exec wish "$0" -- "$@" exec wish "$0" -- "$@"
package require msgcat
###################################################### ######################################################
# Rac GUI # Rac GUI
# 1C RAC (tm) grafical user interface
# Distributed under GNU Public License # Distributed under GNU Public License
# 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://nuk-svk.ru
# Git repos: https://bitbucket.org/svk28/rac-gui
# #
# version: 1.0.3 # version: 1.1.0
# release: 1 # release: 1
# #
###################################################### ######################################################
# определим текущую версию и релиз
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
# Устанавливаем текущий каталог # Устанавливаем текущий каталог
set dir(root) [pwd] set dir(root) [pwd]
# Устанавливаем рабочий каталог, если его нет то создаём set dir(doc) [file join $dir(root) doc]
# Устанавливаем рабочий каталог, если его нет то создаём.
# Согласно спецификации 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] set dir(work) [file join $env(HOME) .rac_gui]
}
if {[file exists $dir(work)] == 0} { if {[file exists $dir(work)] == 0} {
file mkdir $dir(work) 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]
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)"
# каталог с модулями # каталог с модулями
set dir(lib) "[file join $dir(root) lib]" set dir(lib) "[file join $dir(root) lib]"
# загружаем пользовательский конфиг, если он отсутствует, то копируем дефолтный # загружаем пользовательский конфиг, если он отсутствует, то копируем дефолтный
if {[file exists [file join $dir(work) rac_gui.cfg]] ==0} { 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] source [file join $dir(work) rac_gui.cfg]
::msgcat::mclocale $default(locale) ::msgcat::mclocale $default(locale)
::msgcat::mcload [file join $dir(lib) msg] ::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_user ""
set cluster_pwd "" set cluster_pwd ""
@ -81,36 +95,32 @@ foreach modFile [lsort [glob -nocomplain [file join $dir(lib) *.tcl]]] {
source [file join $dir(lib) gui.tcl] source [file join $dir(lib) gui.tcl]
source [file join $dir(work) rac_gui.cfg] source [file join $dir(work) rac_gui.cfg]
CheckVariablesSet
# Читаем файл со списком серверов 1С # Читаем файл со списком серверов 1С
if [file exists [file join $dir(work) 1c_srv.cfg]] { #set serversList [dict create servers]
set f [open [file join $dir(work) 1c_srv.cfg] "RDONLY"] if [file exists [file join $dir(work) 1c_srv_new.cfg]] {
while {[gets $f line] >=0} { set f_new [open [file join $dir(work) 1c_srv_new.cfg] "RDONLY"]
set l [split $line ","] set str ""
set host [lindex $l 0] while {[gets $f_new line] >=0} {
if {[lindex $l 1] ne ""} { append str " [string trim $line]"
set rac_cmd_for_host($host) [lindex $l 1]
} }
.frm_tree.tree insert {} end -id "server::$host" -text "$host" -values "$host" 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"
puts "$host > $host_data"
puts [dict get $host_data name]
set rac_cmd_for_host($host) [dict get $host_data rac_cmd]
} }
} else {
set servers_list ""
}
} else {
set servers_list ""
} }
# 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