-
{{ item.hostIp }}:{{ item.hostPort }}
-
→
-
{{ item.containerPort }}
+
+ {{ item }}
@@ -175,14 +173,17 @@ const inspectData = ref
(null);
const rawJson = ref('');
const showRawJson = ref(false);
+const ports = ref([]);
interface DialogProps {
data: any;
+ ports: string[];
}
const acceptParams = (props: DialogProps): void => {
visible.value = true;
activeTab.value = 'overview';
showRawJson.value = false;
+ ports.value = props.ports || [];
try {
if (typeof props.data === 'string') {
@@ -231,24 +232,6 @@ const formatDate = (dateStr: string): string => {
}
};
-const getPortBindings = (): any[] => {
- const ports: any[] = [];
- const portBindings = inspectData.value?.HostConfig?.PortBindings || {};
-
- for (const [containerPort, bindings] of Object.entries(portBindings)) {
- if (Array.isArray(bindings)) {
- for (const binding of bindings) {
- ports.push({
- containerPort,
- hostIp: (binding as any).HostIp || '0.0.0.0',
- hostPort: (binding as any).HostPort,
- });
- }
- }
- }
- return ports;
-};
-
const getEnvKey = (env: string): string => {
const index = env.indexOf('=');
return index > 0 ? env.substring(0, index) : env;