Skip to content

Commit 9aa87bc

Browse files
committed
v0.1 + Initial Release
1 parent 1d8279a commit 9aa87bc

15 files changed

Lines changed: 149 additions & 54 deletions

naivegui/backup/naivegui.lps

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<WindowIndex Value="-1"/>
4444
<TopLine Value="-1"/>
4545
<CursorPos X="-1" Y="-1"/>
46-
<UsageCount Value="34"/>
46+
<UsageCount Value="35"/>
4747
</Unit>
4848
<Unit>
4949
<Filename Value="unit1.pas"/>
@@ -53,9 +53,8 @@
5353
<ResourceBaseClass Value="Form"/>
5454
<UnitName Value="Unit1"/>
5555
<IsVisibleTab Value="True"/>
56-
<TopLine Value="330"/>
57-
<CursorPos X="38" Y="332"/>
58-
<UsageCount Value="34"/>
56+
<CursorPos X="75" Y="9"/>
57+
<UsageCount Value="35"/>
5958
<Loaded Value="True"/>
6059
<LoadedDesigner Value="True"/>
6160
</Unit>
@@ -64,40 +63,24 @@
6463
<IsPartOfProject Value="True"/>
6564
<EditorIndex Value="-1"/>
6665
<CursorPos X="17"/>
67-
<UsageCount Value="34"/>
66+
<UsageCount Value="35"/>
6867
</Unit>
6968
<Unit>
7069
<Filename Value="service_state_trd.pas"/>
7170
<IsPartOfProject Value="True"/>
7271
<EditorIndex Value="-1"/>
7372
<CursorPos X="25"/>
74-
<UsageCount Value="32"/>
73+
<UsageCount Value="33"/>
7574
</Unit>
7675
<Unit>
7776
<Filename Value="JsonArrayHelper.pas"/>
7877
<IsPartOfProject Value="True"/>
7978
<EditorIndex Value="-1"/>
8079
<CursorPos X="23"/>
81-
<UsageCount Value="32"/>
80+
<UsageCount Value="33"/>
8281
</Unit>
8382
</Units>
8483
<JumpHistory HistoryIndex="29">
85-
<Position>
86-
<Filename Value="unit1.pas"/>
87-
<Caret Line="333" Column="17" TopLine="322"/>
88-
</Position>
89-
<Position>
90-
<Filename Value="unit1.pas"/>
91-
<Caret Line="277" Column="7" TopLine="262"/>
92-
</Position>
93-
<Position>
94-
<Filename Value="unit1.pas"/>
95-
<Caret Line="278" Column="7" TopLine="263"/>
96-
</Position>
97-
<Position>
98-
<Filename Value="unit1.pas"/>
99-
<Caret Line="279" Column="7" TopLine="264"/>
100-
</Position>
10184
<Position>
10285
<Filename Value="unit1.pas"/>
10386
<Caret Line="278" Column="7" TopLine="263"/>
@@ -202,6 +185,22 @@
202185
<Filename Value="unit1.pas"/>
203186
<Caret Line="342" Column="10" TopLine="335"/>
204187
</Position>
188+
<Position>
189+
<Filename Value="unit1.pas"/>
190+
<Caret Line="58" Column="15" TopLine="191"/>
191+
</Position>
192+
<Position>
193+
<Filename Value="unit1.pas"/>
194+
<Caret Line="59" Column="15" TopLine="59"/>
195+
</Position>
196+
<Position>
197+
<Filename Value="unit1.pas"/>
198+
<Caret Line="411" Column="67" TopLine="388"/>
199+
</Position>
200+
<Position>
201+
<Filename Value="unit1.pas"/>
202+
<Caret Line="9" Column="67"/>
203+
</Position>
205204
</JumpHistory>
206205
<RunParams>
207206
<FormatVersion Value="2"/>

naivegui/backup/unit1.lfm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,8 @@ object MainForm: TMainForm
687687
Height = 17
688688
Hint = 'https://www.speedtest.net'
689689
Top = 179
690-
Width = 83
691-
Caption = 'Speed ​​check...'
690+
Width = 174
691+
Caption = 'Checking connection speed...'
692692
Font.Color = clBlue
693693
Font.Style = [fsUnderline]
694694
ParentFont = False
@@ -703,4 +703,10 @@ object MainForm: TMainForm
703703
Left = 73
704704
Top = 240
705705
end
706+
object SaveDialog1: TSaveDialog
707+
Filter = 'Archive (*.tar.gz)|*.tar.gz'
708+
Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
709+
Left = 192
710+
Top = 240
711+
end
706712
end

