Commit 49bea962 authored by jan.koester's avatar jan.koester
Browse files

test

parent e75cf2e8
Loading
Loading
Loading
Loading
+3 −0
Changes for modules/containers/containers.cpp: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *                         dropCapabilities[] (update: name renames)
 *   delete {name}         (its files go in the background)
 *   start / stop / restart {name}      kill {name, signal}
 *   recreate {name}       its changes go, fresh from the image (restarted
 *                         if it was running)
 *   log {name, lines}     -> {lines[]}
 *   pull {image}          in the background -> {background, job}
 *   removeImage {image}
@@ -531,6 +533,7 @@ json_object *call(const webctl_request *req) {
    if (action == "start") return simple(m::StartContainer, {{"name", name}});
    if (action == "stop") return simple(m::StopContainer, {{"name", name}});
    if (action == "restart") return simple(m::RestartContainer, {{"name", name}});
    if (action == "recreate") return simple(m::RecreateContainer, {{"name", name}});
    if (action == "kill") return simple(m::KillContainer, {{"name", name}, {"signal", webctl::str(a, "signal", "KILL")}});
    if (action == "pull") return simple(m::PullImage, {{"image", webctl::str(a, "image")}});
    if (action == "removeImage") return simple(m::RemoveImage, {{"image", webctl::str(a, "image")}});
+14 −0
Changes for www/modules/containers.js: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@
    'Pull': 'Laden', 'Remove image {0}?': 'Image {0} entfernen?',
    'Layers no other image needs are deleted too.': 'Schichten, die kein anderes Image braucht, werden mitgelöscht.',
    'Delete container {0}?': 'Container {0} löschen?',
    'Recreate': 'Neu erstellen', 'Recreate container {0}?': 'Container {0} neu erstellen?',
    'Everything it changed in its file system is deleted; it starts fresh from its image (as last pulled). Its settings and bind-mounted host directories stay.':
      'Alles, was er in seinem Dateisystem geändert hat, wird gelöscht; er beginnt frisch aus seinem Image (wie zuletzt geladen). Seine Einstellungen und eingebundene Host-Verzeichnisse bleiben.',
    '{0} is recreated.': '{0} wird neu erstellt.',
    'Its settings and everything it changed in its file system are deleted. Bind-mounted host directories stay.':
      'Seine Einstellungen und alles, was er in seinem Dateisystem geändert hat, werden gelöscht. Eingebundene Host-Verzeichnisse bleiben.',
    'Container {0}': 'Container {0}', 'Create': 'Anlegen',
@@ -157,6 +161,15 @@
    load();
  }

  async function recreateContainer(c) {
    if (!await confirmAction(t('Recreate container {0}?', c.name),
      t('Everything it changed in its file system is deleted; it starts fresh from its image (as last pulled). Its settings and bind-mounted host directories stay.'),
      t('Recreate'))) return;
    const r = await run(() => call('containers', 'recreate', {name: c.name}));
    if (r) toast(t('{0} is recreated.', c.name));
    load();
  }

  async function logDialog(name) {
    const pre = h('pre', {class: 'log'}, t('Loading …'));
    const fill = async () => {
@@ -420,6 +433,7 @@
              up ? h('button', {class: 'small', onclick: () => consoleDialog(c.name)}, t('Console')) : null,
              h('button', {class: 'small', onclick: () => logDialog(c.name)}, t('Log')),
              h('button', {class: 'small', onclick: () => containerDialog(c.name)}, t('Edit')),
              h('button', {class: 'small', onclick: () => recreateContainer(c)}, t('Recreate')),
              up ? null : h('button', {class: 'small danger', onclick: () => removeContainer(c)}, t('Delete')),
            ];
          }},