Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CDDD9200C63 for ; Thu, 6 Apr 2017 06:35:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CCB0C160BAB; Thu, 6 Apr 2017 04:35:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 80DBB160BA3 for ; Thu, 6 Apr 2017 06:35:56 +0200 (CEST) Received: (qmail 3511 invoked by uid 500); 6 Apr 2017 04:35:54 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 2464 invoked by uid 99); 6 Apr 2017 04:35:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Apr 2017 04:35:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E313EDFF73; Thu, 6 Apr 2017 04:35:53 +0000 (UTC) From: joshelser To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #242: ACCUMULO-2181/3005 REST API and new Monitor UI Content-Type: text/plain Message-Id: <20170406043553.E313EDFF73@git1-us-west.apache.org> Date: Thu, 6 Apr 2017 04:35:53 +0000 (UTC) archived-at: Thu, 06 Apr 2017 04:35:58 -0000 Github user joshelser commented on a diff in the pull request: https://github.com/apache/accumulo/pull/242#discussion_r110077036 --- Diff: server/monitor/src/main/resources/resources/gc.js --- @@ -0,0 +1,278 @@ +/* +* 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. +*/ + +/** + * Creates garbage collector initial table + */ +$(document).ready(function() { + createHeader(); + doBanner('gcBanner', 'danger', 'Collector is Unavailable'); + refreshGC(); +}); + +/** + * Makes the REST calls, generates the tables with the new information + */ +function refreshGC() { + $.ajaxSetup({ + async: false + }); + getGarbageCollector(); + $.ajaxSetup({ + async: true + }); + refreshGCTable(); +} + +/** + * Used to redraw the page + */ +function refresh() { + refreshGC(); +} + +/** + * Generates the garbage collector table + */ +function refreshGCTable() { + // Checks the status of the garbage collector + var status = JSON.parse(sessionStorage.status).gcStatus; + + // Hides the banner, removes any rows from the table and hides the table + $('#gcBanner').hide(); + $('#gcActivity tr:gt(0)').remove(); + $('#gcActivity').hide(); + + /* Check if the status of the gc is an error, if so, show banner, otherwise, + * create the table + */ + if (status === 'ERROR') { + $('#gcBanner').show(); + } else { + $('#gcActivity').show(); + var data = JSON.parse(sessionStorage.gc); + + // Checks if there is a collection activity + if (data.files.lastCycle.finished <= 0 && + data.files.currentCycle.started <= 0 && + data.wals.lastCycle.finished <= 0 && + data.wals.currentCycle.started <= 0) { + var item = 'No Collection Activity' + --- End diff -- We seem to have quite a bit of co-mingled backend work and presentation logic in here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---