<commit_before>/** @jsx React.DOM */

var React = require('react');
var Urls = require('../urls');

var lightest = "lightest";
var lighter = "lighter";
var light = "light";
var dark = "dark";
var darker = "darker";
var darkest = "darkest";

var TaskDetail = React.createClass({

  componentDidMount: function() {
    $.ajax({
      url: Urls.getTaskKeysForTaskIdUrl(this.props.taskId),
      success: function(data) {
        // TODO: Make this a default handler.
        if (data.success) {
          this.setState({data: data.result});
        } else {
          console.log("Failed to load addresses.")
        }
      }.bind(this)
    });
  },

  getInitialState: function() {
    return {data: []};
  },

  render: function() {
    return <TaskList taskId={this.props.taskId} data={this.state.data} />;
  }
});

var TaskList = React.createClass({

  render: function() {
    var tasks = this.props.data.map(function(taskKey, index) {
      // TODO: Convert to link node.
      return <TaskItem taskKey={taskKey.Key} />
    });

    return <div className="col-md-12">
      <h3>Task {this.props.taskId}</h3>
      {tasks}
    </div>;
  }
});


var TaskItem = React.createClass({

  componentDidMount: function() {
    $.ajax({
      url: Urls.getTaskInfoUrl(this.props.taskKey),
      success: function(data) {
        // TODO: Make this a default handler.
        if (data.success) {
          this.setState({data: data.result});
        } else {
          console.log("Failed to load tasks.")
        }
      }.bind(this)
    });
  },

  getInitialState: function() {
    return {data: []};
  },

  render: function() {
    var self = this;

    var mykeys = ["id", "parent_task_id",
        "task_id", "url", "context_id"];

    var remainder = ["end", "execution_count", "gae_latency_seconds",
        "ran", "retry_count", "run_time", "status_code", "task_eta"];

    var request_info = ["app_id", "host", "instance_id", "module_id",
      "request_id", "version_id", "parent_request_id",
      "request_address"];

    function keyIn(key, list) {
        for (i=0; i < list.length; i++) {
            if (key==list[i]){
                return true;
            }
        }
        return false;
    }

    var task_id = mykeys.map(function(key, index))

    var tasks = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, remainder)) {
        return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var task_id = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, mykeys)) {
          return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var request_details = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, request_info)) {
          return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var all = mykeys + remainder + request_info;

    var extra = Object.keys(this.state.data).map(function(key, index) {<commit_msg>Fix detail page<commit_after>/** @jsx React.DOM */

var React = require('react');
var Urls = require('../urls');

var lightest = "lightest";
var lighter = "lighter";
var light = "light";
var dark = "dark";
var darker = "darker";
var darkest = "darkest";

var TaskDetail = React.createClass({

  componentDidMount: function() {
    $.ajax({
      url: Urls.getTaskKeysForTaskIdUrl(this.props.taskId),
      success: function(data) {
        // TODO: Make this a default handler.
        if (data.success) {
          this.setState({data: data.result});
        } else {
          console.log("Failed to load addresses.")
        }
      }.bind(this)
    });
  },

  getInitialState: function() {
    return {data: []};
  },

  render: function() {
    return <TaskList taskId={this.props.taskId} data={this.state.data} />;
  }
});

var TaskList = React.createClass({

  render: function() {
    var tasks = this.props.data.map(function(taskKey, index) {
      // TODO: Convert to link node.
      return <TaskItem taskKey={taskKey.Key} />
    });

    return <div className="col-md-12">
      <h3>Task {this.props.taskId}</h3>
      {tasks}
    </div>;
  }
});


var TaskItem = React.createClass({

  componentDidMount: function() {
    $.ajax({
      url: Urls.getTaskInfoUrl(this.props.taskKey),
      success: function(data) {
        // TODO: Make this a default handler.
        if (data.success) {
          this.setState({data: data.result});
        } else {
          console.log("Failed to load tasks.")
        }
      }.bind(this)
    });
  },

  getInitialState: function() {
    return {data: []};
  },

  render: function() {
    var self = this;

    var mykeys = ["id", "parent_task_id",
        "task_id", "url", "context_id"];

    var remainder = ["end", "execution_count", "gae_latency_seconds",
        "ran", "retry_count", "run_time", "status_code", "task_eta"];

    var request_info = ["app_id", "host", "instance_id", "module_id",
      "request_id", "version_id", "parent_request_id",
      "request_address"];

    function keyIn(key, list) {
        for (i=0; i < list.length; i++) {
            if (key==list[i]){
                return true;
            }
        }
        return false;
    }

    var tasks = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, remainder)) {
        return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var task_id = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, mykeys)) {
          return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var request_details = Object.keys(this.state.data).map(function(key, index) {
      if (keyIn(key, request_info)) {
          return buildFormGroup(key, self.state.data[key], 1);
      }
    });

    var all = mykeys + remainder + request_info;

    var extra = Object.keys(this.state.data).map(function(key, index) {
{'fraction_non_alphanumeric': 0.1639483520217465, 'fraction_numerical': 0.0027183146449201497, 'mean_word_length': 2.520933014354067, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5968185', 'n_tokens_mistral': 1964, 'n_tokens_neox': 1908, 'n_words': 416}