step1_controller.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. ],
  71. /**
  72. * precondition for the selected KDC option
  73. */
  74. selectedOption: function () {
  75. var options = this.get('options');
  76. var selectedItem = this.get('selectedItem');
  77. return options.findProperty('value', selectedItem);
  78. }.property('selectedItem'),
  79. loadStep: function () {
  80. this.set('selectedItem', Em.I18n.t('admin.kerberos.wizard.step1.option.kdc'));
  81. },
  82. next: function () {
  83. if (!this.get('isSubmitDisabled')) {
  84. App.router.send('next');
  85. }
  86. }
  87. });