Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions lib/features/connections/extension_connection_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:querya_desktop/core/sdui/sdui_form_schema.dart';
import 'package:querya_desktop/core/storage/local_db.dart';
import 'package:querya_desktop/features/connections/connection_edit_secrets.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

/// Shows an SDUI connection form for an installed extension driver.
Future<ConnectionRow?> showExtensionConnectionForm(
Expand Down Expand Up @@ -292,28 +293,24 @@ class _ExtensionConnectionFormContentState
),
child: material.Row(
children: [
OutlineButton(
onPressed:
_schema == null || _testing ? null : _testConnection,
leading: _testing
? const QueryaSpinner(
size: QueryaSpinnerSize.sm,
)
: const material.Icon(
material.Icons.bolt_rounded,
size: 16,
),
child: const Text('Test Connection'),
QueryaButton.secondary(
label: 'Test Connection',
icon: material.Icons.bolt_rounded,
loading: _testing,
size: QueryaControlSize.lg,
onPressed: _schema == null || _testing ? null : _testConnection,
),
const Spacer(),
GhostButton(
QueryaButton.ghost(
label: 'Cancel',
onPressed: () => material.Navigator.of(context).pop(),
child: const Text('Cancel'),
size: QueryaControlSize.lg,
),
const material.SizedBox(width: 12),
PrimaryButton(
QueryaButton.primary(
label: 'Save',
onPressed: _schema == null ? null : _save,
child: const Text('Save'),
size: QueryaControlSize.lg,
),
],
),
Expand Down
47 changes: 16 additions & 31 deletions lib/features/connections/sqlite_connection_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:querya_desktop/core/layout/window_layout.dart';
import 'package:querya_desktop/core/storage/local_db.dart';
import 'package:querya_desktop/shared/widgets/form_validity_notifier.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

/// Shows SQLite connection form dialog.
/// Returns ConnectionRow if saved, null if cancelled.
Expand Down Expand Up @@ -282,9 +283,10 @@ class _SqliteConnectionFormContentState
),
),
const Gap(10),
OutlineButton(
QueryaButton.secondary(
label: 'Browse…',
onPressed: _pickFile,
child: const Text('Browse…'),
size: QueryaControlSize.lg,
),
],
),
Expand Down Expand Up @@ -394,44 +396,27 @@ class _SqliteConnectionFormContentState
runSpacing: 8,
alignment: material.WrapAlignment.spaceBetween,
children: [
OutlineButton(
onPressed:
formValid && !_isTesting ? _testConnection : null,
leading: _isTesting
? QueryaSpinner(
customDimension: 18,
strokeWidth: 2,
color: theme.primary,
)
: material.Icon(
material.Icons.link_rounded,
size: 18,
color: formValid
? theme.primary
: theme.mutedForeground,
),
child: Text(
'Test Connection',
style: material.TextStyle(
fontWeight: material.FontWeight.w500,
color: formValid
? theme.primary
: theme.mutedForeground,
),
),
QueryaButton.secondary(
label: 'Test Connection',
icon: material.Icons.link_rounded,
loading: _isTesting,
size: QueryaControlSize.lg,
onPressed: formValid && !_isTesting ? _testConnection : null,
),
material.Row(
mainAxisSize: material.MainAxisSize.min,
children: [
GhostButton(
QueryaButton.ghost(
label: 'Cancel',
onPressed: () =>
material.Navigator.of(context).pop(),
child: const Text('Cancel'),
size: QueryaControlSize.lg,
),
const Gap(12),
PrimaryButton(
QueryaButton.primary(
label: 'Save',
onPressed: formValid ? _save : null,
child: const Text('Save'),
size: QueryaControlSize.lg,
),
],
),
Expand Down
30 changes: 14 additions & 16 deletions lib/features/connections/ssh_tunnel_section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:querya_desktop/core/security/ssh_tunnel_config.dart';
import 'package:querya_desktop/core/security/ssh_tunnel_manager.dart';
import 'package:querya_desktop/features/connections/connection_edit_secrets.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

/// Reusable UI section for configuring SSH Bastion / Jump Host tunneling
/// in connection dialogs.
Expand Down Expand Up @@ -384,9 +385,10 @@ class _SshTunnelSectionState extends material.State<SshTunnelSection> {
),
),
const Gap(8),
OutlineButton(
QueryaButton.secondary(
label: 'Browse…',
onPressed: _pickPrivateKeyFile,
child: const Text('Browse…'),
size: QueryaControlSize.lg,
),
],
),
Expand Down Expand Up @@ -440,24 +442,20 @@ class _SshTunnelSectionState extends material.State<SshTunnelSection> {
runSpacing: 8,
crossAxisAlignment: material.WrapCrossAlignment.center,
children: [
OutlineButton(
size: ButtonSize.small,
QueryaButton.secondary(
label: 'Test SSH Connection',
icon: material.Icons.network_check_rounded,
loading: _testing,
size: QueryaControlSize.sm,
onPressed: _testing ? null : _testSsh,
leading: _testing
? const QueryaSpinner(size: QueryaSpinnerSize.sm)
: const material.Icon(
material.Icons.network_check_rounded,
size: 15,
),
child: const Text('Test SSH Connection'),
),
GhostButton(
size: ButtonSize.small,
QueryaButton.ghost(
label: _showAdvanced
? 'Hide Advanced ▲'
: 'Advanced (Host Key & Keep-Alive) ▼',
onPressed: () =>
setState(() => _showAdvanced = !_showAdvanced),
child: Text(_showAdvanced
? 'Hide Advanced ▲'
: 'Advanced (Host Key & Keep-Alive) ▼'),
size: QueryaControlSize.sm,
),
],
),
Expand Down
24 changes: 13 additions & 11 deletions lib/features/mongodb/mongo_create_index_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart' as material;
import 'package:querya_desktop/core/database/mongodb_connection.dart';
import 'package:querya_desktop/core/database/mongodb_service.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

class _IndexFieldDraft {
_IndexFieldDraft({String field = '', dynamic direction = 1})
Expand Down Expand Up @@ -279,11 +280,11 @@ class _MongoCreateIndexDialogState
],
material.Align(
alignment: material.Alignment.centerLeft,
child: GhostButton(
child: QueryaButton.ghost(
label: 'Add Field (Compound)',
icon: material.Icons.add_rounded,
onPressed: _addField,
size: ButtonSize.small,
leading: const material.Icon(material.Icons.add_rounded, size: 14),
child: const Text('Add Field (Compound)'),
size: QueryaControlSize.sm,
),
),
const Gap(16),
Expand Down Expand Up @@ -371,16 +372,17 @@ class _MongoCreateIndexDialogState
],
),
actions: [
OutlineButton(
QueryaButton.ghost(
label: 'Cancel',
onPressed: () => material.Navigator.of(context).pop(),
child: const Text('Cancel'),
size: QueryaControlSize.lg,
),
PrimaryButton(
QueryaButton.primary(
label: _submitting ? 'Creating...' : 'Create Index',
icon: material.Icons.check_rounded,
loading: _submitting,
size: QueryaControlSize.lg,
onPressed: _submitting ? null : _submit,
leading: _submitting
? const QueryaSpinner(size: QueryaSpinnerSize.sm)
: const material.Icon(material.Icons.check_rounded, size: 16),
child: Text(_submitting ? 'Creating...' : 'Create Index'),
),
],
);
Expand Down
42 changes: 13 additions & 29 deletions lib/features/mongodb/mongodb_connection_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import 'package:querya_desktop/features/connections/ssl_certificate_support.dart
import 'package:querya_desktop/shared/widgets/form_validity_notifier.dart';
import 'package:querya_desktop/shared/widgets/ssl_certificate_fields.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

/// MongoDB connection form data.
class MongoConnectionData {
Expand Down Expand Up @@ -651,41 +652,24 @@ class _MongoConnectionFormContentState
builder: (context, formValid, _) {
return material.Row(
children: [
OutlineButton(
onPressed:
formValid && !_isTesting ? _testConnection : null,
leading: _isTesting
? QueryaSpinner(
customDimension: 18,
strokeWidth: 2,
color: theme.primary,
)
: material.Icon(
material.Icons.link_rounded,
size: 18,
color: formValid
? theme.primary
: theme.mutedForeground,
),
child: Text(
'Test Connection',
style: material.TextStyle(
fontWeight: material.FontWeight.w500,
color: formValid
? theme.primary
: theme.mutedForeground,
),
),
QueryaButton.secondary(
label: 'Test Connection',
icon: material.Icons.link_rounded,
loading: _isTesting,
size: QueryaControlSize.lg,
onPressed: formValid && !_isTesting ? _testConnection : null,
),
const material.Spacer(),
GhostButton(
QueryaButton.ghost(
label: 'Cancel',
onPressed: () => material.Navigator.of(context).pop(),
child: const Text('Cancel'),
size: QueryaControlSize.lg,
),
const Gap(12),
PrimaryButton(
QueryaButton.primary(
label: 'Save',
onPressed: formValid ? _save : null,
child: const Text('Save'),
size: QueryaControlSize.lg,
),
],
);
Expand Down
42 changes: 13 additions & 29 deletions lib/features/mysql/mysql_connection_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'package:querya_desktop/features/connections/ssl_certificate_support.dart
import 'package:querya_desktop/shared/widgets/form_validity_notifier.dart';
import 'package:querya_desktop/shared/widgets/ssl_certificate_fields.dart';
import 'package:querya_desktop/shared/widgets/widgets.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';

/// Shows MySQL / MariaDB connection form dialog.
/// Returns [ConnectionRow] if saved, null if cancelled.
Expand Down Expand Up @@ -559,44 +560,27 @@ class _MysqlConnectionFormContentState
runSpacing: 8,
alignment: material.WrapAlignment.spaceBetween,
children: [
OutlineButton(
onPressed:
formValid && !_isTesting ? _testConnection : null,
leading: _isTesting
? QueryaSpinner(
customDimension: 18,
strokeWidth: 2,
color: theme.primary,
)
: material.Icon(
material.Icons.link_rounded,
size: 18,
color: formValid
? theme.primary
: theme.mutedForeground,
),
child: Text(
'Test Connection',
style: material.TextStyle(
fontWeight: material.FontWeight.w500,
color: formValid
? theme.primary
: theme.mutedForeground,
),
),
QueryaButton.secondary(
label: 'Test Connection',
icon: material.Icons.link_rounded,
loading: _isTesting,
size: QueryaControlSize.lg,
onPressed: formValid && !_isTesting ? _testConnection : null,
),
material.Row(
mainAxisSize: material.MainAxisSize.min,
children: [
GhostButton(
QueryaButton.ghost(
label: 'Cancel',
onPressed: () =>
material.Navigator.of(context).pop(),
child: const Text('Cancel'),
size: QueryaControlSize.lg,
),
const Gap(12),
PrimaryButton(
QueryaButton.primary(
label: 'Save',
onPressed: formValid ? _save : null,
child: const Text('Save'),
size: QueryaControlSize.lg,
),
],
),
Expand Down
Loading
Loading