-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

View File

@@ -0,0 +1,49 @@
(function () {
'use strict';
angular
.module('app')
.controller('SettingsCtrl', SettingsCtrl);
SettingsCtrl.$inject = ['$scope', 'smartRequest', 'Notification'];
function SettingsCtrl($scope, smartRequest, Notification) {
$scope.settings = [];
$scope.terminalKey = '';
$scope.menuCode = '';
$scope.listSettings = function () {
$scope.settings = [];
smartRequest.get('settings/all?global=0', function (data) {
$scope.settings = $scope.settings.concat(data.settings);
});
smartRequest.get('v1/settings', function (data) {
$scope.settings = $scope.settings.concat(data.settings);
});
};
$scope.onSettingChange = function (setting) {
if (setting.value.length > 0) {
smartRequest.post('settings/update', {
code: setting.code,
value: setting.value
});
Notification.success('Настройки обновлены');
}
};
$scope.getRealisation = function() {
smartRequest.get('sync/realisation?terminal=' + $scope.terminalKey + '&menu=' + $scope.menuCode, function(data) {
});
};
$scope.switchDishes = function() {
smartRequest.get('sync/replace/dishes', function(data) {
console.log(data);
});
};
$scope.listSettings();
}
})();