naivegui/backup/unit1.pas

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface
66

77
uses
88
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Buttons,
9-
ExtCtrls, DefaultTranslator, IniPropStorage, LCLIntf, Process;
9+
ExtCtrls, DefaultTranslator, IniPropStorage, LCLIntf, StrUtils, FileUtil, Process;
1010

1111
type
1212

@@ -21,6 +21,7 @@ TMainForm = class(TForm)
2121
BypassBox: TComboBox;
2222
DomainEdit: TEdit;
2323
PassBtn: TSpeedButton;
24+
SaveDialog1: TSaveDialog;
2425
SPortEdit: TEdit;
2526
HPortEdit: TEdit;
2627
Label11: TLabel;
@@ -55,6 +56,7 @@ TMainForm = class(TForm)
5556
procedure CreateClientConfig;
5657
procedure CreateServerConfig;
5758
procedure CreateSWProxy;
59+
procedure StartProcess(command: string);
5860

5961
private
6062

@@ -73,6 +75,22 @@ implementation
7375

7476
{ TMainForm }
7577

78+
//Общая процедура запуска команд (асинхронная)
79+
procedure TMainForm.StartProcess(command: string);
80+
var
81+
ExProcess: TProcess;
82+
begin
83+
ExProcess := TProcess.Create(nil);
84+
try
85+
ExProcess.Executable := '/bin/bash';
86+
ExProcess.Parameters.Add('-c');
87+
ExProcess.Parameters.Add(command);
88+
ExProcess.Options := ExProcess.Options + [poWaitOnExit];
89+
ExProcess.Execute;
90+
finally
91+
ExProcess.Free;
92+
end;
93+
end;
7694

7795
//Create ~/config/naivegui/swproxy.sh
7896
procedure TMainForm.CreateSWProxy;
@@ -362,8 +380,9 @@ procedure TMainForm.Label2MouseLeave(Sender: TObject);
362380
procedure TMainForm.PassBtnClick(Sender: TObject);
363381
begin
364382
if PasswordEdit.PasswordChar = Chr(0) then
365-
PasswordEdit.PasswordChar:=#1 else
366-
PasswordEdit.PasswordChar:= Chr(0);
383+
PasswordEdit.PasswordChar := #1
384+
else
385+
PasswordEdit.PasswordChar := Chr(0);
367386
end;
368387

369388
//Создаём конфиги Клиента и Сервера
@@ -373,6 +392,25 @@ procedure TMainForm.SpeedButton3Click(Sender: TObject);
373392
CreateClientConfig;
374393
//Сервер
375394
CreateServerConfig;
395+
396+
//Выгружаем архив конфигураций Клиента и Сервера
397+
if SaveDialog1.Execute then
398+
begin
399+
if not AnsiEndsText('.tar.gz', SaveDialog1.FileName) then
400+
begin
401+
if SameText(ExtractFileExt(SaveDialog1.FileName), '.gz') then
402+
SaveDialog1.FileName := ChangeFileExt(SaveDialog1.FileName, '.tar.gz')
403+
else
404+
SaveDialog1.FileName := SaveDialog1.FileName + '.tar.gz';
405+
end;
406+
407+
//Создаём архив и выгружаем
408+
StartProcess(
409+
'cd ~/.config/naivegui; chmod 644 Caddyfile; tar -zcf naivegui_config.tar.gz Caddyfile client.json');
410+
411+
CopyFile(GetUserDir + '.config/naivegui/naivegui_config.tar.gz',
412+
SaveDialog1.FileName, [cffOverwriteFile]);
413+
end;
376414
end;
377415

378416
//Start + Enable
168 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

naivegui/lib/x86_64-linux/unit1.lfm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,4 +703,11 @@ object MainForm: TMainForm
703703
Left = 73
704704
Top = 240
705705
end
706+
object SaveDialog1: TSaveDialog
707+
FileName = 'naivegui_config.tar.gz'
708+
Filter = 'Archive (*.tar.gz)|*.tar.gz'
709+
Options = [ofOverwritePrompt, ofEnableSizing, ofViewDetail]
710+
Left = 192
711+
Top = 240
712+
end
706713
end

naivegui/lib/x86_64-linux/unit1.o

3.88 KB
Binary file not shown.

0 commit comments

Comments
 (0)