Fix scope use in logs.js and terminal.js
This commit is contained in:
@@ -360,39 +360,46 @@ app.controller('TerminalController', ['$scope', '$timeout', '$location', 'Client
|
||||
return;
|
||||
}
|
||||
|
||||
Client.refreshConfig(function (error) {
|
||||
// check version and force reload if needed
|
||||
if (!localStorage.version) {
|
||||
localStorage.version = status.version;
|
||||
} else if (localStorage.version !== status.version) {
|
||||
localStorage.version = status.version;
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
console.log('Running terminal version ', localStorage.version);
|
||||
|
||||
// get user profile as the first thing. this populates the "scope" and affects subsequent API calls
|
||||
Client.refreshUserInfo(function (error) {
|
||||
if (error) return $scope.error(error);
|
||||
|
||||
// check version and force reload if needed
|
||||
if (!localStorage.version) {
|
||||
localStorage.version = Client.getConfig().version;
|
||||
} else if (localStorage.version !== Client.getConfig().version) {
|
||||
localStorage.version = Client.getConfig().version;
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
Client.refreshInstalledApps(function (error) {
|
||||
Client.refreshConfig(function (error) {
|
||||
if (error) return $scope.error(error);
|
||||
|
||||
Client.getInstalledApps().forEach(function (app) {
|
||||
$scope.apps.push({
|
||||
type: 'app',
|
||||
value: app.id,
|
||||
name: app.fqdn + ' (' + app.manifest.title + ')',
|
||||
addons: app.manifest.addons
|
||||
Client.refreshInstalledApps(function (error) {
|
||||
if (error) return $scope.error(error);
|
||||
|
||||
Client.getInstalledApps().forEach(function (app) {
|
||||
$scope.apps.push({
|
||||
type: 'app',
|
||||
value: app.id,
|
||||
name: app.fqdn + ' (' + app.manifest.title + ')',
|
||||
addons: app.manifest.addons
|
||||
});
|
||||
});
|
||||
|
||||
// activate pre-selected log from query otherwise choose the first one
|
||||
$scope.selected = $scope.apps.find(function (e) { return e.value === search.id; });
|
||||
if (!$scope.selected) $scope.selected = $scope.apps[0];
|
||||
|
||||
// now mark the Client to be ready
|
||||
Client.setReady();
|
||||
|
||||
$scope.initialized = true;
|
||||
|
||||
showTerminal();
|
||||
});
|
||||
|
||||
// activate pre-selected log from query otherwise choose the first one
|
||||
$scope.selected = $scope.apps.find(function (e) { return e.value === search.id; });
|
||||
if (!$scope.selected) $scope.selected = $scope.apps[0];
|
||||
|
||||
// now mark the Client to be ready
|
||||
Client.setReady();
|
||||
|
||||
$scope.initialized = true;
|
||||
|
||||
showTerminal();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user