mirror of
https://github.com/openstf/stf
synced 2025-10-06 03:50:04 +02:00
Added force kicking.
This commit is contained in:
parent
59261b3c98
commit
4b98da269b
3 changed files with 13 additions and 3 deletions
|
@ -29,8 +29,8 @@ module.exports = function GroupServiceFactory(
|
|||
})
|
||||
}
|
||||
|
||||
groupService.kick = function (device) {
|
||||
if (!device.usable) {
|
||||
groupService.kick = function (device, force) {
|
||||
if (!force && !device.usable) {
|
||||
return Promise.reject(new Error('Device is not usable'))
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,14 @@ module.exports = function DeviceListCtrlDetails($scope, DeviceService, GroupServ
|
|||
}
|
||||
}
|
||||
|
||||
$scope.tryToKick = function (device) {
|
||||
if (device.state === 'busy') {
|
||||
if (confirm(gettext('Are you sure you want to kick this device?\nCurrently it is being used by ') + device.owner.name)) {
|
||||
$scope.kick(device, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$scope.columns = [
|
||||
{ title: 'Model', field: 'model', sortable: 'model', filter: {model: 'text'}, visible: true
|
||||
}
|
||||
|
|
|
@ -54,7 +54,8 @@ div.stf-device-list
|
|||
"btn-primary": device.state == "using",\
|
||||
"btn-primary-outline": device.state == "available",\
|
||||
"btn-warning": device.state == "busy"\
|
||||
}'
|
||||
}',
|
||||
ng-dblclick='tryToKick(device)',
|
||||
).btn.btn-xs.device-status {{device.state|statusName|translate}}
|
||||
.clear-fix
|
||||
|
||||
|
@ -95,6 +96,7 @@ div.stf-device-list
|
|||
"btn-primary-outline": device.state == "available",\
|
||||
"btn-warning": device.state == "busy"\
|
||||
}',
|
||||
ng-dblclick='tryToKick(device)',
|
||||
ng-click='device.usable && toggle(device)').btn.btn-xs.device-status {{device.state|statusName|translate}}
|
||||
|
||||
td(data-title="'Model'|translate", sortable='"model"', filter='{"model": "text"}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue