Files
threshold-ui/ui/desktop/app/controllers/application.js
T

52 lines
1005 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
2020-11-13 15:20:26 -05:00
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
import { action } from '@ember/object';
2020-11-13 15:20:26 -05:00
export default class ApplicationController extends Controller {
// =services
@service ipc;
2020-11-13 15:20:26 -05:00
@service session;
@service clusterUrl;
@service flashMessages;
// =actions
/**
* Delegates invalidation to the session service.
*/
@action
invalidateSession() {
this.session.invalidate();
}
/**
* Disconnects from clusterUrl and invalidates session, thereby resetting
* the client and reloading to the onboarding clusterUrl screen.
*/
@action
disconnect() {
this.clusterUrl.resetClusterUrl();
this.invalidateSession();
}
@action
minimize() {
this.ipc.invoke('minimizeWindow');
}
@action
toggleFullScreen() {
this.ipc.invoke('toggleFullscreenWindow');
}
@action
close() {
this.ipc.invoke('closeWindow');
}
2020-11-13 15:20:26 -05:00
}