You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/03/14 00:46:47 UTC
svn commit: r1456278 - in /incubator/ambari/trunk: ./ ambari-web/app/
ambari-web/app/assets/data/configuration/
ambari-web/app/assets/data/services/
ambari-web/app/controllers/main/service/info/ ambari-web/app/styles/
ambari-web/app/templates/common/ a...
Author: yusaku
Date: Wed Mar 13 23:46:46 2013
New Revision: 1456278
URL: http://svn.apache.org/r1456278
Log:
AMBARI-1632. Provide property filtering capability on service config sections. (yusaku)
Added:
incubator/ambari/trunk/ambari-web/app/assets/data/configuration/
incubator/ambari/trunk/ambari-web/app/assets/data/configuration/core-site.json
incubator/ambari/trunk/ambari-web/app/assets/data/configuration/global.json
incubator/ambari/trunk/ambari-web/app/assets/data/configuration/hdfs-site.json
incubator/ambari/trunk/ambari-web/app/assets/data/services/hdfs.json
incubator/ambari/trunk/ambari-web/app/templates/common/filter_combobox.hbs
incubator/ambari/trunk/ambari-web/app/views/common/filter_combobox.js
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
incubator/ambari/trunk/ambari-web/app/messages.js
incubator/ambari/trunk/ambari-web/app/styles/application.less
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs
incubator/ambari/trunk/ambari-web/app/views.js
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Wed Mar 13 23:46:46 2013
@@ -119,6 +119,9 @@ Trunk (unreleased changes):
IMPROVEMENTS
+ AMBARI-1632. Provide property filtering capability on service config
+ sections. (yusaku)
+
AMBARI-1631. Security Wizard - integrate host progress popup. (yusaku)
AMBARI-1604. Refactor wizard classes. (yusaku)
Added: incubator/ambari/trunk/ambari-web/app/assets/data/configuration/core-site.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/configuration/core-site.json?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/configuration/core-site.json (added)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/configuration/core-site.json Wed Mar 13 23:46:46 2013
@@ -0,0 +1,28 @@
+{
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations/?type=core-site&tag=version1&_=1363102423792",
+ "items" : [
+ {
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations?type=core-site&tag=version1",
+ "tag" : "version1",
+ "type" : "core-site",
+ "Config" : {
+ "cluster_name" : "mycluster"
+ },
+ "properties" : {
+ "io.serializations" : "org.apache.hadoop.io.serializer.WritableSerialization",
+ "fs.checkpoint.size" : "0.5",
+ "io.file.buffer.size" : "131072",
+ "fs.checkpoint.period" : "21600",
+ "io.compression.codec.lzo.class" : "com.hadoop.compression.lzo.LzoCodec",
+ "ipc.client.connection.maxidletime" : "30000",
+ "webinterface.private.actions" : "false",
+ "fs.checkpoint.edits.dir" : "/hadoop/hdfs/namesecondary",
+ "fs.trash.interval" : "360",
+ "fs.default.name" : "hdfs://dev.hortonworks.com:8020",
+ "ipc.client.idlethreshold" : "8000",
+ "fs.checkpoint.dir" : "/hadoop/hdfs/namesecondary",
+ "ipc.client.connect.max.retries" : "50"
+ }
+ }
+ ]
+}
\ No newline at end of file
Added: incubator/ambari/trunk/ambari-web/app/assets/data/configuration/global.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/configuration/global.json?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/configuration/global.json (added)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/configuration/global.json Wed Mar 13 23:46:46 2013
@@ -0,0 +1,95 @@
+{
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations/?type=global&tag=version1",
+ "items" : [
+ {
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations?type=global&tag=version1",
+ "tag" : "version1",
+ "type" : "global",
+ "Config" : {
+ "cluster_name" : "mycluster"
+ },
+ "properties" : {
+ "rca_enabled" : "true",
+ "gmetad_user" : "nobody",
+ "gpl_artifacts_download_url" : "",
+ "hadoop_heapsize" : "1024",
+ "dfs_datanode_http_address" : "50075",
+ "io_sort_mb" : "200",
+ "jtnode_heapsize" : "1024m",
+ "io_sort_spill_percent" : "0.9",
+ "zk_user" : "zookeeper",
+ "fs_checkpoint_size" : "0.5",
+ "mapred_user" : "mapred",
+ "dfs_data_dir" : "/hadoop/hdfs/data",
+ "mapred_system_dir" : "/mapred/system",
+ "mapred_job_map_mem_mb" : "-1",
+ "hdfs_user" : "hdfs",
+ "dfs_name_dir" : "/hadoop/hdfs/namenode",
+ "hdfs_log_dir_prefix" : "/var/log/hadoop",
+ "keytab_path" : "/etc/security/keytabs",
+ "lzo_enabled" : "false",
+ "kadmin_pw" : "",
+ "proxyuser_group" : "users",
+ "gmond_user" : "nobody",
+ "kerberos_domain" : "EXAMPLE.COM",
+ "dfs_datanode_failed_volume_tolerated" : "0",
+ "user_group" : "hadoop",
+ "nagios_group" : "nagios",
+ "nagios_web_login" : "nagiosadmin",
+ "namenode_formatted_mark_dir" : "/var/run/hadoop/hdfs/namenode/formatted/",
+ "dfs_exclude" : "dfs.exclude",
+ "namenode_opt_maxnewsize" : "640m",
+ "hcat_user" : "hcat",
+ "hbase_conf_dir" : "/etc/hbase",
+ "mapred_local_dir" : "/hadoop/mapred",
+ "mapreduce_userlog_retainhours" : "24",
+ "dfs_replication" : "3",
+ "namenode_opt_newsize" : "200m",
+ "hcat_conf_dir" : "",
+ "nagios_user" : "nagios",
+ "mapred_child_java_opts_sz" : "768",
+ "mapred_red_tasks_max" : "2",
+ "fs_checkpoint_period" : "21600",
+ "apache_artifacts_download_url" : "",
+ "run_dir" : "/var/run/hadoop",
+ "mapred_hosts_include" : "mapred.include",
+ "hive_user" : "hive",
+ "security_enabled" : "false",
+ "sqoop_user" : "sqoop",
+ "hadoop_conf_dir" : "/etc/hadoop",
+ "mapred_map_tasks_max" : "4",
+ "mapred_job_red_mem_mb" : "-1",
+ "hbase_user" : "hbase",
+ "snappy_enabled" : "true",
+ "mapred_hosts_exclude" : "mapred.exclude",
+ "dfs_datanode_address" : "50010",
+ "dfs_block_local_path_access_user" : "hbase",
+ "maxtasks_per_job" : "-1",
+ "ganglia_runtime_dir" : "/var/run/ganglia/hdp",
+ "fs_checkpoint_dir" : "/hadoop/hdfs/namesecondary",
+ "dfs_datanode_data_dir_perm" : "750",
+ "mapred_cluster_map_mem_mb" : "-1",
+ "nagios_web_password" : "1",
+ "dtnode_heapsize" : "1024m",
+ "mapred_cluster_max_map_mem_mb" : "-1",
+ "datanode_du_reserved" : "1",
+ "hadoop_pid_dir_prefix" : "/var/run/hadoop",
+ "jtnode_opt_newsize" : "200m",
+ "mapred_cluster_max_red_mem_mb" : "-1",
+ "oozie_user" : "oozie",
+ "webhcat_user" : "hcat",
+ "mapred_jobstatus_dir" : "file:////mapred/jobstatus",
+ "namenode_heapsize" : "1024m",
+ "nagios_contact" : "mail@mail.ru",
+ "dfs_include" : "dfs.include",
+ "mapred_cluster_red_mem_mb" : "-1",
+ "dfs_webhdfs_enabled" : "false",
+ "rrdcached_base_dir" : "/var/lib/ganglia/rrds",
+ "scheduler_name" : "org.apache.hadoop.mapred.CapacityTaskScheduler",
+ "jtnode_opt_maxnewsize" : "200m",
+ "pig_user" : "pig",
+ "task_controller" : "org.apache.hadoop.mapred.DefaultTaskController"
+ }
+ }
+ ]
+}
\ No newline at end of file
Added: incubator/ambari/trunk/ambari-web/app/assets/data/configuration/hdfs-site.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/configuration/hdfs-site.json?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/configuration/hdfs-site.json (added)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/configuration/hdfs-site.json Wed Mar 13 23:46:46 2013
@@ -0,0 +1,61 @@
+{
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations/?type=hdfs-site&tag=version1&_=1363102423788",
+ "items" : [
+ {
+ "href" : "http://dev.hortonworks.com:8080/api/v1/clusters/mycluster/configurations?type=hdfs-site&tag=version1",
+ "tag" : "version1",
+ "type" : "hdfs-site",
+ "Config" : {
+ "cluster_name" : "mycluster"
+ },
+ "properties" : {
+ "dfs.http.address" : "dev.hortonworks.com:50070",
+ "dfs.https.address" : "dev.hortonworks.com:50470",
+ "dfs.datanode.max.xcievers" : "4096",
+ "dfs.safemode.threshold.pct" : "1.0f",
+ "dfs.datanode.http.address" : "0.0.0.0:50075",
+ "dfs.datanode.address" : "0.0.0.0:50010",
+ "dfs.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+ "dfs.datanode.failed.volumes.tolerated" : "0",
+ "dfs.datanode.data.dir.perm" : "750",
+ "ipc.server.read.threadpool.size" : "5",
+ "dfs.datanode.du.pct" : "0.85f",
+ "ipc.server.max.response.size" : "5242880",
+ "dfs.datanode.socket.write.timeout" : "0",
+ "dfs.datanode.du.reserved" : "1",
+ "dfs.namenode.handler.count" : "40",
+ "dfs.web.ugi" : "gopher,gopher",
+ "dfs.datanode.keytab.file" : "/etc/security/keytabs/dn.service.keytab",
+ "dfs.name.dir" : "/hadoop/hdfs/namenode",
+ "dfs.balance.bandwidthPerSec" : "6250000",
+ "dfs.heartbeat.interval" : "3",
+ "dfs.permissions.supergroup" : "hdfs",
+ "dfs.secondary.namenode.keytab.file" : "/etc/security/keytabs/nn.service.keytab",
+ "dfs.cluster.administrators" : " hdfs",
+ "dfs.hosts.exclude" : "/etc/hadoop/dfs.exclude",
+ "dfs.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+ "dfs.permissions" : "true",
+ "dfs.datanode.kerberos.principal" : "dn/_HOST@EXAMPLE.COM",
+ "dfs.web.authentication.kerberos.keytab" : "/etc/security/keytabs/spnego.service.keytab",
+ "dfs.webhdfs.enabled" : "false",
+ "dfs.secondary.https.port" : "50490",
+ "dfs.secondary.namenode.kerberos.https.principal" : "host/_HOST@EXAMPLE.COM",
+ "dfs.block.size" : "134217728",
+ "dfs.datanode.ipc.address" : "0.0.0.0:8010",
+ "dfs.data.dir" : "/hadoop/hdfs/data",
+ "dfs.access.time.precision" : "0",
+ "dfs.blockreport.initialDelay" : "120",
+ "dfs.block.access.token.enable" : "true",
+ "dfs.https.port" : "50470",
+ "dfs.umaskmode" : "077",
+ "dfs.secondary.http.address" : "dev.hortonworks.com:50090",
+ "dfs.replication" : "3",
+ "dfs.secondary.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM",
+ "dfs.replication.max" : "50",
+ "dfs.hosts" : "/etc/hadoop/dfs.include",
+ "dfs.namenode.kerberos.principal" : "nn/_HOST@EXAMPLE.COM",
+ "dfs.block.local-path-access.user" : "hbase"
+ }
+ }
+ ]
+}
\ No newline at end of file
Added: incubator/ambari/trunk/ambari-web/app/assets/data/services/hdfs.json
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/assets/data/services/hdfs.json?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/assets/data/services/hdfs.json (added)
+++ incubator/ambari/trunk/ambari-web/app/assets/data/services/hdfs.json Wed Mar 13 23:46:46 2013
@@ -0,0 +1,47 @@
+{
+ "href" : "http://ec2-54-234-122-153.compute-1.amazonaws.com:8080/api/v1/clusters/cl/services/HDFS?_=1362999856738",
+ "ServiceInfo" : {
+ "cluster_name" : "cl",
+ "state" : "STARTED",
+ "service_name" : "HDFS",
+ "desired_configs" : {
+ "global" : "version1",
+ "hdfs-site" : "version1",
+ "core-site" : "version1"
+ }
+ },
+ "components" : [
+ {
+ "href" : "http://ec2-54-234-122-153.compute-1.amazonaws.com:8080/api/v1/clusters/cl/services/HDFS/components/SECONDARY_NAMENODE",
+ "ServiceComponentInfo" : {
+ "cluster_name" : "cl",
+ "component_name" : "SECONDARY_NAMENODE",
+ "service_name" : "HDFS"
+ }
+ },
+ {
+ "href" : "http://ec2-54-234-122-153.compute-1.amazonaws.com:8080/api/v1/clusters/cl/services/HDFS/components/DATANODE",
+ "ServiceComponentInfo" : {
+ "cluster_name" : "cl",
+ "component_name" : "DATANODE",
+ "service_name" : "HDFS"
+ }
+ },
+ {
+ "href" : "http://ec2-54-234-122-153.compute-1.amazonaws.com:8080/api/v1/clusters/cl/services/HDFS/components/HDFS_CLIENT",
+ "ServiceComponentInfo" : {
+ "cluster_name" : "cl",
+ "component_name" : "HDFS_CLIENT",
+ "service_name" : "HDFS"
+ }
+ },
+ {
+ "href" : "http://ec2-54-234-122-153.compute-1.amazonaws.com:8080/api/v1/clusters/cl/services/HDFS/components/NAMENODE",
+ "ServiceComponentInfo" : {
+ "cluster_name" : "cl",
+ "component_name" : "NAMENODE",
+ "service_name" : "HDFS"
+ }
+ }
+ ]
+}
Modified: incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/main/service/info/configs.js Wed Mar 13 23:46:46 2013
@@ -41,10 +41,31 @@ App.MainServiceInfoConfigsController = E
slaveComponentGroups: null,
/**
+ * Filter text will be located here
+ */
+ filter: '',
+
+ /**
+ * Dropdown menu items in filter compbobox
+ */
+ filterColumns: function(){
+ var result = [];
+ for(var i = 1; i<3; i++){
+ result.push(Ember.Object.create({
+ name: this.t('common.combobox.dropdown.' + i),
+ selected: false
+ }));
+ }
+ return result;
+ }.property(),
+
+ /**
* clear and set properties to default value
*/
clearStep: function () {
this.set('dataIsLoaded', false);
+ this.set('filter', '');
+ this.get('filterColumns').setEach('selected', false);
this.get('stepConfigs').clear();
this.get('globalConfigs').clear();
this.get('uiConfigs').clear();
@@ -171,6 +192,9 @@ App.MainServiceInfoConfigsController = E
setServciceConfigs: function () {
var self = this;
var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/services/' + this.get('content.serviceName');
+ if(App.testMode){
+ url = '/data/services/hdfs.json';
+ }
$.ajax({
type: 'GET',
url: url,
@@ -362,6 +386,9 @@ App.MainServiceInfoConfigsController = E
var self = this;
var properties = {};
var url = App.apiPrefix + '/clusters/' + App.router.getClusterName() + '/configurations/?type=' + sitename + '&tag=' + tagname;
+ if(App.testMode){
+ url = '/data/configuration/' + sitename + '.json';
+ }
$.ajax({
type: 'GET',
url: url,
Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Wed Mar 13 23:46:46 2013
@@ -936,6 +936,10 @@ Em.I18n.translations = {
'menu.item.services':'Services',
'menu.item.hosts':'Hosts',
'menu.item.jobs':'Jobs',
- 'menu.item.admin':'Admin'
+ 'menu.item.admin':'Admin',
+
+ 'common.combobox.placeholder': 'Filter...',
+ 'common.combobox.dropdown.1': 'Modified properties',
+ 'common.combobox.dropdown.2': 'Properties needing restart',
};
Modified: incubator/ambari/trunk/ambari-web/app/styles/application.less
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/styles/application.less?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/styles/application.less (original)
+++ incubator/ambari/trunk/ambari-web/app/styles/application.less Wed Mar 13 23:46:46 2013
@@ -3161,4 +3161,28 @@ i.icon-asterisks {
}
}
}
+}
+
+.filter-combobox{
+ > input{
+ width: 170px;
+ -webkit-border-radius: 4px 0 0 4px;
+ -moz-border-radius: 4px 0 0 4px;
+ border-radius: 4px 0 0 4px;
+ }
+
+ > .btn-group{
+ display: inline-block;
+ margin-left: -1px;
+
+ > .dropdown-toggle{
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0
+ }
+
+ .dropdown-menu{
+ left: auto;
+ right:0;
+ }
+ }
}
\ No newline at end of file
Modified: incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs Wed Mar 13 23:46:46 2013
@@ -18,59 +18,55 @@
<div class="accordion">
{{#each category in selectedService.configCategories}}
- <div class="accordion-group {{unbound category.name}} common-config-category">
- <div class="accordion-heading" {{action "onToggleBlock" category target="view"}}>
- {{#if category.isCollapsed}}
- <i class='icon-caret-right pull-left accordion-toggle'></i>
- {{else}}
- <i class='icon-caret-down pull-left accordion-toggle'></i>
- {{/if}}
- <a class="accordion-toggle">
- {{category.displayName}}
- </a>
- </div>
-
-
- {{#view App.ServiceConfigsByCategoryView categoryBinding="category" serviceBinding="selectedService" serviceConfigsBinding="selectedService.configs"}}
- <form class="form-horizontal">
-
- {{#each view.categoryConfigs}}
- {{#if isVisible}}
- <div class="entry-row">
- <span {{bindAttr class="errorMessage:error: :control-group :control-label-span"}}>
- <label class="control-label">{{displayName}}</label>
- </span>
- <div class="controls">
- {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
- <div {{bindAttr class="errorMessage:error: :control-group"}}>
- {{view viewClass serviceConfigBinding="this" categoryConfigsBinding="view.categoryConfigs" }}
- {{#if isOverridable}}
- <a class="action" {{action "createOverrideProperty" this target="view" }} ><i class="icon-plus-sign"></i>Exception</a>
- {{/if}}
- {{#if isNotDefaultValue}}
- <a class="action" {{action "doRestoreDefaultValue" this target="view" }} ><i class="icon-undo"></i>Undo</a>
- {{/if}}
- {{#if isRemovable}}
- <a class="action" {{action "removeProperty" this target="view" }} ><i class="icon-minus-sign"></i>Remove</a>
- {{/if}}
- <span class="help-inline">{{errorMessage}}</span>
- </div>
- {{#if this.isOverridden}}
- {{view App.ServiceConfigView.SCPOverriddenRowsView serviceConfigPropertyBinding="this"}}
+ {{#view App.ServiceConfigsByCategoryView categoryBinding="category" serviceBinding="selectedService" serviceConfigsBinding="selectedService.configs"}}
+
+ <div class="accordion-heading" {{action "onToggleBlock" category target="view"}}>
+ <i class="pull-left accordion-toggle" {{bindAttr class="category.isCollapsed:icon-caret-right:icon-caret-down "}}></i>
+ <a class="accordion-toggle">{{category.displayName}}</a>
+ </div>
+
+ <div class="accordion-body collapse in">
+ <div class="accordion-inner">
+ <form class="form-horizontal">
+
+ {{#each view.filteredCategoryConfigs}}
+ <div class="entry-row">
+ <span class="control-group control-label-span" {{bindAttr class="errorMessage:error:"}}>
+ <label class="control-label">{{displayName}}</label>
+ </span>
+ <div class="controls">
+ {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
+ <div class="control-group" {{bindAttr class="errorMessage:error:"}}>
+ {{view viewClass serviceConfigBinding="this" categoryConfigsBinding="view.categoryConfigs" }}
+ {{#if isOverridable}}
+ <a class="action" {{action "createOverrideProperty" this target="view" }} ><i class="icon-plus-sign"></i>Exception</a>
+ {{/if}}
+ {{#if isNotDefaultValue}}
+ <a class="action" {{action "doRestoreDefaultValue" this target="view" }} ><i class="icon-undo"></i>Undo</a>
+ {{/if}}
+ {{#if isRemovable}}
+ <a class="action" {{action "removeProperty" this target="view" }} ><i class="icon-minus-sign"></i>Remove</a>
+ {{/if}}
+ <span class="help-inline">{{errorMessage}}</span>
+ </div>
+ {{#if this.isOverridden}}
+ {{view App.ServiceConfigView.SCPOverriddenRowsView serviceConfigPropertyBinding="this"}}
+ {{/if}}
+ </div>
+ </div>
+ {{/each}}
+
+ {{! For Advanced, Advanced Core Site, Advanced HDFS Site sections, show the 'Add Property' link.}}
+ {{#if category.canAddProperty }}
+ <div>
+ <a href="#" {{action "showAddPropertyWindow" this target="view" }} >Add Property...</a>
+ </div>
{{/if}}
- </div>
+ </form>
</div>
- {{/if}}
- {{/each}}
-
- {{! For Advanced, Advanced Core Site, Advanced HDFS Site sections, show the 'Add Property' link.}}
- {{# if category.canAddProperty }}
- <div>
- <a href="#" {{action "showAddPropertyWindow" this target="view" }} >Add Property...</a>
</div>
- {{/if}}
- </form>
- {{/view}}
- </div>
+
+
+ {{/view}}
{{/each}}
</div>
\ No newline at end of file
Added: incubator/ambari/trunk/ambari-web/app/templates/common/filter_combobox.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/filter_combobox.hbs?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/common/filter_combobox.hbs (added)
+++ incubator/ambari/trunk/ambari-web/app/templates/common/filter_combobox.hbs Wed Mar 13 23:46:46 2013
@@ -0,0 +1,34 @@
+{{!
+* 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.
+}}
+
+ {{view Ember.TextField valueBinding="view.filter" placeholderBinding="view.placeHolder"}}
+ <div class="btn-group">
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {{#each column in view.columns}}
+ <li>
+ <a href="#" {{action selectFilterColumn column target="view"}}>
+ <i {{bindAttr class="column.selected:icon-ok-sign:icon-placeholder"}}></i>
+ {{column.name}}
+ </a>
+ </li>
+ {{/each}}
+ </ul>
+ </div>
Modified: incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/main/service/info/configs.hbs Wed Mar 13 23:46:46 2013
@@ -18,7 +18,11 @@
<div id="serviceConfig">
{{#if dataIsLoaded}}
- {{view App.ServiceConfigView}}
+ <div class="pull-right">
+ {{view App.FilterComboboxView filterBinding="controller.filter" columnsBinding="controller.filterColumns" }}
+ </div>
+ <div class="clearfix"></div>
+ {{view App.ServiceConfigView filterBinding="controller.filter" columnsBinding="controller.filterColumns"}}
{{#if App.isAdmin}}
<p class="pull-right">
<!--<input class="btn btn-primary" type="button" value="Save" {{!bindAttr disabled="isSubmitDisabled"}} />-->
Modified: incubator/ambari/trunk/ambari-web/app/views.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views.js?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views.js Wed Mar 13 23:46:46 2013
@@ -32,6 +32,7 @@ require('views/common/form/field');
require('views/common/quick_view_link_view');
require('views/common/configs/services_config');
require('views/common/configs/overriddenProperty_view');
+require('views/common/filter_combobox');
require('views/login');
require('views/main');
require('views/main/menu');
Modified: incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js?rev=1456278&r1=1456277&r2=1456278&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js Wed Mar 13 23:46:46 2013
@@ -28,15 +28,16 @@ App.ServicesConfigView = Em.View.extend(
App.ServiceConfigView = Em.View.extend({
templateName: require('templates/common/configs/service_config'),
- onToggleBlock: function (event) {
- $(document.getElementById(event.context.name)).toggle('blind', 500);
- event.context.set('isCollapsed', !event.context.get('isCollapsed'));
- }
+ filter: '', //from template
+ columns: [] //from template
});
App.ServiceConfigsByCategoryView = Ember.View.extend({
+ classNames: ['accordion-group', 'common-config-category'],
+ classNameBindings: ['category.name', 'isShowBlock::hidden'],
+
content: null,
category: null,
@@ -47,15 +48,48 @@ App.ServiceConfigsByCategoryView = Ember
// default,
// cacheable )
categoryConfigs: function () {
- return this.get('serviceConfigs').filterProperty('category', this.get('category.name'))
- }.property('serviceConfigs.@each'),
+ return this.get('serviceConfigs').filterProperty('category', this.get('category.name')).filterProperty('isVisible', true);
+ }.property('serviceConfigs.@each').cacheable(),
+
+ /**
+ * Filtered <code>categoryConfigs</code> array. Used to show filtered result
+ */
+ filteredCategoryConfigs: function(){
+ var filter = this.get('parentView.filter').toLowerCase();
+ var isOnlyModified = this.get('parentView.columns').length && this.get('parentView.columns')[0].get('selected');
+ return this.get('categoryConfigs').filter(function(config){
+
+ if(isOnlyModified && !config.get('isNotDefaultValue')){
+ return false;
+ }
+
+ var searchString = config.get('defaultValue') + config.get('description') +
+ config.get('displayName') + config.get('name');
+
+ return searchString.toLowerCase().indexOf(filter) > -1;
+ });
+ }.property('categoryConfigs', 'parentView.filter', 'parentView.columns.@each.selected'),
+
+ /**
+ * Onclick handler for Config Group Header. Used to show/hide block
+ */
+ onToggleBlock: function () {
+ this.$('.accordion-body').toggle('blind', 500);
+ this.set('category.isCollapsed', !this.get('category.isCollapsed'));
+ },
+
+ /**
+ * Should we show config group or not
+ */
+ isShowBlock: function(){
+ return this.get('category.canAddProperty') || this.get('filteredCategoryConfigs').length > 0;
+ }.property('category.canAddProperty', 'filteredCategoryConfigs.length'),
+
didInsertElement: function () {
- var elementId = "#" + this.get('category.name');
- if (this.get('category.name').indexOf('Advanced') != -1) {
- this.set('category.isCollapsed', true);
- $(elementId).hide();
- } else {
- this.set('category.isCollapsed', false);
+ var isCollapsed = (this.get('category.name').indexOf('Advanced') != -1);
+ this.set('category.isCollapsed', isCollapsed);
+ if(isCollapsed){
+ this.$('.accordion-body').hide();
}
},
childView: App.ServiceConfigsOverridesView,
@@ -351,8 +385,7 @@ App.ServiceConfigsByCategoryView = Ember
}
})
});
- },
- layout: Ember.Handlebars.compile('<div {{bindAttr id="view.category.name"}} class="accordion-body collapse in"><div class="accordion-inner">{{yield}}</div></div>')
+ }
});
App.ServiceConfigTab = Ember.View.extend({
Added: incubator/ambari/trunk/ambari-web/app/views/common/filter_combobox.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/filter_combobox.js?rev=1456278&view=auto
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/common/filter_combobox.js (added)
+++ incubator/ambari/trunk/ambari-web/app/views/common/filter_combobox.js Wed Mar 13 23:46:46 2013
@@ -0,0 +1,47 @@
+/**
+ * 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');
+
+
+/**
+ * Filter component with custom dropdown. Build on Twitter Bootstrap styles
+ * @type {*}
+ */
+App.FilterComboboxView = Ember.View.extend({
+ templateName: require('templates/common/filter_combobox'),
+
+ classNames: ['filter-combobox', 'input-append'],
+
+ //filter: '', binding outside
+ //columns: [], binding outside
+
+ placeHolder: function(){
+ return this.t('common.combobox.placeholder');
+ }.property(),
+
+ /**
+ * Onclick handler for dropdown menu
+ * @param event
+ */
+ selectFilterColumn: function(event){
+ var column = event.context;
+ column.set('selected', !column.get('selected'));
+ }
+
+});