step1_controller.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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: function() {
  23. return this.get('selectedOption.preConditions').someProperty('checked',false);
  24. }.property('selectedOption', 'selectedOption.preConditions.@each.checked'),
  25. options: [
  26. Em.Object.create({
  27. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
  28. value: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'),
  29. preConditions: [
  30. Em.Object.create({
  31. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.1'),
  32. checked: false
  33. }),
  34. Em.Object.create({
  35. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.2'),
  36. checked: false
  37. }),
  38. Em.Object.create({
  39. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.kdc.condition.3'),
  40. checked: false
  41. })
  42. ]
  43. }),
  44. Em.Object.create({
  45. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
  46. value: Em.I18n.t('admin.kerberos.wizard.step1.option.ad'),
  47. preConditions: [
  48. Em.Object.create({
  49. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.1'),
  50. checked: false
  51. }),
  52. Em.Object.create({
  53. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.2'),
  54. checked: false
  55. }),
  56. Em.Object.create({
  57. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.3'),
  58. checked: false
  59. }),
  60. Em.Object.create({
  61. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.4'),
  62. checked: false
  63. }),
  64. Em.Object.create({
  65. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.ad.condition.5'),
  66. checked: false
  67. })
  68. ]
  69. }),
  70. Em.Object.create({
  71. displayName: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
  72. value: Em.I18n.t('admin.kerberos.wizard.step1.option.manual'),
  73. preConditions: [
  74. Em.Object.create({
  75. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.1'),
  76. checked: false
  77. }),
  78. Em.Object.create({
  79. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.2'),
  80. checked: false
  81. }),
  82. Em.Object.create({
  83. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.3'),
  84. checked: false
  85. }),
  86. Em.Object.create({
  87. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.4'),
  88. checked: false
  89. }),
  90. Em.Object.create({
  91. displayText: Em.I18n.t('admin.kerberos.wizard.step1.option.manual.condition.5'),
  92. checked: false
  93. })
  94. ]
  95. })
  96. ],
  97. /**
  98. * precondition for the selected KDC option
  99. */
  100. selectedOption: function () {
  101. var options = this.get('options');
  102. var selectedItem = this.get('selectedItem');
  103. return options.findProperty('value', selectedItem);
  104. }.property('selectedItem'),
  105. loadStep: function () {
  106. this.set('selectedItem', Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
  107. },
  108. next: function () {
  109. if (!this.get('isSubmitDisabled')) {
  110. App.router.send('next');
  111. }
  112. }
  113. });