Files
stf-DeviceFarmer/res/app/device-list/device-list.jade
Gunther Brunner 692582ce3d Finally fixed disappearing headers from dynamic columns.
Bind-once optimizations.
2014-06-23 14:32:27 +09:00

199 lines
12 KiB
Plaintext

div.stf-device-list
.row.stf-stats-container(ng-show='tracker.devices.length')
.col-md-12
.widget-container.stats-container
.col-md-3
.number
.icon.fa.fa-globe.visitors
span(ng-bind='tracker.devices.length')
.text(translate) Total devices
.col-md-3
.number
.icon.fa.fa-check.visitors
span(ng-bind='(tracker.devices | filter:{usable:true}).length')
.text(translate) Usable devices
.col-md-3
.number
.icon.fa.fa-users.visitors
span(ng-bind='(tracker.devices | filter:{state:"busy"}).length')
.text(translate) Busy devices
.col-md-3
.number
.icon.fa.fa-user.visitors
span(ng-bind='(tracker.devices | filter:{using:true}).length')
//.text(translate) Using
.text(ng-bind='currentUser.name')
.row
.col-md-12
.widget-container.fluid-height
.widget-content.padded
tabset.overflow-auto(ng-if='activeTabs').device-list-active-tabs
tab(active='activeTabs.devices')
tab-heading
i.fa.fa-th-large
span(translate) Devices
div(ng-if='activeTabs.devices').device-list-devices-content
nothing-to-show(message='{{"No devices connected"|translate}}', icon='fa-sitemap', ng-show='!tracker.devices.length')
.filtering-buttons.pull-right
input(type='search',results='5', autosave='deviceSearch'
name='deviceSearch', ng-model='deviceSearch', ng-change='deviceSearchChanged()',
autocorrect='off', autocapitalize='off', spellcheck='false').xform-control.device-search
//.input-group
input(type='text').form-control
//span.input-group-btn
button.btn.btn-primary-outline(type='button') Search
//clear-button(ng-click="tableParams.sorting({}); tableParams.filter({})")
.clear-filtering-buttons
ul.devices-icon-view
li(ng-repeat='device in tracker.devices | filter:{usable:true} | filter:{name:deviceSearch} | orderBy:"name" track by device.serial',
ng-click='device.usable && toggle(device)',
popover='{{ ::"Model: " | translate }}{{ ::device.enhancedModel }}', popover-trigger='mouseenter', popover-popup-delay='0',
popover-title='{{ ::device.enhancedName }}', popover-placement='top'
).cursor-select.pointer.thumbnail
.device-photo-small
img(ng-src='{{ ::device.enhancedImage120 }}')
.device-name(ng-bind='::device.enhancedName')
button(ng-class='device.enhancedButtonClass', ng-bind='device.enhancedStateAction | translate').btn.btn-xs.device-status
.clear-fix
.clear-fix
.line
ul.devices-icon-view
li(ng-repeat='device in tracker.devices | filter:{usable:false} | filter:{name:deviceSearch} | orderBy:"name" track by device.serial',
ng-disabled='true',
popover='{{ ::"Model: " | translate }}{{ ::device.enhancedModel }}', popover-trigger='mouseenter', popover-popup-delay='0',
popover-title='{{ ::device.enhancedName }}', popover-placement='top'
).cursor-select.pointer.thumbnail.device-is-busy
.device-photo-small
img(ng-src='{{ ::device.enhancedImage120 }}')
.device-name(ng-bind='::device.enhancedName')
button(ng-class='device.enhancedButtonClass',
ng-dblclick='tryToKick(device)',
ng-bind='device.enhancedStateAction | translate'
).btn.btn-xs.device-status
.clear-fix
tab(active='activeTabs.details', ng-show='!$root.basicMode')
tab-heading
i.fa.fa-list
span(translate) Details
div(ng-if='activeTabs.details', ng-controller='DeviceListDetailsCtrl').device-list-details-content
nothing-to-show(message='{{"No devices connected"|translate}}', icon='fa-sitemap', ng-show='!tracker.devices.length')
.filtering-buttons
div(ng-show='ngTableEnabled')
clear-button(ng-click="clearSorting()")
filter-button(ng-model='filterEnabled')
.button-spacer.pull-right
button(btn-checkbox, ng-model='showAll').btn.btn-sm.btn-primary-outline.pull-right
i.fa.fa-list-alt
span {{"Show All"|translate}}
//span(ng-if='true')
.btn-group(dropdown).pull-right
button.btn.btn-sm.btn-primary-outline.dropdown-toggle
i.fa.fa-list-alt
span {{"Customize"|translate}}
ul.dropdown-menu(role='menu', data-toggle='dropdown').pointer.unselectable.stf-device-details-customize
li(ng-repeat='column in dynamicColumns', ng-click='$event.stopPropagation()')
label.checkbox.pointer
input(type='checkbox', checklist-model='selectedColumns', checklist-value='column')
span(ng-bind='column.title | translate')
//div(ng-if='!ngTableEnabled')
table.table.table-hover.dataTable
thead
tr
th(ng-repeat='column in selectedColumns', ng-show='column.visible')
div {{ column.title | translate }}
tbody
tr(ng-repeat='device in tracker.devices | limitTo:tableLimit', ng-class='{ "device-not-usable": !device.usable }')
td(ng-repeat='column in selectedColumns', ng-if='column.visible', sortable='column.field')
span(ng-if='column.templateUrl', ng-include='column.templateUrl')
span(ng-if='!column.templateUrl') {{ device[column.field] }}
//table.table.ng-table.table-hover.dataTable(ng-table='tableParams').device-list-details
thead
tr
th(ng-repeat='column in selectedColumns', ng-if='column.visible')
div(ng-bind='column.title | translate')
tbody
tr(ng-repeat='device in $data | limitTo:tableLimit', ng-class='{ "device-not-usable": !device.usable }')
td(ng-repeat='column in selectedColumns', ng-if='column.visible', sortable='column.field')
span(ng-if='column.templateUrl', ng-include-cached='column.templateUrl')
span(ng-if='!column.templateUrl', ng-bind='device[column.field]')
table.table.table-hover.dataTable(ng-table='tableParams', show-filter='filterEnabled', ng-show='tracker.devices.length').device-list-details
tr(ng-repeat='device in $data', ng-class='{ "device-not-usable": !device.usable }')
td(data-title="'Status'|translate", sortable='"enhancedStateSorting"',
filter="{ 'usable': 'select' }", filter-data="statusFilter($column)")
button(ng-class='device.enhancedButtonClass',
ng-dblclick='tryToKick(device)',
ng-click='device.usable && toggle(device)',
ng-bind='device.enhancedStateAction | translate').btn.btn-xs.device-status
td(data-title="::'Model'|translate", sortable='"model"', filter='{"model": "text"}')
span.device-small-image
img(ng-src='{{device.enhancedImage24}}')
span(ng-if='device.state !== "using"', ng-bind='::device.enhancedModel')
a(ng-if='device.state === "using"', ng-href='/#!/control/{{ device.serial }}', ng-bind='::device.enhancedModel')
td(data-title="'Product'|translate", sortable='"enhancedName"', filter='{"enhancedName": "text"}').device-list-product
span(ng-bind='::device.enhancedName')
td(data-title="'Carrier'|translate", sortable='"operator"', filter='{"operator": "text"}').device-list-carrier
span(ng-bind='::device.operator')
td(data-title="'Released'|translate", sortable='"enhancedReleasedAt"', filter='{"enhancedReleasedAt": "text"}')
span(ng-bind='::device.enhancedReleasedAt')
td(data-title="'OS'|translate", sortable='"version"', filter='{"version": "text"}')
span(ng-bind='::device.version')
td(data-title="'Network'|translate", sortable='"phone.network"', filter='{"phone": "text"}')
span(ng-bind='device.phone.network')
td(ng-show='showAll', data-title="'Screen'|translate", sortable='"enhanceDisplayRes"', filter='{"enhanceDisplayRes": "text"}')
span(ng-bind='::device.enhanceDisplayRes')
td(ng-show='showAll', data-title="'Serial'|translate", sortable='"serial"', filter='{"serial": "text"}')
span(ng-bind='::device.serial')
td(ng-show='showAll', data-title="'Manufacturer'|translate", sortable='"manufacturer"', filter='{"manufacturer": "text"}')
span(ng-bind='::device.manufacturer')
td(ng-show='showAll', data-title="'SDK'|translate", sortable='"sdk"', filter='{"sdk": "text"}')
span(ng-bind='::device.sdk')
td(ng-show='showAll', data-title="'ABI'|translate", sortable='"abi"', filter='{"abi": "text"}')
span(ng-bind='::device.abi')
td(ng-show='showAll', data-title="'Phone'|translate", sortable='"phone.phoneNumber"')
span(ng-bind='device.phone.phoneNumber')
td(ng-show='showAll', data-title="'Phone IMEI'|translate", sortable='"phone.imei"')
span(ng-bind='device.phone.imei')
td(ng-show='showAll', data-title="'Phone ICCID'|translate", sortable='"phone.iccid"')
span(ng-bind='device.phone.iccid')
td(ng-show='showAll', data-title="'Battery Health'|translate", sortable='"enhancedBatteryHealth"')
span(ng-bind='device.enhancedBatteryHealth | translate')
td(ng-show='showAll', data-title="'Battery Source'|translate", sortable='"enhancedBatterySource"')
span(ng-bind='device.enhancedBatterySource | translate')
td(ng-show='showAll', data-title="'Battery Status'|translate", sortable='"enhancedBatteryStatus"')
span(ng-bind='device.enhancedBatteryStatus | translate')
td(ng-show='showAll', data-title="'Battery Level'|translate", sortable='"battery.level"')
progressbar(value='device.battery.level', max='device.battery.scale', type='success')
span(ng-bind='device.enhancedBatteryPercentage')
td(ng-show='showAll', data-title="'Battery Temperature'|translate", sortable='"battery.temp"')
span(ng-bind='device.enhancedBatteryTemp')
td(data-title="'Location'|translate", sortable='"provider.name"', filter='{"provider": "text"}')
span(ng-bind='::device.provider.name')
td(data-title="'User'|translate", sortable='"owner.name"', filter='{"owner": "text"}')
a(ng-if='device.owner', ng-href='{{ device.enhancedUserContactUrl }}', role='button', target='_href', ng-bind='device.enhancedUserName')
a(ng-if='!device.owner') -
//p
strong Sorting
pre {{tableParams.sorting() | json}}
pre {{tableParams.filter() | json}}