/
summary.js
68 lines (52 loc) · 2.79 KB
/
summary.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import Ember from 'ember';
import NeedsDeploymentMixin from "../../mixins/needs-deployment-mixin";
export default Ember.Controller.extend(NeedsDeploymentMixin, {
isRhev: Ember.computed.alias('deploymentController.isRhev'),
isOpenStack: Ember.computed.alias('deploymentController.isOpenStack'),
isOpenShift: Ember.computed.alias('deploymentController.isOpenShift'),
isCloudForms: Ember.computed.alias('deploymentController.isCloudForms'),
isRhevOpen: true,
isOpenStackOpen: true,
isCloudFormsOpen: true,
isOpenShiftOpen: true,
undercloudUsername: 'admin',
undercloudPassword: Ember.computed.alias("model.openstack_deployment.undercloud_admin_password"),
overcloudUsername: 'admin',
overcloudPassword: Ember.computed.alias("model.openstack_deployment.overcloud_password"),
overcloudUrlIP: Ember.computed('model.openstack_deployment.overcloud_hostname', function() {
return ('http://' + this.get('model.openstack_deployment.overcloud_address') + '/dashboard/admin');
}),
selectedRhevEngine: Ember.computed.alias('model.discovered_host'),
deploymentLabel: Ember.computed.alias('deploymentController.model.label'),
exampleAppUrl: Ember.computed('deploymentController.defaultDomainName', function() {
const domainName = this.get('deploymentController.defaultDomainName');
const subdomainName = this.get('model.openshift_subdomain_name');
return `http://hello-openshift.${subdomainName}.${domainName}`;
}),
rhevEngineUrl: Ember.computed('selectedRhevEngine.name', 'selectedRhevEngine.domain_name', function() {
// The cached version of the model for selectedRhevEngine has a stale name without the domain name,
// but is of type Host::Managed, so we can't tell if it needs to add the domain based on Discovered/Managed.
// We just add in the domain if we can't find it in the name.
let domainName = this.get('selectedRhevEngine.domain_name');
let engineName = this.get('selectedRhevEngine.name');
if (engineName && domainName && engineName.toLowerCase().indexOf(domainName.toLowerCase()) < 0) {
engineName = `${engineName}.${domainName}`;
}
return ('https://' + engineName + '/ovirt-engine/');
}),
rhevEngineUrlIP: Ember.computed('selectedRhevEngine.ip', function() {
return ('https://' + this.get('selectedRhevEngine.ip') + '/ovirt-engine/');
}),
cfmeUrl: Ember.computed('model.cfme_hostname', function() {
return ('https://' + this.get('model.cfme_hostname'));
}),
cfmeUrlIP: Ember.computed('model.cfme_address', function() {
return ('https://' + this.get('model.cfme_address'));
}),
cfmeUrlSelfService: Ember.computed('cfmeUrl', function() {
return (this.get('cfmeUrl') + '/self_service');
}),
cfmeUrlSelfServiceIP: Ember.computed('cfmeUrlIP', function() {
return (this.get('cfmeUrlIP') + '/self_service');
})
});