2016-08-03 03:11:09 +00:00
|
|
|
<rd-header>
|
2018-06-06 16:12:35 +00:00
|
|
|
<rd-header-title title-text="Container console"></rd-header-title>
|
2019-05-09 02:04:40 +00:00
|
|
|
<rd-header-content>
|
2020-04-10 21:54:53 +00:00
|
|
|
<a ui-sref="docker.containers">Containers</a> > <a ui-sref="docker.containers.container({id: container.Id})">{{ container.Name | trimcontainername }}</a> > Console
|
2016-08-03 03:11:09 +00:00
|
|
|
</rd-header-content>
|
|
|
|
</rd-header>
|
|
|
|
|
2019-05-09 02:04:40 +00:00
|
|
|
<div class="row" ng-init="initView()" ng-show="loaded">
|
2016-08-03 03:11:09 +00:00
|
|
|
<div class="col-lg-12 col-md-12 col-xs-12">
|
|
|
|
<rd-widget>
|
2019-05-09 02:04:40 +00:00
|
|
|
<rd-widget-header icon="fa-terminal" title-text="Execute"></rd-widget-header>
|
2016-08-03 03:11:09 +00:00
|
|
|
<rd-widget-body>
|
2017-07-05 05:16:57 +00:00
|
|
|
<form class="form-horizontal">
|
2019-05-09 02:04:40 +00:00
|
|
|
<div ng-if="state === states.disconnected">
|
2016-10-26 03:29:29 +00:00
|
|
|
<!-- command-list -->
|
2020-04-10 21:54:53 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="command" class="col-lg-1 text-left col-sm-2 control-label">Command</label>
|
|
|
|
<div class="col-lg-11 col-sm-10">
|
|
|
|
<div class="input-group" ng-if="!formValues.isCustomCommand">
|
|
|
|
<span class="input-group-addon">
|
|
|
|
<i class="fab fa-linux" aria-hidden="true" ng-if="imageOS == 'linux'"></i>
|
|
|
|
<i class="fab fa-windows" aria-hidden="true" ng-if="imageOS == 'windows'"></i>
|
|
|
|
</span>
|
|
|
|
<select class="form-control" ng-model="formValues.command" id="command">
|
|
|
|
<option value="ash" ng-if="imageOS == 'linux'">/bin/ash</option>
|
|
|
|
<option value="bash" ng-if="imageOS == 'linux'">/bin/bash</option>
|
|
|
|
<option value="sh" ng-if="imageOS == 'linux'">/bin/sh</option>
|
|
|
|
<option value="powershell" ng-if="imageOS == 'windows'">powershell</option>
|
|
|
|
<option value="cmd.exe" ng-if="imageOS == 'windows'">cmd.exe</option>
|
|
|
|
<option ng-repeat="command in containerCommands" value="{{ command.command }}">{{ command.title }}: {{ command.command }}</option>
|
|
|
|
</select>
|
2017-07-05 05:16:57 +00:00
|
|
|
</div>
|
2020-04-10 21:54:53 +00:00
|
|
|
<input class="form-control" ng-if="formValues.isCustomCommand" type="text" name="custom-command" ng-model="formValues.customCommand" placeholder="e.g. ps aux" />
|
2016-10-26 03:29:29 +00:00
|
|
|
</div>
|
2020-04-10 21:54:53 +00:00
|
|
|
</div>
|
2016-10-26 03:29:29 +00:00
|
|
|
<!-- !command-list -->
|
2017-07-10 07:10:10 +00:00
|
|
|
<div class="form-group col-lg-12">
|
|
|
|
<label for="command" class="text-left control-label">Use custom command</label>
|
2021-12-22 02:34:55 +00:00
|
|
|
<label class="switch" style="margin-left: 20px"> <input type="checkbox" ng-model="formValues.isCustomCommand" /><i></i> </label>
|
2017-07-10 07:10:10 +00:00
|
|
|
</div>
|
2017-07-05 05:16:57 +00:00
|
|
|
<div class="form-group">
|
2021-12-22 02:34:55 +00:00
|
|
|
<label class="col-lg-1 text-left col-sm-2 control-label">
|
2017-07-05 05:16:57 +00:00
|
|
|
User
|
|
|
|
<portainer-tooltip position="bottom" message="Format is one of: user, user:group, uid or uid:gid"></portainer-tooltip>
|
|
|
|
</label>
|
|
|
|
<div class="col-lg-11 col-sm-10">
|
2021-12-22 02:34:55 +00:00
|
|
|
<input class="form-control" type="text" ng-model="formValues.user" placeholder="root" />
|
2017-07-05 05:16:57 +00:00
|
|
|
</div>
|
2016-08-03 03:11:09 +00:00
|
|
|
</div>
|
2017-07-05 05:16:57 +00:00
|
|
|
<div class="form-group">
|
2017-11-12 19:27:28 +00:00
|
|
|
<div class="col-sm-12">
|
2019-05-09 02:04:40 +00:00
|
|
|
<button type="button" class="btn btn-primary" ng-disabled="!container.State.Running" ng-click="connectExec()">
|
|
|
|
<span>Connect</span>
|
2017-11-12 19:27:28 +00:00
|
|
|
</button>
|
2019-05-09 02:04:40 +00:00
|
|
|
<span class="small text-danger" ng-hide="container.State.Running">
|
|
|
|
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
|
|
|
|
The container is not running.
|
|
|
|
</span>
|
2017-07-05 05:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-05-09 02:04:40 +00:00
|
|
|
<div ng-if="state !== states.disconnected">
|
2020-04-10 21:54:53 +00:00
|
|
|
<label
|
|
|
|
>Exec into container as <code>{{ ::formValues.user || 'default user' }}</code> using command
|
|
|
|
<code>{{ formValues.isCustomCommand ? formValues.customCommand : formValues.command }}</code></label
|
|
|
|
>
|
2019-05-09 02:04:40 +00:00
|
|
|
<button type="button" class="btn btn-primary" ng-click="disconnect()">
|
|
|
|
<span ng-show="state === states.connected">Disconnect</span>
|
|
|
|
<span ng-show="state === states.connecting">Connecting...</span>
|
|
|
|
</button>
|
2016-08-03 03:11:09 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</rd-widget-body>
|
|
|
|
</rd-widget>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12 col-md-12 col-xs-12">
|
|
|
|
<div id="terminal-container" class="terminal-container"></div>
|
|
|
|
</div>
|
|
|
|
</div>
|