From 617e08adb609e351721196aecff6c000a04dfd95 Mon Sep 17 00:00:00 2001 From: Kevin Fitzpatrick Date: Fri, 4 Nov 2016 15:55:19 -0700 Subject: [PATCH 1/2] Fix filtering Also, fixes displaying mutliple alerts with the same name --- ui/src/alerts/components/AlertsTable.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/alerts/components/AlertsTable.js b/ui/src/alerts/components/AlertsTable.js index d525e75927..4dd29cdfea 100644 --- a/ui/src/alerts/components/AlertsTable.js +++ b/ui/src/alerts/components/AlertsTable.js @@ -30,8 +30,12 @@ const AlertsTable = React.createClass({ this.setFilteredAlerts(newProps.alerts, this.state.searchTerm); }, - setFilteredAlerts(allAlerts, searchTerm) { - const alerts = allAlerts.filter((h) => h.name.search(searchTerm) !== -1); + filterAlerts(allAlerts, searchTerm) { + const alerts = allAlerts.filter((h) => { + return h.name.toLowerCase().search(searchTerm.toLowerCase()) !== -1 || + h.host.toLowerCase().search(searchTerm.toLowerCase()) !== -1 || + h.level.toLowerCase().search(searchTerm.toLowerCase()) !== -1; + }); this.setState({searchTerm, filteredAlerts: alerts}); }, @@ -79,7 +83,7 @@ const AlertsTable = React.createClass({ { alerts.map(({name, time, value, host, level}) => { return ( - + {name} {level} {(new Date(Number(time)).toISOString())} From 83b036f2555ba4368f11f1f3aa6ba11131ad6eae Mon Sep 17 00:00:00 2001 From: Ross McDonald Date: Mon, 7 Nov 2016 10:49:10 -0600 Subject: [PATCH 2/2] Update package canned directory. --- etc/build.py | 9 ++++++++- etc/scripts/chronograf.service | 2 +- etc/scripts/init.sh | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/etc/build.py b/etc/build.py index 6bdfd543f6..0f3d1fc29f 100755 --- a/etc/build.py +++ b/etc/build.py @@ -23,12 +23,14 @@ LOG_DIR = "/var/log/chronograf" DATA_DIR = "/var/lib/chronograf" SCRIPT_DIR = "/usr/lib/chronograf/scripts" LOGROTATE_DIR = "/etc/logrotate.d" +CANNED_DIR = "/usr/share/chronograf/canned" INIT_SCRIPT = "etc/scripts/init.sh" SYSTEMD_SCRIPT = "etc/scripts/chronograf.service" POSTINST_SCRIPT = "etc/scripts/post-install.sh" POSTUNINST_SCRIPT = "etc/scripts/post-uninstall.sh" LOGROTATE_SCRIPT = "etc/scripts/logrotate" +CANNED_SCRIPTS = "canned/*json" # Default AWS S3 bucket for uploads DEFAULT_BUCKET = "dl.influxdata.com/chronograf/artifacts" @@ -112,7 +114,8 @@ def create_package_fs(build_root): LOG_DIR[1:], DATA_DIR[1:], SCRIPT_DIR[1:], - LOGROTATE_DIR[1:] + LOGROTATE_DIR[1:], + CANNED_DIR[1:] ] for d in dirs: os.makedirs(os.path.join(build_root, d)) @@ -135,6 +138,10 @@ def package_scripts(build_root, config_only=False, windows=False): logging.debug("Moving {} to {}".format(script, dest)) shutil.copyfile(script, dest) os.chmod(dest, 0o644) + run("cp {} {} && chmod 644 {}".format(CANNED_SCRIPTS, + os.path.join(build_root, CANNED_DIR[1:]), + os.path.join(build_root, CANNED_DIR[1:], "*json")), + shell=True) def run_generate(): """Generate static assets. diff --git a/etc/scripts/chronograf.service b/etc/scripts/chronograf.service index 1b45e80145..c337f45d07 100644 --- a/etc/scripts/chronograf.service +++ b/etc/scripts/chronograf.service @@ -8,7 +8,7 @@ After=network-online.target [Service] User=chronograf Group=chronograf -ExecStart=/usr/bin/chronograf --host localhost --port 10000 -b /var/lib/chronograf/chronograf.db -c /usr/share/chronograf +ExecStart=/usr/bin/chronograf --host localhost --port 10000 -b /var/lib/chronograf/chronograf.db -c /usr/share/chronograf/canned KillMode=control-group Restart=on-failure diff --git a/etc/scripts/init.sh b/etc/scripts/init.sh index 3327637b55..081408c8a9 100755 --- a/etc/scripts/init.sh +++ b/etc/scripts/init.sh @@ -13,7 +13,7 @@ # Script to execute when starting SCRIPT="/usr/bin/chronograf" # Options to pass to the script on startup -SCRIPT_OPTS="--host localhost --port 10000 -b /var/lib/chronograf/chronograf.db -c /usr/share/chronograf" +SCRIPT_OPTS="--host localhost --port 10000 -b /var/lib/chronograf/chronograf.db -c /usr/share/chronograf/canned" # User to run the process under RUNAS=chronograf