Commit 1d2e8df3 authored by Laura Schlimmer's avatar Laura Schlimmer
Browse files

Merge branch 'fnordmetric2' of github.com:paulasmuth/fnordmetric-dev into adminui_metricListView

parents d52b6789 ad4e9933
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ FnordMetric.WebUI = function() {
  var viewport = document.createElement("div");
  viewport.className = "viewport";
  var headbar = document.createElement("div");
  headbar.innerHTML = "<h1 class='le_fnord'>F</h1>"
  headbar.className = "headbar";

  function addMenuItem(name, url) {
+12 −9
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ FnordMetric.views.QueryPlayground = function() {

  var viewport;
  var direction;
  var editor_pane;
  var result_pane;
  var button_bar;

  function renderExecutionInfo(duration, tables, elem) {
    if (tables == undefined) {return;}
@@ -87,6 +90,7 @@ FnordMetric.views.QueryPlayground = function() {
  function renderEditorView(view, editor_pane, result_pane, query) {
    "render editor view";
    editorViews[view].render(editor_pane, query);
    editor_pane.insertBefore(button_bar, editor_pane.firstChild);
    if (query != undefined) {
      runQuery(result_pane, editor_pane, view, query);
    }
@@ -102,9 +106,9 @@ FnordMetric.views.QueryPlayground = function() {
          editor_pane.offsetWidth);
      editor_pane.style.width = editor_width + "%";
      editor_pane.style.float = "left";
      editor_pane.style.height = height + "px";
      editor_pane.style.height = (height - 40) + "px";
      result_pane.style.height = height + "px";
      result_pane.style.width = (99 - editor_width) + "%";
      result_pane.style.width = (100 - editor_width) + "%";
      result_pane.style.left = editor_width + "%";
      result_pane.style.top = "";
      result_pane.style.overflowY = "auto";
@@ -129,13 +133,14 @@ FnordMetric.views.QueryPlayground = function() {
    viewport.innerHTML = "";

    /* render buttons */
    var button_bar = document.createElement("div");
    button_bar = document.createElement("div");
    button_bar.innerHTML = "<div class='editor_type_picker'>SQL Editor</div>";
    button_bar.className = "navbar";
    var split_btn = FnordMetric.createButton(
      "#", "fancy_button", "Change View");

    var query_btn = FnordMetric.createButton(
      "#", "fancy_button", "Run Query");
      "#", "run_query", "Run Query");
    query_btn.onclick = function(e) {
      e.preventDefault();
      runQuery(
@@ -153,10 +158,9 @@ FnordMetric.views.QueryPlayground = function() {
        viewport, "Todo: Ruby/JS/html snippet");
    }

    button_bar.appendChild(split_btn);
    //button_bar.appendChild(split_btn);
    button_bar.appendChild(query_btn);
    button_bar.appendChild(embed_btn);
    viewport.appendChild(button_bar);
    //button_bar.appendChild(embed_btn);

    /* init editorpane & resultpane */
    editor_pane = document.createElement("div");
@@ -191,7 +195,6 @@ FnordMetric.views.QueryPlayground = function() {
      query = query_params.value;
    }
    renderEditorView(current_view, editor_pane, result_pane, query);

  }


+1 −1
Original line number Diff line number Diff line
@@ -309,7 +309,7 @@ FnordMetric.util.sortMetricList = function(metrics, column_index, order) {

FnordMetric.util.getHorizontalEditorHeight = function(
  editor_height, result_height) {
    var default_height = (window.innerHeight - 92);
    var default_height = (window.innerHeight - 49);
    editor_height = Math.max(editor_height, default_height);
    var height = Math.max(editor_height, result_height);
    return height;
+42 −3
Original line number Diff line number Diff line
@@ -11,6 +11,19 @@ body {
  padding-bottom: 20px;
}

.le_fnord {
  float: left;
  line-height: 49px;
  color: #fff;
  margin: 0;
  padding: 0;
  font-family: "Arial";
  width: 51px;
  text-align: center;
  font-size: 24px;
  border-right: 1px solid #2e3135;
}

.load_foreground {
  position: absolute;
  top: 0;
@@ -21,6 +34,18 @@ body {
  opacity: 0.5;
}

.editor_type_picker {
  background: #f6f8fa;
  height: 39px;
  display: block;
  width: 90px;
  text-align: center;
  border-right: 1px solid #dbdedf;
  padding: 0 7px 0 20px;
  line-height: 41px;
  font-size: 95%;
}

.navbar {
  height: 39px;
  width: 100%;
@@ -35,7 +60,19 @@ body {
  color: #545758;
}

.editor_type_chooser {

}

.fancy_button {
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  background: linear-gradient(to bottom right, #f5f5f5, #f1f1f1);
  padding: 0 12px;
  height: 27px;
  line-height: 28px;
  display: inline-block;
}

input {
@@ -47,7 +84,7 @@ input {
}

.viewport {
  margin-top: 50px;
  margin-top: 49px;
}

.headbar {
@@ -82,8 +119,9 @@ input {

.result_pane {
  border-bottom: 1px solid #dbdedf;
  border-left: 1px solid #dbdedf;
  border-left: 2px solid #dbdedf;
  border-right: 1px solid #dbdedf;
  background: #e9ebed;
}

.viewport.horizontal_split .editor_pane {
@@ -523,7 +561,7 @@ table.metric_list tr:hover td {
}
.CodeMirror-linenumbers {}
.CodeMirror-linenumber {
  padding: 0 15px 0 10px;
  padding: 0 25px 0 6px;
  min-width: 20px;
  text-align: right;
  color: #a6a5ab;
@@ -704,6 +742,7 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
}

.CodeMirror-lines {
  padding: 10px 10px;
  cursor: text;
  min-height: 1px; /* prevents collapsing before first draw */
}