Skip to content

Commit

Permalink
change Text to SelectableText in instances page and detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
levkropp committed Dec 18, 2024
1 parent eeed24d commit 5f16617
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/client/gui/lib/vm_details/ip_addresses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class IpAddresses extends StatelessWidget {
Expanded(
child: Tooltip(
message: firstIp,
child: Text(firstIp.nonBreaking, overflow: TextOverflow.ellipsis),
child: SelectableText(firstIp.nonBreaking, maxLines: 1),
),
),
if (restIps.isNotEmpty)
Expand Down
2 changes: 1 addition & 1 deletion src/client/gui/lib/vm_details/memory_usage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MemoryUsage extends StatelessWidget {
color: value < 0.8 ? normalColor : almostFullColor,
);

final label = Text(
final label = SelectableText(
value != 0 ? '${_formatMemory(used)} / ${_formatMemory(total)}' : '-',
style: const TextStyle(fontSize: 11),
);
Expand Down
14 changes: 7 additions & 7 deletions src/client/gui/lib/vm_details/vm_details_general.dart
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ class VmDetailsHeader extends ConsumerWidget {

final list = [
Expanded(
child: Text(
child: SelectableText(
name.nonBreaking,
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w300),
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.start,
),
),
locationButtons,
Expand Down Expand Up @@ -150,28 +150,28 @@ class GeneralDetails extends ConsumerWidget {
width: 150,
height: baseVmStatHeight,
label: 'IMAGE',
child: Text(info.instanceInfo.currentRelease),
child: SelectableText(info.instanceInfo.currentRelease),
);

final privateIp = VmStat(
width: 150,
height: baseVmStatHeight,
label: 'PRIVATE IP',
child: Text(info.instanceInfo.ipv4.firstOrNull ?? '-'),
child: SelectableText(info.instanceInfo.ipv4.firstOrNull ?? '-'),
);

final publicIp = VmStat(
width: 150,
height: baseVmStatHeight,
label: 'PUBLIC IP',
child: Text(info.instanceInfo.ipv4.skip(1).firstOrNull ?? '-'),
child: SelectableText(info.instanceInfo.ipv4.skip(1).firstOrNull ?? '-'),
);

final created = VmStat(
width: 140,
height: baseVmStatHeight,
label: 'CREATED',
child: Text(
child: SelectableText(
DateFormat('yyyy-MM-dd HH:mm:ss')
.format(info.instanceInfo.creationTimestamp.toDateTime()),
),
Expand All @@ -181,7 +181,7 @@ class GeneralDetails extends ConsumerWidget {
width: 300,
height: baseVmStatHeight,
label: 'UPTIME',
child: Text(info.instanceInfo.uptime),
child: SelectableText(info.instanceInfo.uptime),
);

return Column(
Expand Down
4 changes: 2 additions & 2 deletions src/client/gui/lib/vm_table/vm_table_headers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ final headers = <TableHeader<VmInfo>>[
minWidth: 70,
cellBuilder: (info) {
final image = info.instanceInfo.currentRelease;
return Text(
return SelectableText(
image.isNotBlank ? image.nonBreaking : '-',
overflow: TextOverflow.ellipsis,
maxLines: 1,
);
},
),
Expand Down

0 comments on commit 5f16617

Please sign in to comment.