2016-08-03 03:11:09 +00:00
|
|
|
<rd-header>
|
|
|
|
<rd-header-title title="Container console">
|
|
|
|
<i id="loadingViewSpinner" class="fa fa-cog fa-spin"></i>
|
|
|
|
</rd-header-title>
|
2016-10-26 03:29:29 +00:00
|
|
|
<rd-header-content ng-if="state.loaded">
|
2017-07-08 08:23:00 +00:00
|
|
|
<a ui-sref="containers">Containers</a> > <a ui-sref="container({id: container.Id})">{{ container.Name|trimcontainername }}</a> > Console
|
2016-08-03 03:11:09 +00:00
|
|
|
</rd-header-content>
|
|
|
|
</rd-header>
|
|
|
|
|
2016-10-26 03:29:29 +00:00
|
|
|
<div class="row" ng-if="state.loaded">
|
2016-08-03 03:11:09 +00:00
|
|
|
<div class="col-lg-12 col-md-12 col-xs-12">
|
|
|
|
<rd-widget>
|
|
|
|
<rd-widget-header icon="fa-terminal" title="Console">
|
|
|
|
<div class="pull-right">
|
|
|
|
<i id="loadConsoleSpinner" class="fa fa-cog fa-2x fa-spin" style="margin-top: 5px; display: none;"></i>
|
|
|
|
</div>
|
|
|
|
</rd-widget-header>
|
|
|
|
<rd-widget-body>
|
2017-07-05 05:16:57 +00:00
|
|
|
<form class="form-horizontal">
|
|
|
|
<div ng-if="!state.connected">
|
2016-10-26 03:29:29 +00:00
|
|
|
<!-- command-list -->
|
2017-07-05 05:16:57 +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">
|
2017-07-10 07:10:10 +00:00
|
|
|
<div class="input-group" ng-if="!formValues.isCustomCommand">
|
2017-07-05 05:16:57 +00:00
|
|
|
<span class="input-group-addon">
|
|
|
|
<i class="fa fa-linux" aria-hidden="true" ng-if="imageOS == 'linux'"></i>
|
|
|
|
<i class="fa fa-windows" aria-hidden="true" ng-if="imageOS == 'windows'"></i>
|
|
|
|
</span>
|
2017-07-10 07:10:10 +00:00
|
|
|
<select class="form-control" ng-model="formValues.command" id="command">
|
2017-07-05 05:16:57 +00:00
|
|
|
<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>
|
|
|
|
</select>
|
|
|
|
</div>
|
2017-07-10 07:10:10 +00:00
|
|
|
<input class="form-control" ng-if="formValues.isCustomCommand" type="text" name="custom-command" ng-model="formValues.customCommand" placeholder="e.g. ps aux">
|
2017-07-05 05:16:57 +00:00
|
|
|
</div>
|
2016-10-26 03:29:29 +00:00
|
|
|
</div>
|
|
|
|
<!-- !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>
|
|
|
|
<label class="switch" style="margin-left: 20px;">
|
|
|
|
<input type="checkbox" ng-model="formValues.isCustomCommand"><i></i>
|
|
|
|
</label>
|
|
|
|
</div>
|
2017-07-05 05:16:57 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="username" class="col-lg-1 text-left col-sm-2 control-label">
|
|
|
|
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">
|
2017-07-10 07:10:10 +00:00
|
|
|
<input class="form-control" type="text" name="username" 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">
|
|
|
|
<div class="col-lg-offset-1 col-sm-offset-2 col-lg-11 col-sm-10">
|
|
|
|
<button type="button" class="btn btn-primary" ng-click="connect()">Connect</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div ng-if="state.connected">
|
2017-07-13 16:04:58 +00:00
|
|
|
<label>Exec into container as <code>{{ ::formValues.user || 'default user' }}</code> using command <code>{{ formValues.isCustomCommand ? formValues.customCommand : formValues.command }}</code></label>
|
2017-07-05 05:16:57 +00:00
|
|
|
<button type="button" class="btn btn-default" ng-click="disconnect()">Disconnect</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>
|