step1_controller.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.KerberosWizardStep1Controller = Em.Controller.extend({
  20. name: "kerberosWizardStep1Controller",
  21. selectedItem: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
  22. isSubmitDisabled: Em.computed.someBy('selectedOption.preConditions', 'checked', false),
  23. ipaOption: Em.Object.create({
  24. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
  25. value: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa'),
  26. preConditions: [
  27. Em.Object.create({
  28. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.1'),
  29. checked: false
  30. }),
  31. Em.Object.create({
  32. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.2'),
  33. checked: false
  34. }),
  35. Em.Object.create({
  36. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.3'),
  37. checked: false
  38. }),
  39. Em.Object.create({
  40. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ipa.condition.4'),
  41. checked: false
  42. }),
  43. ]
  44. }),
  45. options: Em.A([
  46. Em.Object.create({
  47. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
  48. value: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
  49. preConditions: [
  50. Em.Object.create({
  51. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.1'),
  52. checked: false
  53. }),
  54. Em.Object.create({
  55. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.2'),
  56. checked: false
  57. }),
  58. Em.Object.create({
  59. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.3'),
  60. checked: false
  61. })
  62. ]
  63. }),
  64. Em.Object.create({
  65. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
  66. value: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
  67. preConditions: [
  68. Em.Object.create({
  69. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.1'),
  70. checked: false
  71. }),
  72. Em.Object.create({
  73. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.2'),
  74. checked: false
  75. }),
  76. Em.Object.create({
  77. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.3'),
  78. checked: false
  79. }),
  80. Em.Object.create({
  81. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.4'),
  82. checked: false
  83. }),
  84. Em.Object.create({
  85. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.5'),
  86. checked: false
  87. })
  88. ]
  89. }),
  90. Em.Object.create({
  91. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
  92. value: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
  93. preConditions: [
  94. Em.Object.create({
  95. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.1'),
  96. checked: false
  97. }),
  98. Em.Object.create({
  99. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.2'),
  100. checked: false
  101. }),
  102. Em.Object.create({
  103. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.3'),
  104. checked: false
  105. }),
  106. Em.Object.create({
  107. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.4'),
  108. checked: false
  109. }),
  110. Em.Object.create({
  111. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.5'),
  112. checked: false
  113. })
  114. ]
  115. })
  116. ]),
  117. /**
  118. * precondition for the selected KDC option
  119. */
  120. selectedOption: function () {
  121. var options = this.get('options');
  122. var selectedItem = this.get('selectedItem');
  123. return options.findProperty('value', selectedItem);
  124. }.property('selectedItem'),
  125. loadStep: function () {
  126. this.set('selectedItem', Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
  127. if (App.get('supports.enableIpa')) {
  128. var ipaOption = this.get('ipaOption');
  129. var options = this.get('options');
  130. options.pushObject(ipaOption);
  131. }
  132. },
  133. next: function () {
  134. if (!this.get('isSubmitDisabled')) {
  135. App.router.send('next');
  136. }
  137. }
  138. });