Name: name,
NetworkID: netid,
DNSNames: net?.DNSNames || '',
- IPv4Address: net?.IPAMConfig?.IPv4Address || '',
+ IPv4Address: net?.IPAMConfig?.IPv4Address || net?.IPAddress || '',
IPv6Address: net?.IPAMConfig?.IPv6Address || '',
});
}
},
render([this_container, images, networks, cpus_mem, ps_top, stats_data, changes_data]) {
+ this.networks = networks;
const view = this;
const containerName = this_container.Name?.substring(1) || this_container.Id || '';
const containerIdShort = (this_container.Id || '').substring(0, 12);
}
// Stop button
- if (containerStatus === 'running' || containerStatus === 'paused') {
+ if (containerStatus === 'running' || containerStatus === 'paused' || containerStatus === 'restarting') {
const stopBtn = E('button', {
'class': 'cbi-button cbi-button-reset',
'click': (ev) => this.executeAction(ev, 'stop', this_container.Id)
}
// Kill button
- if (containerStatus === 'running') {
+ if (containerStatus === 'running' || containerStatus === 'restarting') {
const killBtn = E('button', {
'class': 'cbi-button',
'style': 'background-color: #dc3545;',
dm2.network_disconnect,
{
id: networkID,
- body: { Container: view.containerId, Force: false }
+ body: { Container: this_container.Id, Force: false }
},
_('Disconnect network'),
{
ui.hideModal();
- const body = { Container: view.containerId };
+ const body = { Container: this_container.Id };
body.EndpointConfig = { IPAMConfig: { IPv4Address: ip4Address } }; //, IPv6Address: ip6Address || null
view.executeDockerAction(
}
return ports;
})(),
- command: c.Config?.Cmd ? c.Config?.Cmd.join(' ') : '',
+ command: c.Config?.Cmd ? c.Config?.Cmd.map(arg => {
+ if (arg.includes(' ') || arg.includes('"') || arg.includes("'")) {
+ return '"' + arg.replace(/"/g, '\\"') + '"';
+ }
+ return arg;
+ }).join(' ') : '',
hostname: c.Config?.Hostname || '',
publish_all: hostConfig.PublishAllPorts ? 1 : 0,
device: (hostConfig.Devices || []).map(d => d.PathOnHost + ':' + d.PathInContainer + (d.CgroupPermissions ? ':' + d.CgroupPermissions : '')),
Tty: toBool(get('tty')),
OpenStdin: toBool(get('interactive')),
Env: get('env'),
- Cmd: command ? command.split(' ') : null,
+ Cmd: command ? (command.match(/(?:[^\s"]+|"[^"]*")+/g) || []).map(arg => arg.replace(/^"|"$/g, '')) : null,
Image: get('image'),
HostConfig: {
CpuShares: toInt(get('cpu_shares')),
buildContainerActions(cont, idx) {
const view = this;
const isRunning = cont?.State === 'running';
+ const isRestarting = cont?.State === 'restarting';
const isPaused = cont?.State === 'paused';
const btns = [
E('button', {
dm2.Types['container'].sub['stop'].i18n,
{showOutput: true, showSuccess: false}
),
- 'disabled' : !(isRunning || isPaused) ? true : null
+ 'disabled' : !(isRunning || isPaused || isRestarting) ? true : null
}, [dm2.Types['container'].sub['stop'].e]),
E('button', {
dm2.Types['container'].sub['kill'].i18n,
{showOutput: true, showSuccess: false}
),
- 'disabled' : !(isRunning || isPaused) ? true : null
+ 'disabled' : !(isRunning || isPaused || isRestarting) ? true : null
}, [dm2.Types['container'].sub['kill'].e]),
E('button', {
"action": {
"type": "view",
"path": "dockerman/overview"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/configuration"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "alias",
"path": "admin/services/dockerman/containers"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/container"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/containers"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "alias",
"path": "admin/services/dockerman/containers"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/container_new"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "alias",
"path": "admin/services/dockerman/images"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/network"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/networks"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/network_new"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "alias",
"path": "admin/services/dockerman/networks"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/volumes"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"auth": {
"methods": [ "cookie:sysauth_https", "cookie:sysauth_http" ],
"login": true
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
},
"action": {
"type": "view",
"path": "dockerman/events"
+ },
+ "depends": {
+ "acl": [ "luci-app-dockerman" ]
}
}
}
\ No newline at end of file