Skip to content

Commit

Permalink
preserve routing when using http fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
tariqbuilds committed May 13, 2017
1 parent c8cc31a commit 8ab6733
Show file tree
Hide file tree
Showing 4 changed files with 2,337 additions and 14 deletions.
2,335 changes: 2,329 additions & 6 deletions app/linuxDash.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ g.task('generate-js-dist', ['template-cache'], function () {
])
.pipe(concat('linuxDash.min.js'))
.pipe(ngAnnotate())
.pipe(uglify())
// .pipe(uglify())
.on('error', gutil.log)
.pipe(g.dest('app/'))
})
Expand Down
10 changes: 6 additions & 4 deletions src/js/core/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
function runFn(server, $location, $rootScope) {

server.checkIfWebsocketsAreSupported()

var currentRoute = $location.path()
var currentTab = (currentRoute === '/loading')? 'system-status': currentRoute
localStorage.setItem('currentTab', currentTab)
$rootScope.$on("$locationChangeSuccess", function(event, next, current) {
var nextRoute = next.split('#')[1]
if (nextRoute !== '/loading') {
localStorage.setItem('currentTab', nextRoute)
}
});

$location.path('/loading')
}
Expand Down
4 changes: 1 addition & 3 deletions src/js/core/server.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ angular
establishWebsocketConnection();

} else {
// rootScope event not propogating from here.
// instead, we manually route to url
$location.path('/system-status');
$rootScope.$broadcast("start-linux-dash", {});
}

});
Expand Down

0 comments on commit 8ab6733

Please sign in to comment.