feat(endpoint-creation): add requirement message for agent endpoint (#2303)
parent
94b202fedc
commit
f0f01c33bd
|
@ -1,6 +1,6 @@
|
||||||
angular.module('portainer.app')
|
angular.module('portainer.app')
|
||||||
.controller('CreateEndpointController', ['$q', '$scope', '$state', '$filter', 'EndpointService', 'GroupService', 'TagService', 'Notifications',
|
.controller('CreateEndpointController', ['$q', '$scope', '$state', '$filter', 'clipboard', 'EndpointService', 'GroupService', 'TagService', 'Notifications',
|
||||||
function ($q, $scope, $state, $filter, EndpointService, GroupService, TagService, Notifications) {
|
function ($q, $scope, $state, $filter, clipboard, EndpointService, GroupService, TagService, Notifications) {
|
||||||
|
|
||||||
$scope.state = {
|
$scope.state = {
|
||||||
EnvironmentType: 'docker',
|
EnvironmentType: 'docker',
|
||||||
|
@ -19,6 +19,12 @@ function ($q, $scope, $state, $filter, EndpointService, GroupService, TagService
|
||||||
Tags: []
|
Tags: []
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.copyAgentCommand = function() {
|
||||||
|
clipboard.copyText('curl -L https://portainer.io/download/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent');
|
||||||
|
$('#copyNotification').show();
|
||||||
|
$('#copyNotification').fadeOut(2000);
|
||||||
|
};
|
||||||
|
|
||||||
$scope.addDockerEndpoint = function() {
|
$scope.addDockerEndpoint = function() {
|
||||||
var name = $scope.formValues.Name;
|
var name = $scope.formValues.Name;
|
||||||
var URL = $filter('stripprotocol')($scope.formValues.URL);
|
var URL = $filter('stripprotocol')($scope.formValues.URL);
|
||||||
|
|
|
@ -64,8 +64,16 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<span class="col-sm-12 text-muted small">
|
<span class="col-sm-12 text-muted small">
|
||||||
If you have started Portainer in the same overlay network as the agent, you can use <code>tasks.AGENT_SERVICE_NAME:AGENT_SERVICE_PORT</code> as the
|
Ensure that you have deployed the Portainer agent in your cluster first. You can use execute the following command on any manager node to deploy it.
|
||||||
endpoint URL format.
|
<div style="margin-top: 10px;">
|
||||||
|
<code>
|
||||||
|
curl -L https://portainer.io/download/agent-stack.yml -o agent-stack.yml && docker stack deploy --compose-file=agent-stack.yml portainer-agent
|
||||||
|
</code>
|
||||||
|
<span class="btn btn-primary btn-sm space-left" ng-click="copyAgentCommand()"><i class="fa fa-copy space-right" aria-hidden="true"></i>Copy</span>
|
||||||
|
<span>
|
||||||
|
<i id="copyNotification" class="fa fa-check green-icon" aria-hidden="true" style="margin-left: 7px; display: none;"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue