hosts.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.HostInfo = Ember.Object.extend({
  20. elementId: 'host',
  21. name: '',
  22. cpu: null,
  23. memory: null,
  24. message: 'Information',
  25. barColor: 'progress-info',
  26. isChecked: true,
  27. bootLog:null,
  28. bootStatus: 'PENDING',
  29. bootStatusForDisplay: Em.computed.getByKey('bootStatusForDisplayMap', 'bootStatus', 'Registering'),
  30. bootStatusForDisplayMap: {
  31. PENDING: 'Preparing',
  32. REGISTERED: 'Success',
  33. FAILED: 'Failed',
  34. RUNNING: 'Installing',
  35. DONE: 'Registering',
  36. REGISTERING: 'Registering'
  37. },
  38. bootBarColor: Em.computed.getByKey('bootBarColorMap', 'bootStatus', 'progress-info'),
  39. bootBarColorMap: {
  40. REGISTERED: 'progress-success',
  41. FAILED: 'progress-danger',
  42. PENDING: 'progress-info',
  43. RUNNING: 'progress-info',
  44. DONE: 'progress-info',
  45. REGISTERING: 'progress-info'
  46. },
  47. bootStatusColor:Em.computed.getByKey('bootStatusColorMap', 'bootStatus', 'text-info'),
  48. bootStatusColorMap: {
  49. REGISTERED: 'text-success',
  50. FAILED: 'text-error',
  51. PENDING: 'text-info',
  52. RUNNING: 'text-info',
  53. DONE: 'text-info',
  54. REGISTERING: 'text-info'
  55. },
  56. isBootDone: Em.computed.existsIn('bootStatus', ['REGISTERED', 'FAILED'])
  57. });