step1_controller.js 4.1 KB

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