Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexryd committed Aug 1, 2021
1 parent bbd7311 commit fca38ce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions admin/static/scripts.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* eslint-env browser,jquery */

function loadDevices() {
var list = $('#devices-list').empty()
const list = $('#devices-list').empty()

$.ajax({
url: '/api/devices',
success: function(result) {
var devices = result.data.slice().sort(function(a, b) {
const devices = result.data.slice().sort(function(a, b) {
return String(a.type + a.id).localeCompare(b.type + b.id)
})

if (devices.length > 0) {
for (var i = 0; i < devices.length; i++) {
for (let i = 0; i < devices.length; i++) {
renderDevice(list, devices[i])
}
} else {
Expand Down Expand Up @@ -66,9 +66,9 @@ function renderDevice(list, device) {
}

function renderLastSeen(device) {
var lastSeen = device.lastSeen
var label, datetime
var title = 'Last seen: '
const lastSeen = device.lastSeen
let label, datetime
let title = 'Last seen: '

if (lastSeen === null) {
label = 'Unknown'
Expand Down Expand Up @@ -97,7 +97,7 @@ function renderLastSeen(device) {
}

function renderStatusBadges(device) {
var badges = [
const badges = [
$('<div>')
.addClass('status-badge')
.addClass(device.online ? 'online' : 'offline')
Expand Down

0 comments on commit fca38ce

Please sign in to comment.