-Add new setting "Delete shift"
-Move "Shift" frontend to V1 module
This commit is contained in:
miroman-afk
2022-02-01 01:55:15 +03:00
parent 57949aa89a
commit 5497b611ef
29 changed files with 1359 additions and 3 deletions

51
web/controllers/market.js Normal file
View File

@@ -0,0 +1,51 @@
(function () {
'use strict';
angular
.module('app')
.controller('MarketCtrl', MarketCtrl);
MarketCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification'];
function MarketCtrl($scope, smartRequest, $location, Notification) {
$scope.key = '';
$scope.getListModules = function () {
smartRequest.get('settings/pay/modules', function (data) {
$scope.modules = data.modules;
});
};
$scope.showModuleActivate = function (id) {
$scope.selectedModule = $scope.getModulerById(id);
$('#activate-module').modal();
};
$scope.activateModule = function () {
$('#btn-activated').prop('disabled', false);
smartRequest.post('settings/activate/module', {
key: $scope.key,
module: $scope.selectedModule.name,
}, function(data) {
if (data.message == 'Активация прошла успешно') {
Notification.success(data.message);
$location.path('/');
} else {
Notification.error(data.message);
}
});
};
$scope.getModulerById = function(id) {
var res;
$scope.modules.forEach(function (item) {
if (item.id == id) {
res = item;
return;
}
});
return res;
};
$scope.getListModules();
}
})();