Skip to content

Commit

Permalink
more pod container info.
Browse files Browse the repository at this point in the history
1. remvoe container.ports yaml name field.
2. change copyTileYaml value type to dynamic.
3. show container.command and container.args via yaml.

Signed-off-by: 疯魔慕薇 <[email protected]>
  • Loading branch information
kofj committed Apr 29, 2024
1 parent 93f20a6 commit 6ce03e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
24 changes: 9 additions & 15 deletions lib/widgets/detail_widgets/pod.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,32 +138,26 @@ SettingsTile contianersTile(

if (container.command.isNotEmpty) {
podTiles.add(
copyTileValue(
lang.command,
container.command.toString(),
langCode,
),
copyTileYaml(lang.command, container.command, langCode),
);
}

if (container.args.isNotEmpty) {
podTiles.add(
copyTileValue(
lang.args,
container.args.toString(),
langCode,
),
copyTileYaml(lang.args, container.args, langCode),
);
}

if (container.env.isNotEmpty) {
podTiles.add(
copyTileYaml("env", container.env, langCode),
);
}

// ports
if (container.ports.isNotEmpty) {
podTiles.add(
copyTileYaml(
lang.ports,
{"ports": container.ports},
langCode,
),
copyTileYaml(lang.ports, container.ports, langCode),
);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/tiles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SettingsTile copyTileValue(String name, String value, String langCode) {

SettingsTile copyTileYaml(
String name,
Map<String, dynamic>? value,
dynamic value,
String langCode,
) {
final yamlValue = K8zNative.json2yaml(jsonEncode(value));
Expand Down

0 comments on commit 6ce03e0

Please sign in to comment.