Files
threshold-ui/ui/desktop/app/controllers/cluster-url.js
T
55e1e68f30 [COMPLIANCE] Update Copyright and License Headers (#3099)
Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
Co-authored-by: Dharini <dharini@hashicorp.com>
2026-01-20 11:35:10 -05:00

36 lines
957 B
JavaScript

/**
* Copyright IBM Corp. 2021, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
import Controller from '@ember/controller';
import { service } from '@ember/service';
import { action } from '@ember/object';
import { loading } from 'ember-loading';
import { notifyError } from 'core/decorators/notify';
export default class ClusterUrlController extends Controller {
// =services
@service router;
@service('cluster-url') clusterUrlService;
// =actions
/**
* Points the API to the specified clusterUrl. When the main process receives
* the clusterUrl, it is expected that the renderer will be restarted.
* @param {string} clusterUrl
*/
@action
@loading
@notifyError(() => 'errors.cluster-url-verification-failed.description', {
catch: true,
log: { origin: 'setClusterUrl' },
})
async setClusterUrl(clusterUrl) {
await this.clusterUrlService.setClusterUrl(clusterUrl);
this.router.replaceWith('index');
}
}