diff --git a/debian/control b/debian/control index 14c33fc..5cc9022 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Maintainer: Sergey Kalinin svk@nuk-svk.ru Build-Depends: debhelper Standards-Version: 3.9.6 Homepage: https://nuk-svk.ru -#Vcs-Browser: https://salsa.debian.org/debian/rac-gui-1.0.1 Vcs-Git: https://bitbucket.org/svk28/rac-gui.git Package: rac-gui diff --git a/debian/copyright b/debian/copyright index 068f259..34238fd 100644 --- a/debian/copyright +++ b/debian/copyright @@ -4,8 +4,8 @@ a binary .rpm package on Mon, 17 Sep 2018 12:01:34 +0300 Copyright: GPL Information from the binary package: -Name : rac_gui Relocations: (not relocatable) -Version : 1.0.1 Vendor: ALT Linux Team +Name : rac-gui Relocations: (not relocatable) +Version : 1.0.1 Vendor: SVK Release : 1 Build Date: Пн 17 сен 2018 11:49:36 Install date: (not installed) Build Host: alt-ws.localdomain Group : System Source RPM: rac_gui-1.0.1-1.src.rpm diff --git a/errors b/errors new file mode 100644 index 0000000..e69de29 diff --git a/lib/function.tcl b/lib/function.tcl index 17317d1..5457257 100644 --- a/lib/function.tcl +++ b/lib/function.tcl @@ -339,6 +339,51 @@ proc GetWorkTreeRow {} { } return $lst } + +proc JsonGet {json args} { + foreach key $args { + if {[dict exists $json $key]} { + set json [dict get $json $key] + } elseif {[string is integer $key]} { + if {$key >= 0 && $key < [llength $json]} { + set json [lindex $json $key] + } else { + error "can't get item number $key from {$json}" + } + } else { + error "can't get \"$key\": no such key in {$json}" + } + } + return $json +} + +proc CreateInfoBasesJSONfile {} { + global default dir + set info_base_json_file [file join $dir(work) infobases.lst] + set jsonStr { \ + { + "servers":[ + { "server-id": "server_id1", + "clusters": [ + {"cluster-id": "cluster_id_1", "infobases": [ + {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, + {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] + } + ] + }, + { "server-id": "server_id2", + "clusters": [ + {"cluster-id": "cluster_id_1", "infobases": [ + {"infobase-uid": "infobase_uid_1", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}, + {"infobase-uid": "infobase_uid_2", "infobase-user":"infobase_user", "infobase-pwd":"infobase_pwd"}] + } + ]} + ]} +} + + +} + namespace eval Run {} {} # Получение данных по кластерам @@ -2433,3 +2478,4 @@ proc Del::inet {tree host profile_name} { + diff --git a/rac_gui.cfg b/rac_gui.cfg index 3d6e7e4..d7b8982 100644 --- a/rac_gui.cfg +++ b/rac_gui.cfg @@ -128,3 +128,4 @@ set color(light_table_bg) "#424242" + diff --git a/rac_gui.spec b/rac_gui.spec index 5767823..aa7009c 100644 --- a/rac_gui.spec +++ b/rac_gui.spec @@ -1,4 +1,4 @@ -Name: rac_gui +Name: rac-gui Version: 1.0.2 Release: 2 Summary: 1C rac gui tool @@ -6,7 +6,7 @@ License: GPL Group: System Url: https://bitbucket.org/svk28/rac-gui BuildArch: noarch -Source: rac-gui-%version-%release.tar.gz +Source: %name-%version-%release.tar.gz Requires: tcl => 8.6.8, tk >= 8.6.8 %description diff --git a/rac_gui.tcl b/rac_gui.tcl index bce87d6..1ee51db 100755 --- a/rac_gui.tcl +++ b/rac_gui.tcl @@ -3,6 +3,8 @@ exec wish "$0" -- "$@" package require msgcat +package require json +package require json::write ###################################################### # Rac GUI @@ -10,8 +12,8 @@ package require msgcat # Author: Sergey Kalinin svk@nuk-svk.ru # Home page: https://bitbucket.org/svk28/rac-gui # -# version: 1.0.2 -# release: 3 +# version: 1.0.3 +# release: 1 # ###################################################### # Устанавливаем текущий каталог @@ -112,3 +114,5 @@ if [file exists [file join $dir(work) 1c_srv.cfg]] { # #option add *Frame.Background $editor(bg) interactive # option add *ScrollableFrame.Background $editor(bg) interactive # option add *ScrolledWindow.Background $editor(bg) interactive + +CreateInfoBasesJSONfile