accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshelser <...@git.apache.org>
Subject [GitHub] accumulo pull request #242: ACCUMULO-2181/3005 REST API and new Monitor UI
Date Thu, 06 Apr 2017 04:35:53 GMT
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 = '<td class="center" colspan="7"><i>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.
---

Mime
View raw message