diff --git a/views/default.handlebars b/views/default.handlebars index 644b8373..6da1779f 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -318,6 +318,7 @@ + @@ -3775,6 +3776,17 @@ if (sort == 0) { nodes.sort(meshSort); } else if (sort == 1) { nodes.sort(powerSort); } else if (sort == 2) { if (showRealNames == true) { nodes.sort(deviceHostSort); } else { nodes.sort(deviceSort); } } + else if (sort == 5) { + // if the last seen column is not turned on, turn it on first (we require this to sort the data) + if (!(deviceViewSettings && deviceViewSettings.devsCols && deviceViewSettings.devsCols.indexOf('lastseen') >= 0)) { + // force initialize the view settings + if (deviceViewSettings == null) { deviceViewSettings = {}; } + if (!Array.isArray(deviceViewSettings.devsCols)) { deviceViewSettings.devsCols = ['user','ip','conn', 'lastseen']; } + else { deviceViewSettings.devsCols.push('lastseen'); } + } + nodes.sort(lastConnectSort); + } + // Compute the width of the device view. var totalDeviceViewWidth = Q('column_l').clientWidth - 60; @@ -3845,7 +3857,7 @@ c = 0; if ((view == 1) || (view == 3) || (view == 5)) { r += '