добавил часть модулей, нужно переделать БД на records
This commit is contained in:
@@ -29,8 +29,11 @@ type
|
||||
Label4: TLabel;
|
||||
edtKandiKey: TEdit;
|
||||
edtKandiSecret: TEdit;
|
||||
procedure RBCustomChange(Sender: TObject);
|
||||
procedure btnGetAIDefClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
@@ -39,4 +42,78 @@ implementation
|
||||
|
||||
{$R *.fmx}
|
||||
|
||||
uses uGeneral;
|
||||
|
||||
procedure TfrAI.btnGetAIDefClick(Sender: TObject);
|
||||
begin
|
||||
rbGC.IsChecked := true;
|
||||
if appconst.AI_GigaChat_ClientID <> '' then
|
||||
edtAIP1.text := appconst.AI_GigaChat_ClientID;
|
||||
if appconst.AI_GigaChat_AC <> '' then
|
||||
edtAIP2.text := appconst.AI_GigaChat_AC;
|
||||
|
||||
DB.WriteSetting('edtAIP1', edtAIP1.text);
|
||||
DB.WriteSetting('edtAIP2', edtAIP2.text);
|
||||
end;
|
||||
|
||||
procedure TfrAI.RBCustomChange(Sender: TObject);
|
||||
var
|
||||
aiIndex: Integer;
|
||||
begin
|
||||
aiIndex := -1;
|
||||
if TRadioButton(Sender).IsChecked then
|
||||
aiIndex := strtoint(TRadioButton(Sender).Hint);
|
||||
if aiIndex = -1 then
|
||||
exit;
|
||||
case aiIndex of
|
||||
0:
|
||||
begin
|
||||
Label45.text := 'ClientID';
|
||||
Label47.text := 'Autorization Code';
|
||||
Label1.Visible := false;
|
||||
edtAIP2.Visible := true;
|
||||
edtAIP2.Password := true;
|
||||
edtAIP3.Visible := false;
|
||||
cbOllama.IsChecked:=false;
|
||||
cbOllama.Visible:=false;
|
||||
end;
|
||||
1:
|
||||
begin
|
||||
Label45.text := 'API Token';
|
||||
Label47.text := '';
|
||||
Label1.Visible := false;
|
||||
edtAIP2.Visible := false;
|
||||
edtAIP2.Password := false;
|
||||
edtAIP3.Visible := false;
|
||||
cbOllama.IsChecked:=false;
|
||||
cbOllama.Visible:=false;
|
||||
end;
|
||||
2:
|
||||
begin
|
||||
Label45.text := 'API Token';
|
||||
Label47.text := '';
|
||||
Label1.Visible := false;
|
||||
edtAIP2.Visible := false;
|
||||
edtAIP2.Password := false;
|
||||
edtAIP3.Visible := false;
|
||||
cbOllama.IsChecked:=false;
|
||||
cbOllama.Visible:=false;
|
||||
end;
|
||||
3:
|
||||
begin
|
||||
Label45.text := 'API Token';
|
||||
Label47.text := 'URL';
|
||||
Label1.Visible := true;
|
||||
edtAIP2.Visible := true;
|
||||
edtAIP2.Password := false;
|
||||
edtAIP3.Visible := true;
|
||||
cbOllama.IsChecked:=false;
|
||||
cbOllama.Visible:=true;
|
||||
end;
|
||||
end;
|
||||
DB.WriteSetting('aiIndex', inttostr(aiIndex));
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
||||
Reference in New Issue
Block a user