hunk.code_window:     }
     }
     configureSocketAndTerminal(socket, term) {
       socket.onopen = function () {
         const terminal_container = document.getElementById('terminal-container');
         term.open(terminal_container);
         term.setOption('cursorBlink', true);
         term.focus();
  
hunk.labels: keep keep keep add keep keep keep keep keep
hunk.after_edit:     var vm = this;
  
hunk.file_path: app/kubernetes/components/kubectl-shell/kubectl-shell.controller.js
hunk.type: add
file: import { SwarmViewModel } from '../models/swarm';
  
  angular.module('portainer.docker').factory('SwarmService', [
    '$q',
    'Swarm',
    function SwarmServiceFactory($q, Swarm) {
      'use strict';
      var service = {};
  
      service.swarm = function () {
        var deferred = $q.defer();
  
        Swarm.get()
          .$promise.then(function success(data) {
            var swarm = new SwarmViewModel(data);
            deferred.resolve(swarm);
          })
          .catch(function error(err) {
            deferred.reject({ msg: 'Unable to retrieve Swarm details', err: err });
          });
  
        return deferred.promise;
      };
  
      return service;
    },
  ]);
  