mirror of https://github.com/portainer/portainer
feat(core/support): remove support related views
parent
b77e39c065
commit
bd0d1c25fa
|
@ -348,31 +348,6 @@ angular.module('portainer.app', ['portainer.oauth']).config([
|
|||
},
|
||||
};
|
||||
|
||||
var support = {
|
||||
name: 'portainer.support',
|
||||
url: '/support',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: './views/support/support.html',
|
||||
controller: 'SupportController',
|
||||
},
|
||||
},
|
||||
params: {
|
||||
product: {},
|
||||
},
|
||||
};
|
||||
|
||||
var supportProduct = {
|
||||
name: 'portainer.support.product',
|
||||
url: '/product',
|
||||
views: {
|
||||
'content@': {
|
||||
templateUrl: './views/support/product/product.html',
|
||||
controller: 'SupportProductController',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
var tags = {
|
||||
name: 'portainer.tags',
|
||||
url: '/tags',
|
||||
|
@ -454,8 +429,6 @@ angular.module('portainer.app', ['portainer.oauth']).config([
|
|||
$stateRegistryProvider.register(registryCreation);
|
||||
$stateRegistryProvider.register(settings);
|
||||
$stateRegistryProvider.register(settingsAuthentication);
|
||||
$stateRegistryProvider.register(support);
|
||||
$stateRegistryProvider.register(supportProduct);
|
||||
$stateRegistryProvider.register(tags);
|
||||
$stateRegistryProvider.register(users);
|
||||
$stateRegistryProvider.register(user);
|
||||
|
|
|
@ -11,7 +11,7 @@ angular.module('portainer.app').directive('rdHeaderTitle', [
|
|||
},
|
||||
transclude: true,
|
||||
template:
|
||||
'<div class="page white-space-normal">{{titleText}}<span class="header_title_content" ng-transclude></span><span class="pull-right user-box" ng-if="username"><i class="fa fa-user-circle" aria-hidden="true"></i> {{username}}</span><a ui-sref="portainer.support" class="pull-right" style="font-size:14px;margin-right:15px;margin-top:2px;"><span class="fa fa-life-ring fa-fw red-icon"></span> Portainer support</a></div>',
|
||||
'<div class="page white-space-normal">{{titleText}}<span class="header_title_content" ng-transclude></span><span class="pull-right user-box" ng-if="username"><i class="fa fa-user-circle" aria-hidden="true"></i> {{username}}</span></div>',
|
||||
restrict: 'E',
|
||||
};
|
||||
return directive;
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
<rd-header>
|
||||
<rd-header-title title-text="Support option details"></rd-header-title>
|
||||
<rd-header-content> <a ui-sref="portainer.support">Portainer support</a> > {{ product.Name }} </rd-header-content>
|
||||
</rd-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<rd-widget>
|
||||
<rd-widget-body>
|
||||
<div style="display: flex;">
|
||||
<div style="flex-grow: 4; display: flex; flex-direction: column; justify-content: space-between;">
|
||||
<div class="form-group">
|
||||
<div class="text-muted" style="font-size: 150%;">
|
||||
{{ product.Name }}
|
||||
</div>
|
||||
|
||||
<div class="small text-muted" style="margin-top: 5px;"> By <a href="https://portainer.io" href="_blank">Portainer.io</a> </div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="text-muted">
|
||||
{{ product.ShortDescription }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="flex-grow: 1; border-left: 1px solid #777;">
|
||||
<div class="form-group" style="margin-left: 40px;">
|
||||
<div style="font-size: 125%; border-bottom: 2px solid #2d3e63; padding-bottom: 5px;">
|
||||
{{ product.Price }}
|
||||
</div>
|
||||
|
||||
<div class="small text-muted col-sm-12" style="margin: 15px 0 15px 0;">
|
||||
{{ product.PriceDescription }}
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 10px; margin-bottom: 95px;">
|
||||
<label for="endpoint_count" class="col-sm-7 control-label text-left" style="margin-top: 7px;">No. of {{ state.supportType }}(s)</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="number" class="form-control" ng-model="formValues.hostCount" id="endpoint_count" placeholder="{{ state.placeholder }}" min="{{ state.minHosts }}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 15px;">
|
||||
<a href="https://portainer.io/checkout/?add-to-cart={{ product.ProductId }}&quantity={{ formValues.hostCount }}" target="_blank">
|
||||
<button ng-disabled="isBuyButtonEnabled()" class="btn btn-primary btn-sm" style="width: 100%; margin-left: 0;">Buy</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</rd-widget-body>
|
||||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if="product">
|
||||
<div class="col-sm-12">
|
||||
<rd-widget>
|
||||
<rd-widget-body>
|
||||
<div class="col-sm-12 form-section-title">
|
||||
<span>
|
||||
Description
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<span class="small text-muted" style="white-space: pre-line;">{{ product.Description }}</span>
|
||||
</div>
|
||||
</rd-widget-body>
|
||||
</rd-widget>
|
||||
</div>
|
||||
</div>
|
|
@ -1,44 +0,0 @@
|
|||
angular.module('portainer.app').controller('SupportProductController', [
|
||||
'$scope',
|
||||
'$transition$',
|
||||
function ($scope, $transition$) {
|
||||
$scope.formValues = {
|
||||
hostCount: 0,
|
||||
};
|
||||
|
||||
$scope.state = {
|
||||
minHosts: 0,
|
||||
placeholder: 0,
|
||||
supportType: '',
|
||||
};
|
||||
|
||||
$scope.isBuyButtonEnabled = function () {
|
||||
return !$scope.formValues.hostCount || $scope.formValues.hostCount < $scope.state.minHosts;
|
||||
};
|
||||
|
||||
function initView() {
|
||||
$scope.product = $transition$.params().product;
|
||||
|
||||
if ($scope.product.Id == 1) {
|
||||
$scope.formValues.hostCount = 1;
|
||||
$scope.state.minHosts = 1;
|
||||
$scope.state.placeholder = 1;
|
||||
$scope.state.supportType = 'Person';
|
||||
}
|
||||
if ($scope.product.Id == 2 || $scope.product.Id == 3) {
|
||||
$scope.formValues.hostCount = 4;
|
||||
$scope.state.minHosts = 4;
|
||||
$scope.state.placeholder = 4;
|
||||
$scope.state.supportType = 'Host';
|
||||
}
|
||||
if ($scope.product.Id == 4 || $scope.product.Id == 5) {
|
||||
$scope.formValues.hostCount = 10;
|
||||
$scope.state.minHosts = 10;
|
||||
$scope.state.placeholder = 10;
|
||||
$scope.state.supportType = 'Host';
|
||||
}
|
||||
}
|
||||
|
||||
initView();
|
||||
},
|
||||
]);
|
|
@ -1,12 +0,0 @@
|
|||
<rd-header>
|
||||
<rd-header-title title-text="Portainer support"> </rd-header-title>
|
||||
<rd-header-content>
|
||||
Commercial support options
|
||||
</rd-header-content>
|
||||
</rd-header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<product-list title-text="Available support options" products="products" go-to="goToProductView"></product-list>
|
||||
</div>
|
||||
</div>
|
|
@ -1,23 +0,0 @@
|
|||
angular.module('portainer.app').controller('SupportController', [
|
||||
'$scope',
|
||||
'$state',
|
||||
'SupportService',
|
||||
'Notifications',
|
||||
function ($scope, $state, SupportService, Notifications) {
|
||||
$scope.goToProductView = function (product) {
|
||||
$state.go('portainer.support.product', { product: product });
|
||||
};
|
||||
|
||||
function initView() {
|
||||
SupportService.supportProducts()
|
||||
.then(function success(data) {
|
||||
$scope.products = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to fetch support options');
|
||||
});
|
||||
}
|
||||
|
||||
initView();
|
||||
},
|
||||
]);
|
Loading…
Reference in New Issue