Prvni verze

This commit is contained in:
2025-05-21 21:14:32 +02:00
commit 03ff9ebc84
147 changed files with 40100 additions and 0 deletions

1149
cfgGUI/hdcDZAPIcfg.dproj Normal file

File diff suppressed because it is too large Load Diff

14
cfgGUI/hdcDZApiCfg.dpr Normal file
View File

@ -0,0 +1,14 @@
program hdcDZApiCfg;
uses
Vcl.Forms,
uMain in 'uMain.pas' {frmMain};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.

BIN
cfgGUI/hdcDZApiCfg.res Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

565
cfgGUI/uMain.dfm Normal file
View File

@ -0,0 +1,565 @@
object frmMain: TfrmMain
Left = 0
Top = 0
BorderStyle = bsDialog
Caption = ' HDC DataZone API konfig'
ClientHeight = 541
ClientWidth = 528
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
Position = poOwnerFormCenter
OnCreate = FormCreate
OnShow = FormShow
TextHeight = 15
object bntSave: TButton
Left = 194
Top = 472
Width = 120
Height = 28
Caption = 'Ulo'#382'it a ukon'#269'it'
TabOrder = 2
OnClick = bntSaveClick
end
object gbAPI: TGroupBox
Left = 14
Top = 12
Width = 503
Height = 113
Caption = ' HDC API service'
TabOrder = 0
object Label2: TLabel
Left = 25
Top = 53
Width = 48
Height = 15
Caption = 'Certifk'#225't:'
end
object Label3: TLabel
Left = 9
Top = 81
Width = 64
Height = 15
Caption = 'Priv'#225'tn'#237' kl'#237#269':'
end
object edtAPIport: TLabeledEdit
Left = 83
Top = 22
Width = 55
Height = 23
Alignment = taCenter
EditLabel.Width = 69
EditLabel.Height = 23
EditLabel.Caption = 'HTTP(s) port:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 5
NumbersOnly = True
TabOrder = 0
Text = '8080'
OnExit = edtAPIportExit
end
object cbxEncConn: TCheckBox
Left = 237
Top = 25
Width = 136
Height = 17
Caption = #352'ifrov'#225'n'#237' SQL spojen'#237
TabOrder = 5
Visible = False
end
object cbxSSL: TCheckBox
Left = 146
Top = 25
Width = 41
Height = 17
Caption = 'SSL'
TabOrder = 1
OnClick = cbxSSLClick
end
object edtSSLCert: TButtonedEdit
Left = 83
Top = 50
Width = 410
Height = 23
Images = imgList
RightButton.ImageIndex = 0
RightButton.Visible = True
TabOrder = 2
OnRightButtonClick = edtSSLCertRightButtonClick
end
object edtSSLKey: TButtonedEdit
Left = 83
Top = 78
Width = 410
Height = 23
Images = imgList
RightButton.ImageIndex = 0
RightButton.ImageName = 'box3dots'
RightButton.Visible = True
TabOrder = 3
OnRightButtonClick = edtSSLKeyRightButtonClick
end
object cbxJWTLogin: TCheckBox
Left = 236
Top = 9
Width = 122
Height = 17
Caption = 'JWT autentifikace'
TabOrder = 4
end
end
object gbSQL: TGroupBox
Left = 14
Top = 269
Width = 503
Height = 191
Caption = ' MSSQL Server / Helios '
TabOrder = 1
object Image1: TImage
Left = 467
Top = 128
Width = 24
Height = 24
Picture.Data = {
0954506E67496D61676589504E470D0A1A0A0000000D49484452000000480000
0048080600000055EDB3470000000467414D410000B18F0BFC61050000000173
52474200AECE1CE900000006624B474400FF00FF00FFA0BDA793000000097048
59730000761C0000761C01A7C278EA00000CCC4944415478DAED9B7B9455551D
C77FE7CECC55501E8625CE8BC9CC5859689659A93DF40F2D1FBD247B47AFB130
4C53A9080C9188340B593DCCACB025610F2C23A2878FC97095AD6819594128AF
3BC3E023108441EECCDCD3EF73F7BEB4EF9E73EFB9AF71C0757F6B7DC5CBD967
9FBDBFFBB77FAFBD09A42E452518E9011CEC52272846EA04C5489DA018A91314
23758262A44E508CD4098A913A4131F29C20A8ADAD853F8E545CAC98A2F893E2
E78AFDA9544F557D1FF204414E1048220C65B6FE044D8A3D8A4F289686FAA0BB
7BDBC14F905D65BE374E3141D1A178A1E230C578C55845A322ADD8A1D86B27BA
4EB15DF1A44EB62F0812924A75FBFD9EA2B84BD1EA7CF2978A8B14FDD568D1B0
126407CFA49B15672ACE50BCC24EE428C5E8982E328ADD8AA714FF51FC5DF13B
C5DA20089E08510F91A4E256C507BC77E707C1E09C306CCC2374C4096A6D6D93
C6C6BD3238380A025EAF78A7E274F812A3FED50A9AF5A8E21EC51D8AE72B6E17
A3853981CCF3148F1C3436A8BDBD4532BADE6A0F20E21D8A778B3198715A528D
3CA9D82786FC9C0C2AAE520D5B84828D3841EDEDCD4A4C4289095949BCC8C714
2F57248691986282077B9BE2F16AC9A99A206B630E579CA398A978B5189B3352
B25FD1A9F8213F468C208809C38C6A4DE238FDF939C57BC4C421D54A58CDB854
5628DEABD8530B722A1A88D51A8C2D6A3C47CC768A9A281EA8A14857D88A5E31
5B62ABC54E311A8897E343532C8E28616878BBA962BC5C4DB4A76C822C39C430
572B3E292676F1E569C55FC4C438C7453C7FC692F263459762A378B14A6B6B8B
0C0C84D2D414E009090B2E54BC5DD15E6478DF535C2A4EF4EC8419380ABCDF60
B9C4954490FD1072BC62A11DAC6F84D198358A458A931597CB50B7FE88E27A4B
CEEE818146E9EDDD52CAB7F9169A3AD37E7B94D78C50F902C5DF3C722094C53C
55F11BC5B7A44CE31D4B90430EB1CC4D8A5746342390FB86C51BC5046EBE4DFA
AD64DDEF610F87E1FEB2B7801DC7D18A95629C812B73D58BCE0BC320A45FDBB6
C112D269DB642C49572AD6959A821425C8E439811AE4F06CFBB113229AFD4331
4B07B74A07C99622493CD16B431A80FAF7245417B66C29DF3ED849E32DD1BE71
CEA37F8B090A3779DA8396AD52BCC1EBEAAF8A4F291ED4F1CAD6ADC5492A4890
212711A8B77AABFEFCBA98DCC99501C572C5B50CD2268C5FD3FFFFB4D7AE4B31
4DB1A552C369274CA4BC54F116E751BFE22AF5098BD985B994C2C9FBBE24C6CB
FAF3845416EC3E7E141B5724416D6DAD684E8E1C34E758AF094924DBE92B62B6
1782B7F9B518EF931396E75D8A07C89ABABBCB27A8B5B539ABC52A1F567C47F2
EDDA1FC578D31DFE242D49CF53CC557C5C4CBCE60ACE413529D06D178685481A
4290637320E7DB11E490697F41F17D3199B78C1A95907DFB329035D36987AB9F
D5D7D7B870F4E8818ADDAE1DCF4431D9F9A9CE23BCE134315B2EB27F67ABCD10
1392F876B1C792B7AA501F417E87AD765E59438BDBF4DD34718B1AB9F027FAEA
A063108F11137F4C71DA92309E2B8E6D285770F70D0DA1A63201DB84EDE27A4E
B6F787147B8BF5EFC46D18EBEBC454115CD9649FDD1D4552E075849CA658A298
1CC1362A7997AB92F6BDB3C444B16E627A9D6ED16B128906358495951B6CDF93
6DDFC73B8F0828A912DC570AF9A69F50BD5A40027DA398057565BD981C72350A
924AFDDF70FB0411DCFD48F11AAF0334677A7FFFD85F3435ED3AD0414BCBB192
48641775969815CE09512D71C9FD556E2D823CE2AA4BBDC7B7DABF4B97DABFAD
3CAA5DCD26D4389D895E13BCF1FB156BF991EB3770068341FBA69832852BACD6
8C44A2696926331055CD437D975B4272C2F67A93625B9504B15084082F701E6D
B5DF5A5B492C856BD790E47DFA73B19DB32B5D62B6EDD60304394115EEFAF392
BFCF09CFD58DCA2D8A4C014F11156FE0CDA809555434B7FDB25D7104173B8F30
90D72493E1FCFEFE40B76EC57D3347BC2261899F2EB1D8A4514F30F61C414C06
A3EC56E548266F507C510AA8B27D97A00D03ED46B7DF5575EEA48056AE6B9F34
A94D8D32416FD68B12F7B8892A25D7F315DDD524A38EE61330CE977CDBC9C7C9
18700C69087A8998D2E5C95E3F0C8E7DBEABD0609CE4F56EEF7DC283E95568CF
383BA6739D4704A6578889BFAACED69D5A160AC02E71EB587D8A2B1B1B839B21
888110CCB92E9F709CBACA86125C68A406E96EE8A4CB722642D9363415A14E4B
841B14DE2BA69CB1A356A50C3BFEB1F65B7ED11F5B371582A8EB4E701E50E365
DFAF884BE88AD8207EB36D9F296732B63F4E4070EBA778636202CB0DE9959F52
14F8E68BED985FE43C62A96643D043FA3F27790FB03D449EE9380D520E9BD4DE
F85E6C83182FD653BA1B6E966472BCA4D3BB0819B00BAE46FF4C8C77E9AB95F6
38E4207835CCC218E7318BD209411843DD12D9E3939CB0072FD7C9636C0B6E93
969616316150D6FB2D701E5134A3C8D5554E9CA2F25231E58C0EE7D17FC5E45B
AB6B4B0E8A9A5D031672890C2DC6FD54718912D4AAC629A4887585D72025C615
DE532CD12C12491338CECE76143331C7AB10144EF71EAB4709D5880603B5B33D
A45438AB8022DC6D62AA96AE50F843ABD6E7DC3CFFC1589FE1357CC836FC57A1
BD5F2417A37A88177AB44482B061774A7EF0C601216E7D5D8D0D3342EAB2444C
21D01526C976BE171203E70506B854F2CB15C81FC468D2A642B1502291E16C0C
8D99E53D9EA721CD5CDD86614CA870841DEC45CE2396784E1024167082526382
3AC4A42B677B8FA954742693E9E5E97432FBCD03A986CD532062B10C3D4560FB
5CA2E82D1230A23D788266E7D1E3623C62972968A5F2DE1B33A645C69BD014F7
8DAABBB566D4FC8242DFAC821C4E61A9719DEF3DC6EE121C926E65F27231E765
2E02103851E87663103C1B9EE432C5F6E89423D0742524099CE17D98A2D634C5
C602A9CA51B6EFB39C47048504A9B7547B7DC5FBD62431318F4F0E078ED86176
415E7A14447482ABFBAAE2A332F45C8B89705AD1D3DFDF24DBB76FF6DF3DC1B6
F1CFCA483809EBB3468C0198B3FC906A2179CF4DDE82FC5E4CD25C7550E89810
C6C6EE38C76BC262E0E2D19EBE82F520AFC3F1B6333FBA4456D9C96E74BD9B17
53501A75B7291AD8A598A936690DE700A68A9AB505BF92FC22FF1E4BCECA5A90
630F1DD8FE24DCA7794DC8376F16633B77C756143D928EB1244D8D68B7DA9244
F2285EF12C693F08FC7331C2775479592613EC4C24C20576E55CA94950688358
F861EB123EBC2C829C1F882913EF2CB926ED91445189920086D63F28E464E0B3
DA85067661C62389DA2FFB9998C6BFCCC049C483624E14700AEEADB0C7C40485
7FC689A552BD1593631707334146D0EC35A1968E319EA778AAEC530DEF4344D8
ACF407C568872BE4719430F10ABB3D92B06568C76552FAC5861B75C567EACA67
2AAD04B075F57D4827F0ED8CF836352E34EACB1253CF8E25C899EC91966D0CAA
7F7C824670E270ADEEF587392D728AF9AC225AC229487BCCA7C8DF3800DC5045
99046D25D8457B5F1B313F1694C220F6A8A4726D3967F310C38AA0B2474734DB
2C66659688AD21193B1072C4869164AF93F745DDD4C81E1169BB8514CBCA71EB
9326998B0E8944C036425B29BE4F8868CA027C464CB5B3640D2DF97687539A25
7D200C981CD18CBD4DE48DDDC2C6EC77B4893CED744BF099DE7BD8242E25941C
1476744C94C1C16C14423D87089CB8E924191A9AE43CE8D5419059138689B2A2
F2B2AFBFA4D383924C369C6827CAA492114D7789B9AC70BB1DDCD3F6EFD1BC3B
3D822015CDBCAD945A0F67655410D4CED01731CD3431DBEAF088E69CAE9052B0
A0BD38AE546A7B3953AEFC869918238C3A133816B22FD454EE1773A1815BA9E7
D9C1BA9E8DB88A1B6A71A55D845484800FD74DF8C14D93A805228FE3186781FD
76C577A52BBEA3680FE3F4FD805A3446F8CD52F8466BEE3619CFDD6CFDC0AD30
6C4F4F4FAF4B48839D3CED39AFE3D899EDCDF7D09E429744A91F91D72D6A6A92
543A5DD99D80AA09423090E600226B78193CC5EF5749E917399788F92703AEAD
624CDCAFC6FB758889C570DBA3A4F8CD59B495C303C28E071435A91FD5E49EB4
73479A98E9423B398AF8C52E8E6FB36DD778F11311EF0A197ADDA69010D7508B
426B28EC67EDDD885DE22C26CE5515DC2C0694F3F3D789495BFC6FDDA0219306
92412677006809C2232D93E25AC896256DC1AE919A90FAC4067D234E902B4EE0
461D896CDD75BFFF145372D8EC4ECABE4342B95286C632D46B7041D489D014AE
D351602AFB62E6C1441011F832C9AFBF60B5B82748502943090A755B065C22F8
88FD6BBC1179DF7AFB272455F52F780E2682387C240E712B851850B6DE6385AA
93E6765B08B984E17B897A2A39873F14082263764F29B8158601BFA3D22B79CF
B60C3741FE2120B605ADDAFD6C6D916A65B809C2ED933D938371699273320C74
CDDCF070CBB0FE8B43F226F5FA44C3D8937D9A28EEE302532DCFD6875B0EF97F
D43BDC52272846EA04C5489DA018A9131423758262A44E508CD4098A91FF01DF
047D51236589010000002574455874646174653A63726561746500323031382D
31322D30355431373A30303A31372B30313A3030F97D27350000002574455874
646174653A6D6F6469667900323031382D31322D30355431373A30303A31372B
30313A303088209F890000004674455874736F66747761726500496D6167654D
616769636B20362E372E382D3920323031362D30362D31362051313620687474
703A2F2F7777772E696D6167656D616769636B2E6F7267E6BF34B60000001874
4558745468756D623A3A446F63756D656E743A3A50616765730031A7FFBB2F00
000018744558745468756D623A3A496D6167653A3A68656967687400353132C0
D0505100000017744558745468756D623A3A496D6167653A3A57696474680035
31321C7C03DC00000019744558745468756D623A3A4D696D657479706500696D
6167652F706E673FB2564E00000017744558745468756D623A3A4D54696D6500
31353434303235363137856B124D00000013744558745468756D623A3A53697A
650032352E394B42428E400E1D0000003A744558745468756D623A3A55524900
66696C653A2F2F2E2F75706C6F6164732F35362F4C4975646762792F31373039
2F6579655F3131323437302E706E6724017DAC0000000049454E44AE426082}
Stretch = True
OnMouseDown = Image1MouseDown
OnMouseUp = Image1MouseUp
end
object Label1: TLabel
Left = 43
Top = 27
Width = 351
Height = 15
Caption =
'V'#253'b'#283'r adres'#225#345'e s konfigura'#269'n'#237'mi soubory (Licence.ini, Helios.ini' +
')'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = [fsBold]
ParentFont = False
end
object lblIniPath: TLabel
Left = 43
Top = 47
Width = 446
Height = 15
AutoSize = False
end
object selHeoCfg: TSpeedButton
Left = 9
Top = 22
Width = 28
Height = 23
ImageIndex = 0
ImageName = 'box3dots'
Images = imgList
OnClick = selHeoCfgClick
end
object edtServer: TLabeledEdit
Left = 73
Top = 70
Width = 162
Height = 23
EditLabel.Width = 35
EditLabel.Height = 23
EditLabel.Caption = 'Server:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 50
TabOrder = 0
Text = ''
end
object edtPort: TLabeledEdit
Left = 73
Top = 99
Width = 57
Height = 23
Alignment = taCenter
EditLabel.Width = 25
EditLabel.Height = 23
EditLabel.Caption = 'Port:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 5
NumbersOnly = True
TabOrder = 2
Text = ''
end
object edtPwd: TLabeledEdit
Left = 346
Top = 128
Width = 121
Height = 23
EditLabel.Width = 36
EditLabel.Height = 23
EditLabel.Caption = 'Heslo :'
LabelPosition = lpLeft
LabelSpacing = 10
PasswordChar = '*'
TabOrder = 1
Text = ''
end
object edtDB: TLabeledEdit
Left = 73
Top = 128
Width = 144
Height = 23
EditLabel.Width = 51
EditLabel.Height = 23
EditLabel.Caption = 'Datab'#225'ze:'
LabelPosition = lpLeft
LabelSpacing = 10
TabOrder = 3
Text = ''
OnChange = edtDBChange
end
object edtUser: TLabeledEdit
Left = 346
Top = 99
Width = 121
Height = 23
EditLabel.Width = 68
EditLabel.Height = 23
EditLabel.Caption = 'U'#382'ivatel SQL:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 50
TabOrder = 4
Text = ''
end
object edtHeoLic: TLabeledEdit
Left = 349
Top = 70
Width = 118
Height = 23
Color = clMenu
EditLabel.Width = 88
EditLabel.Height = 23
EditLabel.Caption = 'Helios licence: '
LabelPosition = lpLeft
ReadOnly = True
TabOrder = 5
Text = ''
end
object edtLicCheckURL: TLabeledEdit
Left = 88
Top = 163
Width = 407
Height = 23
EditLabel.Width = 66
EditLabel.Height = 23
EditLabel.Caption = 'Helios Store:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 200
TabOrder = 6
Text = 'https://forum.helios.eu/HeliosStoreWS/wsHeliosStore.asmx'
end
end
object btnClose: TButton
Left = 432
Top = 472
Width = 75
Height = 28
Caption = 'Konec'
TabOrder = 3
OnClick = btnCloseClick
end
object grpDZ: TGroupBox
Left = 14
Top = 135
Width = 503
Height = 123
Caption = ' ProHolding DataZone '
TabOrder = 4
object Label4: TLabel
Left = 170
Top = 63
Width = 24
Height = 15
Caption = 'min.'
end
object lblDZKlic: TLabeledEdit
Left = 99
Top = 27
Width = 390
Height = 23
Color = clMenu
EditLabel.Width = 87
EditLabel.Height = 23
EditLabel.Caption = 'DataZone kl'#237#269': '
LabelPosition = lpLeft
ReadOnly = True
TabOrder = 0
Text = ''
end
object edtDZTasksDown: TLabeledEdit
Left = 135
Top = 59
Width = 31
Height = 23
Alignment = taCenter
EditLabel.Width = 116
EditLabel.Height = 23
EditLabel.Caption = 'Interval stahov'#225'n'#237' dat:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 3
NumbersOnly = True
TabOrder = 1
Text = '0'
OnExit = edtDZTasksDownExit
end
object edtDZTasksZapis: TLabeledEdit
Left = 390
Top = 59
Width = 31
Height = 23
Alignment = taCenter
EditLabel.Width = 138
EditLabel.Height = 23
EditLabel.Caption = 'Interval z'#225'pisu do Heliosu:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 3
NumbersOnly = True
TabOrder = 2
Text = '2'
OnExit = edtDZTasksDownExit
OnKeyPress = edtDZTasksZapisKeyPress
end
object edtDZTasksURL: TLabeledEdit
Left = 52
Top = 92
Width = 443
Height = 23
EditLabel.Width = 35
EditLabel.Height = 23
EditLabel.Caption = 'Server:'
LabelPosition = lpLeft
LabelSpacing = 10
MaxLength = 200
TabOrder = 3
Text = 'http://manager.datazone.cloud/api/task/PH2'
end
object cbTypIntervalZapis: TComboBox
Left = 422
Top = 59
Width = 47
Height = 23
Style = csDropDownList
ItemIndex = 0
TabOrder = 4
Text = 'sek'
Items.Strings = (
'sek'
'min'
'hod')
end
end
object cbL: TCheckBox
Left = 14
Top = 512
Width = 176
Height = 21
Caption = 'KONTROLA LICENCE'
Checked = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clRed
Font.Height = -16
Font.Name = 'Segoe UI'
Font.Style = [fsBold]
ParentFont = False
State = cbChecked
TabOrder = 5
Visible = False
end
object lblCompname: TLabeledEdit
Left = 339
Top = 512
Width = 142
Height = 23
EditLabel.Width = 100
EditLabel.Height = 23
EditLabel.Caption = 'Compname: '
EditLabel.Font.Charset = DEFAULT_CHARSET
EditLabel.Font.Color = clWindowText
EditLabel.Font.Height = -16
EditLabel.Font.Name = 'Segoe UI'
EditLabel.Font.Style = [fsBold]
EditLabel.ParentFont = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = 'Segoe UI'
Font.Style = []
LabelPosition = lpLeft
ParentFont = False
TabOrder = 6
Text = ''
end
object imgList: TVirtualImageList
Images = <
item
CollectionIndex = 0
CollectionName = 'box3dots'
Name = 'box3dots'
end>
ImageCollection = imgColl
Left = 468
end
object imgColl: TImageCollection
Images = <
item
Name = 'box3dots'
SourceImages = <
item
Image.Data = {
89504E470D0A1A0A0000000D4948445200000020000000200800000000561125
28000000097048597300000EC400000EC401952B0E1B000001A74944415478DA
7D94A17284301086778617681D13DB39517D2750353198085445555D0D0AC50C
02198944E0A2A3E2A2A2D199BC0112834236D91CF46887FE9BFCBBD9F96EC330
7340432F243DD3CB5B038CD2821505F33BFABEBC2865F04A4BF34B7AAF4A7A01
52BB655997B8D1D76841AE26401A173AEB8ABEAC87E51A0269EDF6DF2E3FB3F0
B4BA3A85B4B2EB99165B05C09D026B04C6E55F8094E372B8F7B1184B3F21029B
E64332089839CAB731C58D09812F04A679F3E9E114013D4F51F3E67B437F1D80
3F8AC0A79A5C0C77C8C1D467006468A1A6C71410043E446C5B676D709FECE6E2
03016B4E6411781FACD64A695E555A0D75356855555C2B1F56BCFB57ED0125BD
9E01A4A40054498067297DD30E859F50F4A310428A2700818010004F22F4C6BE
201B20069224626049C2844812822D0448D1997EE80754DF1F0AD3852B9807BA
AEBBEF3E5A3C989E8567E80CEF4204C3B56D6E3AE6AF60DCB49CB721823D646E
7898C0B86EA39AF647586B1E26E4AD6CA26A1FCD5E7BC9D603976B5E56E589F2
EB05F2B75B9665B75BE6135618B1CEAE590EF7BF3FB97F03888F74FF1EBCD0E6
1BF2A67C0C7E872E530000000049454E44AE426082}
end>
end>
Left = 400
end
end

737
cfgGUI/uMain.pas Normal file
View File

@ -0,0 +1,737 @@
unit uMain;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Mask, Vcl.ExtCtrls, System.IOUtils,
System.StrUtils, Vcl.Imaging.pngimage, System.IniFiles, Winapi.ShlObj,
Xml.XmlIntf, Xml.XMLDoc,
flcCipher, System.ImageList, Vcl.ImgList, Vcl.VirtualImageList,
Vcl.BaseImageCollection, Vcl.ImageCollection, Vcl.Buttons;
const
eKey2 = '9!81Aq#cU:MCntb6';
sName = 'DBName';
sSSLKey = 'SSLKeyFile';
eKey1 = 'qe*cX!8k@4WA!gQ5';
sEncConn = 'DBEncConn';
sDZTasksIntZapisHeO = 'DZTasksIntervalZapisHeO';
sServer = 'DBServer';
pwd1 = 'L~4';
sPortS = 'DBPort';
sSSL = 'SSL';
pwd2 = 'Qe!r';
sHeliosStoreURL = 'HeliosStoreURL';
sUser = 'DBUser';
iVect2 = '3r!9q$';
sDZTaskIntZapisTypCas = 'DZTaskZapisIntervalTypCas';
sLCh = 'licCheck';
sPwd = 'DBPwd';
sDzKlic = 'DataZoneKey';
sDZTasksIntDown = 'DZTasksIntervalDownload';
sSSLCert = 'SSLCertFile';
sHeoPath = 'HEOPath';
iVect1 = 's4W*ERr9';
sCfgComp = 'confComp';
sLoginMod = 'JWTAuthMod';
sDZTasksDownURL = 'DZTasksDownloadURL';
sHeoLic = 'HEOLicence';
sPort = 'APIPort';
cfgFName = 'hdcDZAPIcfg.dat';
type
TfrmMain = class(TForm)
edtServer: TLabeledEdit;
edtPwd: TLabeledEdit;
edtPort: TLabeledEdit;
edtDB: TLabeledEdit;
edtUser: TLabeledEdit;
edtAPIport: TLabeledEdit;
bntSave: TButton;
gbAPI: TGroupBox;
gbSQL: TGroupBox;
btnClose: TButton;
Image1: TImage;
Label1: TLabel;
lblIniPath: TLabel;
cbxEncConn: TCheckBox;
cbxSSL: TCheckBox;
edtSSLCert: TButtonedEdit;
edtSSLKey: TButtonedEdit;
cbxJWTLogin: TCheckBox;
imgList: TVirtualImageList;
imgColl: TImageCollection;
Label2: TLabel;
Label3: TLabel;
selHeoCfg: TSpeedButton;
lblDZKlic: TLabeledEdit;
edtDZTasksDown: TLabeledEdit;
Label4: TLabel;
edtHeoLic: TLabeledEdit;
grpDZ: TGroupBox;
edtDZTasksZapis: TLabeledEdit;
edtDZTasksURL: TLabeledEdit;
edtLicCheckURL: TLabeledEdit;
cbL: TCheckBox;
lblCompname: TLabeledEdit;
cbTypIntervalZapis: TComboBox;
procedure FormCreate(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
procedure bntSaveClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure cbxSSLClick(Sender: TObject);
function Encrypt(const AStr: string): RawByteString;
function Decrypt(const AStr: string): RawByteString;
function ReturnEncrypted(const AStr: string): string;
function ReturnDecrypted(const AStr: string): string;
procedure edtSSLKeyRightButtonClick(Sender: TObject);
procedure edtSSLCertRightButtonClick(Sender: TObject);
procedure selHeoCfgClick(Sender: TObject);
procedure edtDBChange(Sender: TObject);
procedure edtDZTasksDownExit(Sender: TObject);
procedure edtAPIportExit(Sender: TObject);
procedure edtDZTasksZapisKeyPress(Sender: TObject; var Key: Char);
public
end;
var
frmMain: TfrmMain;
s, fleName: string;
cfgXML: IXMLDocument;
n1: IXMLNode;
dbPwd, dbUsr, apiLic, iniFPath: string;
intDown: integer;
sTemp: RawByteString;
implementation
{$R *.dfm}
uses
System.Hash;
function IsEmptyOrNull(const Value: Variant): Boolean;
begin
result := VarIsClear(Value) or VarIsEmpty(Value) or VarIsNull(Value) or (VarCompareValue(Value, Unassigned) = vrEqual);
if (not result) and VarIsStr(Value) then
result:= Value = '';
end;
function VyberAdresar(var Foldr: string; Title: string): Boolean;
var BrowseInfo: TBrowseInfo;
ItemIDList: PItemIDList;
DisplayName: array[0..MAX_PATH] of Char;
begin
Result := False;
FillChar(BrowseInfo, SizeOf(BrowseInfo), #0);
with BrowseInfo do
begin
hwndOwner := Application.Handle;
pszDisplayName := @DisplayName[0];
lpszTitle := PChar(Title);
ulFlags := BIF_RETURNONLYFSDIRS;
end;
ItemIDList := SHBrowseForFolder(BrowseInfo);
if Assigned(ItemIDList) then
if SHGetPathFromIDList(ItemIDList, DisplayName) then
begin
Foldr := DisplayName;
Result := True;
end;
end;
function StringToMemoryStream(const AString: string): TMemoryStream;
var M: TMemoryStream;
begin
M:= TMemoryStream.Create;
try
M.Size:= (Length(AString)*SizeOf(Char)) div 2;
if (M.Size>0) then
begin
HexToBin(PChar(AString), M.Memory, M.Size);
M.Position:= 0;
end;
finally
result:= M;
end;
end;
function SimpleXOR(Buffer: String; Key: integer): String;
var i, c, x: integer;
begin
for i:= 1 to Length(Buffer) do
begin
c:= integer(Buffer[i]);
x:= c xor Key;
result:= result + Char(x);
end;
end;
function TfrmMain.Encrypt(const AStr: string): RawByteString;
begin
result:= flcCipher.Encrypt(ctRC4, cmECB, cpNone, 256, RawByteString(eKey1+eKey2), RawByteString(AStr), iVect1+iVect2);
end;
function TfrmMain.Decrypt(const AStr: string): RawByteString;
begin
result:= flcCipher.Decrypt(ctRC4, cmECB, cpNone, 256, RawByteString(eKey1+eKey2), RawByteString(AStr), iVect1+iVect2);
end;
procedure TfrmMain.edtAPIportExit(Sender: TObject);
var i: integer;
begin
i:= -1;
if not(TryStrToInt(edtAPIport.Text, i)) then
i:= -1;
if (i<1) or (i>65535) then
begin
ShowMessage('Port nesmí být musí být v rozmezí 1-65535');
edtAPIport.Text:= '8080';
if (edtAPIport.CanFocus) then
edtAPIport.SetFocus;
end;
end;
procedure TfrmMain.edtDBChange(Sender: TObject);
var dbLic: string;
begin
dbLic:= edtHeoLic.Text + edtDB.Text;
dbLic:= SimpleXOR(dbLic, 57846218);
lblDZKlic.Text:= THashMD5.GetHashString(dbLic).ToUpper;
end;
procedure TfrmMain.edtDZTasksDownExit(Sender: TObject);
var i: integer;
begin
i:= -1;
if not(TryStrToInt(edtDZTasksDown.Text, i)) then
i:= -1;
if (i<0) then
begin
ShowMessage('Interval stahování nesmí být záporný.');
edtDZTasksDown.Text:= '15';
if (edtDZTasksDown.CanFocus) then
edtDZTasksDown.SetFocus;
end;
end;
procedure TfrmMain.edtDZTasksZapisKeyPress(Sender: TObject; var Key: Char);
begin
if (Key='.') or (Key=',') then
Key:= #0;
end;
procedure TfrmMain.edtSSLCertRightButtonClick(Sender: TObject);
var fod: TFileOpenDialog;
fn, initF: string;
begin
fn:= '';
fod:= TFileOpenDialog.Create(nil);
try
initF:= GetEnvironmentVariable('USERPROFILE') + System.SysUtils.PathDelim + 'Desktop';
if (edtSSLCert.Text<>'') then
if (ExtractFilePath(edtSSLCert.Text)<>'') then
if (DirectoryExists(ExtractFilePath(edtSSLCert.Text))) then
initF:= ExtractFilePath(edtSSLCert.Text);
fod.DefaultFolder:= initF;
fod.Options:= [fdoShareAware, fdoPathMustExist, fdoFileMustExist];
fod.FileTypes.Clear;
with fod.FileTypes.Add do
begin
DisplayName:= 'Soubor certifikátu';
FileMask:= 'cacert.pem';
end;
if (fod.Execute) then
fn:= fod.FileName;
finally
fod.Free;
end;
if (fn<>'') then
if (FileExists(fn)) then
edtSSLCert.Text:= fn;
end;
procedure TfrmMain.edtSSLKeyRightButtonClick(Sender: TObject);
var fod: TFileOpenDialog;
fn, initF: string;
begin
fn:= '';
fod:= TFileOpenDialog.Create(nil);
try
initF:= GetEnvironmentVariable('USERPROFILE') + System.SysUtils.PathDelim + 'Desktop';
if (edtSSLKey.Text<>'') then
if (ExtractFilePath(edtSSLKey.Text)<>'') then
if (DirectoryExists(ExtractFilePath(edtSSLKey.Text))) then
initF:= ExtractFilePath(edtSSLKey.Text);
fod.DefaultFolder:= initF;
fod.Options:= [fdoShareAware, fdoPathMustExist, fdoFileMustExist];
fod.FileTypes.Clear;
with fod.FileTypes.Add do
begin
DisplayName:= 'Soubor privátního klíče';
FileMask:= 'privkey.pem';
end;
if (fod.Execute) then
fn:= fod.FileName;
finally
fod.Free;
end;
if (fn<>'') then
if (FileExists(fn)) then
edtSSLKey.Text:= fn;
end;
function TfrmMain.ReturnEncrypted(const AStr: string): string;
var i: integer;
sTemp: RawByteString;
begin
sTemp:= Encrypt(AStr);
result:= '';
for i:=1 to Length(sTemp) do
result:= result + IntToHex(Byte(sTemp[i]));
end;
function TfrmMain.ReturnDecrypted(const AStr: string): string;
var i: integer;
sText: string;
sTemp: RawByteString;
begin
result:= '';
sTemp:= '';
sText:= AStr;
for i:=0 to (Length(sText) div 2)-1 do
sTemp:= sTemp + AnsiChar(StrToInt('$' + Copy(sText, (i*2)+1, 2)));
if (sTemp<>'') then
result:= Decrypt(sTemp);
end;
procedure TfrmMain.FormCreate (Sender: TObject);
var i: integer;
s, obsahXML: string;
t1: integer;
fs: TFileStream;
ms: TMemoryStream;
attribs: IXMLNodeList;
begin
fleName:= ExtractFileDir(Application.ExeName) + '\' + cfgFName;
cfgXML:= TXMLDocument.Create(nil);
cbL.Visible:= (FileExists('lic'));
lblCompname.Visible:= cbL.Visible;
if (cbL.Visible) then
self.Height:= self.Height + 30;
cbL.Checked:= true;
lblCompname.Text:= GetEnvironmentVariable('COMPUTERNAME');
if (FileExists(fleName)) then
try
s:= '';
try
fs:= TFileStream.Create(fleName, fmOpenRead);
if (fs.Size>0) then
begin
SetLength(s, (fs.Size div SizeOf(Char)));
fs.Read(s[Low(s)], fs.Size);
end;
s:= ReplaceStr(s, #0, '');
finally
fs.Free;
end;
if (LeftStr(s, 2)='7D') then
s:= ReturnDecrypted(s);
s:= s.Replace(#13#10,'');
if (LeftStr(s, 2)='<?') then
cfgXML.LoadFromXML(s);
cfgXML.Active:= true;
iniFPath:= '';
edtServer.Text:= '';
edtDB.Text:= '';
edtPort.Text:= '';
edtPwd.Text:= '';
edtUser.Text:= '';
edtDZTasksDown.Text:= '15';
edtHeoLic.Text:= '';
edtAPIport.Text:= '8080';
cbxSSL.Checked:= false;
edtSSLCert.Text:= '';
edtSSLCert.Enabled:= (cbxSSL.Checked);
edtSSLKey.Text:= '';
edtSSLKey.Enabled:= (cbxSSL.Checked);
cbxEncConn.Checked:= false;
if not(cfgXML.IsEmptyDoc) then
begin
if (cfgXML.DocumentElement<>nil) then
begin
n1:= cfgXML.DocumentElement;
if (n1.NodeName='config') then
begin
attribs:= n1.AttributeNodes;
i:= attribs.IndexOf(sPort);
if (i>-1) then
edtAPIport.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf('IniPath');
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
iniFPath:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sCfgComp);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
lblCompname.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sServer);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtServer.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sName);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtDB.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sPortS);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtPort.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sUser);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
begin
dbUsr:= attribs.Get(i).NodeValue;
edtUser.Text:= ReturnDecrypted(dbUsr);
end;
i:= attribs.IndexOf(sPwd);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
begin
dbPwd:= attribs.Get(i).NodeValue;
edtPwd.Text:= ReturnDecrypted(dbPwd);
end;
i:= attribs.IndexOf(sEncConn);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
if (attribs.Get(i).NodeValue='1') then
cbxEncConn.Checked:= true;
i:= attribs.IndexOf(sSSL);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
cbxSSL.Checked:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sLoginMod);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
cbxJWTLogin.Checked:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sLCh);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
cbL.Checked:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sSSLCert);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtSSLCert.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sSSLKey);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtSSLKey.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sDzKlic);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
lblDZKlic.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sDZTasksIntDown);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtDZTasksDown.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sDZTasksDownURL);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtDZTasksURL.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sDZTasksIntZapisHeO);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtDZTasksZapis.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sDZTaskIntZapisTypCas);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
begin
t1:= attribs.Get(i).NodeValue;
if (t1>-1) and (t1<3) then
cbTypIntervalZapis.ItemIndex:= t1;
end;
i:= attribs.IndexOf(sHeoLic);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtHeoLic.Text:= attribs.Get(i).NodeValue;
i:= attribs.IndexOf(sHeliosStoreURL);
if (i>-1) then
if (attribs.Get(i).NodeValue<>null) then
edtLicCheckURL.Text:= attribs.Get(i).NodeValue;
end;
end;
end;
lblIniPath.Caption:= iniFPath;
except
end
else
try
cfgXML.Active:= true;
cfgXML.Options:= [doNodeAutoIndent];
cfgXML.NodeIndentStr:= ' ';
cfgXML.Version:= '1.0';
cfgXML.AddChild('config');
n1:= cfgXML.DocumentElement;
except
end;
// TODO: JWT autentifikaci
cbxJWTLogin.Checked:= false;
cbxJWTLogin.Visible:= false;
end;
procedure TfrmMain.FormShow (Sender: TObject);
begin
iniFPath:= '';
if (edtAPIport.CanFocus) then
edtAPIport.SetFocus;
end;
procedure TfrmMain.Image1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
edtPwd.PasswordChar:= #0;
end;
procedure TfrmMain.Image1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
edtPwd.PasswordChar:= '*';
end;
procedure TfrmMain.cbxSSLClick(Sender: TObject);
begin
edtSSLCert.Enabled:= (cbxSSL.Checked);
edtSSLKey.Enabled:= (cbxSSL.Checked);
end;
procedure TfrmMain.selHeoCfgClick(Sender: TObject);
var ini: TIniFile;
srv, dbLic, selDirTit, fld, fn, DZLic: string;
i: integer;
md5hex: THashMD5;
begin
fn:= '';
selDirTit:= 'Vyberte adresář Heliosu s konfiguračními soubory (Helios.ini/Licence.ini)';
if (VyberAdresar(fld, selDirTit)) then
begin
fn:= fld + '\Helios.ini';
if (FileExists(fn)) then
begin
iniFPath:= ExtractFileDir(fn);
lblIniPath.Caption:= iniFPath;
ini:= TIniFile.Create(fn);
srv:= ini.ReadString('SQLServer', 'Server', '');
if (srv.Substring(0, 4).ToLower='tcp:') then
srv:= srv.Substring(4, 255);
i:= AnsiPos(srv, ',');
if (i>0) then
begin
edtServer.Text:= LeftStr(srv, i);
edtPort.Text:= MidStr(srv, i, 255);
end
else
edtServer.Text:= srv;
edtDB.Text:= ini.ReadString('SQLServer', 'SystemDB', '');
if (edtUser.CanFocus) then
edtUser.SetFocus;
ini.Free;
end;
fn:= fld + '\Licence.ini';
if (FileExists(fn)) then
begin
ini:= TIniFile.Create(fn);
edtHeoLic.Text:= ini.ReadString('HELIOS', 'Licence', '');
dbLic:= edtHeoLic.Text + edtDB.Text;
dbLic:= SimpleXOR(dbLic, 57846218);
lblDZKlic.Text:= THashMD5.GetHashString(dbLic).ToUpper;
ini.Free;
end;
end;
end;
procedure TfrmMain.bntSaveClick(Sender: TObject);
var s: AnsiString;
sx: string;
fs: TFileStream;
begin
edtPort.Text:= Trim(edtPort.Text);
if (edtPort.Text='') then
edtPort.Text:= '1433';
edtSSLCert.Text:= Trim(edtSSLCert.Text);
edtSSLKey.Text:= Trim(edtSSLKey.Text);
if (cbxSSL.Checked) and ((edtSSLCert.Text='') or (edtSSLKey.Text='')) then
begin
ShowMessage('Mód SSL - je nutno zadat soubory certifikátu a klíče !!');
Exit;
end;
dbPwd:= ReturnEncrypted(edtPwd.Text);
dbUsr:= ReturnEncrypted(edtUser.Text);
if (lblIniPath.Caption<>'') then
iniFPath:= lblIniPath.Caption;
if (Assigned(n1)) then
begin
n1.SetAttributeNS(sCfgComp, '', Trim(lblCompname.Text));
n1.SetAttributeNS(sPort, '', Trim(edtAPIport.Text).ToInteger);
n1.SetAttributeNS(sLoginMod, '', IfThen(cbxJWTLogin.Checked, '1', '0'));
n1.SetAttributeNS(sSSL, '', IfThen(cbxSSL.Checked, '1', '0'));
n1.SetAttributeNS(sEncConn, '', IfThen(cbxEncConn.Checked, '1', '0'));
n1.SetAttributeNS(sSSLCert, '', IfThen(cbxSSL.Checked, Trim(edtSSLCert.Text), ''));
n1.SetAttributeNS(sSSLKey, '', IfThen(cbxSSL.Checked, Trim(edtSSLKey.Text), ''));
n1.SetAttributeNS(sServer, '', Trim(edtServer.Text));
n1.SetAttributeNS(sPortS, '', Trim(edtPort.Text).ToInteger);
n1.SetAttributeNS(sName, '', Trim(edtDB.Text));
n1.SetAttributeNS(sUser, '', dbUsr);
n1.SetAttributeNS(sPwd, '', dbPwd);
n1.SetAttributeNS(sDzKlic, '', Trim(lblDZKlic.Text));
n1.SetAttributeNS(sDZTasksDownURL, '', Trim(edtDZTasksURL.Text));
n1.SetAttributeNS(sDZTasksIntDown, '', Trim(edtDZTasksDown.Text));
n1.SetAttributeNS(sDZTasksIntZapisHeO, '', Trim(edtDZTasksZapis.Text));
n1.SetAttributeNS(sDZTaskIntZapisTypCas, '', cbTypIntervalZapis.ItemIndex.ToString);
n1.SetAttributeNS(sLCh, '', IfThen(cbL.Checked, '1', '0'));
n1.SetAttributeNS(sHeoLic, '', edtHeoLic.Text);
n1.SetAttributeNS(sHeliosStoreURL, '', Trim(edtLicCheckURL.Text));
n1.SetAttributeNS('IniPath', '', iniFPath);
s:= cfgXML.XML.Text;
sx:= ReturnEncrypted(s);
try
fs:= TFileStream.Create(fleName, fmCreate or fmOpenWrite);
fs.Write(PChar(sx)^, Length(sx)*SizeOf(Char));
finally
fs.Free;
end;
end;
Close;
end;
procedure TfrmMain.btnCloseClick(Sender: TObject);
begin
Close;
end;
end.