add cashOut attribute to machines API
This commit is contained in:
parent
db97533d5c
commit
87a4236313
3 changed files with 109 additions and 116 deletions
|
|
@ -28,8 +28,11 @@ function getMachineNames (config) {
|
|||
return Promise.all([getMachines(), getConfig(config)])
|
||||
.then(([machines, config]) => {
|
||||
const addName = r => {
|
||||
const name = configManager.machineScoped(r.deviceId, config).machineName
|
||||
return _.set('name', name, r)
|
||||
const machineScoped = configManager.machineScoped(r.deviceId, config)
|
||||
const name = machineScoped.machineName
|
||||
const cashOut = machineScoped.cashOutEnabled
|
||||
|
||||
return _.assign(r, {name, cashOut})
|
||||
}
|
||||
|
||||
return _.map(addName, machines)
|
||||
|
|
|
|||
272
public/elm.js
272
public/elm.js
|
|
@ -27493,6 +27493,7 @@ var _user$project$Css_Classes$InvalidComponent = {ctor: 'InvalidComponent'};
|
|||
var _user$project$Css_Classes$FocusedComponent = {ctor: 'FocusedComponent'};
|
||||
var _user$project$Css_Classes$Component = {ctor: 'Component'};
|
||||
var _user$project$Css_Classes$NoInput = {ctor: 'NoInput'};
|
||||
var _user$project$Css_Classes$CellDisabled = {ctor: 'CellDisabled'};
|
||||
var _user$project$Css_Classes$BasicInputReadOnly = {ctor: 'BasicInputReadOnly'};
|
||||
var _user$project$Css_Classes$BasicInputDisabled = {ctor: 'BasicInputDisabled'};
|
||||
var _user$project$Css_Classes$BasicInput = {ctor: 'BasicInput'};
|
||||
|
|
@ -32729,9 +32730,9 @@ var _user$project$Maintenance_Types$SubModel = F2(
|
|||
function (a, b) {
|
||||
return {status: a, machines: b};
|
||||
});
|
||||
var _user$project$Maintenance_Types$Machine = F6(
|
||||
function (a, b, c, d, e, f) {
|
||||
return {deviceId: a, name: b, cashbox: c, cassette1: d, cassette2: e, paired: f};
|
||||
var _user$project$Maintenance_Types$Machine = F7(
|
||||
function (a, b, c, d, e, f, g) {
|
||||
return {deviceId: a, name: b, cashbox: c, cassette1: d, cassette2: e, paired: f, cashOut: g};
|
||||
});
|
||||
var _user$project$Maintenance_Types$NotSaving = {ctor: 'NotSaving'};
|
||||
var _user$project$Maintenance_Types$Editing = {ctor: 'Editing'};
|
||||
|
|
@ -34117,15 +34118,16 @@ var _user$project$Maintenance_Rest$encodeAction = function (action) {
|
|||
});
|
||||
}
|
||||
};
|
||||
var _user$project$Maintenance_Rest$machineDecoder = A7(
|
||||
_elm_lang$core$Json_Decode$map6,
|
||||
var _user$project$Maintenance_Rest$machineDecoder = A8(
|
||||
_elm_lang$core$Json_Decode$map7,
|
||||
_user$project$Maintenance_Types$Machine,
|
||||
A2(_elm_lang$core$Json_Decode$field, 'deviceId', _elm_lang$core$Json_Decode$string),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'name', _elm_lang$core$Json_Decode$string),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'cashbox', _elm_lang$core$Json_Decode$int),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'cassette1', _elm_lang$core$Json_Decode$int),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'cassette2', _elm_lang$core$Json_Decode$int),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'paired', _elm_lang$core$Json_Decode$bool));
|
||||
A2(_elm_lang$core$Json_Decode$field, 'paired', _elm_lang$core$Json_Decode$bool),
|
||||
A2(_elm_lang$core$Json_Decode$field, 'cashOut', _elm_lang$core$Json_Decode$bool));
|
||||
var _user$project$Maintenance_Rest$machinesDecoder = A2(
|
||||
_elm_lang$core$Json_Decode$map,
|
||||
_elm_lang$core$Basics$identity,
|
||||
|
|
@ -34718,142 +34720,7 @@ var _user$project$Maintenance_View$inputCassetteView = F3(
|
|||
{ctor: '[]'});
|
||||
});
|
||||
var _user$project$Maintenance_View$rowView = function (machine) {
|
||||
var actions = machine.paired ? {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$button,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$TableButton,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html_Events$onClick(
|
||||
_user$project$Maintenance_Types$Submit(
|
||||
_user$project$Maintenance_Types$ResetCashOutBills(machine))),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Reset Bills'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$button,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$TableButton,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html_Events$onClick(
|
||||
_user$project$Maintenance_Types$Submit(
|
||||
_user$project$Maintenance_Types$UnpairMachine(machine))),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Unpair'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
} : {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$button,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$TableButton,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html_Events$onClick(
|
||||
_user$project$Maintenance_Types$Submit(
|
||||
_user$project$Maintenance_Types$ResetCashOutBills(machine))),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Reset Bills'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$NoInput,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Unpaired'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
};
|
||||
return A2(
|
||||
_elm_lang$html$Html$tr,
|
||||
{ctor: '[]'},
|
||||
A2(
|
||||
_elm_lang$core$Basics_ops['++'],
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text(machine.name),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
var cassetteCounts = machine.cashOut ? {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
|
|
@ -34915,9 +34782,128 @@ var _user$project$Maintenance_View$rowView = function (machine) {
|
|||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
} : {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$CellDisabled,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
},
|
||||
{ctor: '[]'}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$CellDisabled,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
},
|
||||
{ctor: '[]'}),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
};
|
||||
var resetBills = machine.cashOut ? A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$button,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$TableButton,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html_Events$onClick(
|
||||
_user$project$Maintenance_Types$Submit(
|
||||
_user$project$Maintenance_Types$ResetCashOutBills(machine))),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
},
|
||||
actions));
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Update Counts'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}) : A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{ctor: '[]'});
|
||||
var actions = {
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$button,
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Admin$class(
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _user$project$Css_Classes$TableButton,
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html_Events$onClick(
|
||||
_user$project$Maintenance_Types$Submit(
|
||||
_user$project$Maintenance_Types$UnpairMachine(machine))),
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text('Unpair'),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {
|
||||
ctor: '::',
|
||||
_0: resetBills,
|
||||
_1: {ctor: '[]'}
|
||||
}
|
||||
};
|
||||
return A2(
|
||||
_elm_lang$html$Html$tr,
|
||||
{ctor: '[]'},
|
||||
A2(
|
||||
_elm_lang$core$Basics_ops['++'],
|
||||
{
|
||||
ctor: '::',
|
||||
_0: A2(
|
||||
_elm_lang$html$Html$td,
|
||||
{ctor: '[]'},
|
||||
{
|
||||
ctor: '::',
|
||||
_0: _elm_lang$html$Html$text(machine.name),
|
||||
_1: {ctor: '[]'}
|
||||
}),
|
||||
_1: {ctor: '[]'}
|
||||
},
|
||||
A2(_elm_lang$core$Basics_ops['++'], cassetteCounts, actions)));
|
||||
};
|
||||
var _user$project$Maintenance_View$tableView = function (machines) {
|
||||
return _elm_lang$core$List$isEmpty(machines) ? A2(
|
||||
|
|
|
|||
|
|
@ -365,6 +365,10 @@ p {
|
|||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.lamassuAdminConfigTable .lamassuAdminCellDisabled {
|
||||
background: repeating-linear-gradient(45deg,#dfdfdc,#dfdfdc 2px,#e6e6e3 5px);
|
||||
}
|
||||
|
||||
.lamassuAdminConfigTable .lamassuAdminBasicInputDisabled {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue