123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- var App = require('app');
- App.ServiceInfo = Em.Object.extend({
- elementId: 'service',
- serviceName: '',
- displayName: '',
- isMaster: '',
- isClient: '',
- isDisabled: '',
- isHidden: '',
- isSelected: 'true',
- description: ''
- });
- /*App.User = Em.Object.extend({
- username: null
- });*/
- App.ServiceModel = Em.Object.extend({
- name:null,
- components:[]
- });
- // uncomment if column names are camelized in JSON (or fixture), rather than _ separated
- /*
- DS.Model.reopen({
- namingConvention: {
- keyToJSONKey: function(key) {
- return key;
- },
- foreignKey: function(key) {
- return key;
- }
- }
- });
- */
- App.Component = DS.Model.extend({
- componentName:DS.attr('string'),
- label:DS.attr('string'),
- type:DS.attr('boolean'),
- service:DS.belongsTo('App.Service'),
- host:DS.belongsTo('App.Host'),
- workStatus: DS.attr('boolean')
- });
- App.Component.FIXTURES = [
- {
- id:1,
- component_name:'NameNode',
- label: 'NN',
- type: true,
- service_id:1,
- host_id:1,
- work_status:false
- },
- {
- id:2,
- component_name:'SNameNode',
- label: 'SNN',
- type: true,
- service_id:1,
- host_id:2,
- work_status:true
- },
- {
- id:3,
- component_name:'DataNode',
- label: 'DN',
- service_id:1,
- type: false,
- host_id:2,
- work_status:true
- },
- {
- id:4,
- component_name:'JobTracker',
- label: 'JT',
- type: true,
- service_id:2,
- host_id:4,
- work_status:true
- },
- {
- id:5,
- component_name:'TaskTracker',
- label: 'TT',
- type: false,
- service_id:2,
- host_id:4,
- work_status:true
- },
- {
- id:6,
- component_name:'HBase Master',
- label: 'HBM',
- type: true,
- service_id:3,
- host_id:4,
- work_status:true
- },
- {
- id:7,
- component_name:'Region Server',
- label: 'RS',
- type: false,
- service_id:3,
- host_id:2,
- work_status:true
- }
- ];
- App.Service = DS.Model.extend({
- serviceName: DS.attr('string'),
- label: DS.attr('string'),
- components: DS.hasMany('App.Component'),
- serviceAudit: DS.hasMany('App.ServiceAudit'),
- healthStatus: DS.attr('string'),
- workStatus: DS.attr('boolean'),
- alerts: DS.hasMany('App.Alert'),
- quickLinks: DS.hasMany('App.QuickLinks')
- });
- App.Service.Health = {
- live: "LIVE",
- dead: "DEAD",
- start: "STARTING",
- stop: "STOPPING"
- }
- App.Service.FIXTURES = [
- {
- id:1,
- service_name:'hdfs',
- label:'HDFS',
- components: [1, 2, 3],
- service_audit: [1, 2, 3],
- health_status: 'LIVE',
- work_status: true,
- alerts: [1, 2],
- quick_links: [1, 2, 3, 4]
- },
- {
- id:2,
- service_name:'mapreduce',
- label:'MapReduce',
- components: [4, 5],
- service_audit: [4, 5, 6],
- health_status: 'STARTING',
- work_status: true,
- alerts: [3, 4],
- quick_links: [5, 6, 7, 8, 9, 10]
- },
- {
- id:3,
- service_name:'hbase',
- label:'HBase',
- components: [6, 7],
- health_status: 'DEAD',
- work_status: false,
- alerts: [5, 6],
- quick_links: [11, 12, 13, 14]
- },
- {
- id:4,
- service_name:'zookeeper',
- label:'Zookeeper',
- health_status: 'STOPPING',
- work_status: false,
- alerts: [7, 8]
- },
- {
- id:5,
- service_name:'oozie',
- label:'Oozie',
- health_status: 'DEAD',
- work_status: false,
- alerts: [9, 10]
- },
- {
- id:6,
- service_name:'hive',
- label:'Hive',
- health_status: 'DEAD',
- work_status: false,
- alerts: [11, 12]
- }
- ];
- App.QuickLinks = DS.Model.extend({
- label: DS.attr('string'),
- url: DS.attr('string')
- });
- App.QuickLinks.FIXTURES = [
- {
- id: 1,
- label: 'NameNode UI',
- url: ''
- },
- {
- id: 2,
- label: 'NameNode logs',
- url: ''
- },
- {
- id: 3,
- label: 'NameNode JMX',
- url: ''
- },
- {
- id: 4,
- label: 'Thread Stacks',
- url: ''
- },
- {
- id: 5,
- label: 'JobTracker UI',
- url: ''
- },
- {
- id: 6,
- label: 'Scheduling Info',
- url: ''
- },
- {
- id: 7,
- label: 'Running Jobs',
- url: ''
- },
- {
- id: 8,
- label: 'Retired Jobs',
- url: ''
- },
- {
- id: 9,
- label: 'JobHistory Server',
- url: ''
- },
- {
- id: 10,
- label: 'JobTracker Logs',
- url: ''
- },
- {
- id: 11,
- label: 'HBase Master UI',
- url: ''
- },
- {
- id: 12,
- label: 'HBase Logs',
- url: ''
- },
- {
- id: 13,
- label: 'Zookeeper Info',
- url: ''
- },
- {
- id: 14,
- label: 'HBase Master JMX',
- url: ''
- }
- ];
|