Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
Moved marvelLinks.json to a common folder and added navigation menu t…
Browse files Browse the repository at this point in the history
…o Sense

Relates to #35
  • Loading branch information
bleskes committed Jan 22, 2014
1 parent f2b2fa9 commit 4904524
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 43 deletions.
16 changes: 16 additions & 0 deletions common/marvelLinks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"links": [
{
"name": "Cluster Overview",
"url": "#/dashboard/file/marvel.overview.json"
},
{
"name": "Cluster Pulse",
"url": "#/dashboard/file/marvel.cluster_pulse.json"
},
{
"name": "Sense",
"url": "/sense/index.html"
}
]
}
2 changes: 1 addition & 1 deletion kibana/dashboards/cluster_pulse.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {
Expand Down
2 changes: 1 addition & 1 deletion kibana/dashboards/indices_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dashboard.nav = [
{
type: "marvel.navigation",
source: "url",
url: "app/panels/marvel/navigation/marvelLinks.json"
url: "../common/marvelLinks.json"
}
];

Expand Down
2 changes: 1 addition & 1 deletion kibana/dashboards/nodes_stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dashboard.nav = [
{
type: "marvel.navigation",
source: "url",
url: "app/panels/marvel/navigation/marvelLinks.json"
url: "../common/marvelLinks.json"
}
];

Expand Down
2 changes: 1 addition & 1 deletion kibana/dashboards/overview.json
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {
Expand Down
2 changes: 1 addition & 1 deletion kibana/dashboards/shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 0 additions & 16 deletions panels/navigation/editor.html

This file was deleted.

12 changes: 0 additions & 12 deletions panels/navigation/marvelLinks.json

This file was deleted.

21 changes: 17 additions & 4 deletions sense/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([
'output',
'misc_inputs',
'utils'
],
],
function (_gaq, curl, $helpPopup, history, input, $, mappings, output, miscInputs, utils) {
'use strict';

Expand Down Expand Up @@ -198,16 +198,28 @@ define([
}
});

/**
*
*/
$send.click(function () {
submitCurrentRequestToES(function (resp) {
output.update(resp);
});
return false;
});

/*
* initialize navigation menu
*/

$.get('../common/marvelLinks.json', function(marvelLinks) {
var linkMenu = $("#nav_btn ul");
_.map(marvelLinks.links, function (link) {
var li =$('<li><a></a></li>');
var a = li.find('a');
a.attr('href', link.url);
a.text(link.name);
if (a[0].href != window.location.href)
li.appendTo(linkMenu);
});
});

/**
* Display the welcome popul if it has not been shown yet
Expand All @@ -220,4 +232,5 @@ define([
$welcomePopup.modal('show');
});
}

});
12 changes: 8 additions & 4 deletions sense/app/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,21 @@ define([
function setTheme(mode) {
localStorage.setItem("theme", mode);

$("#bootstrapThemeCss").attr("href", "vendor/bootstrap/css/bootstrap." + mode + ".min.css");
$("#senseThemeCss").attr("href", "css/sense." + mode + ".css");

applyCurrentSettings();
return true;
}

function applyThemeToBody() {
var theme= getTheme();
$("#bootstrapThemeCss").attr("href", "vendor/bootstrap/css/bootstrap." + theme + ".min.css");
$("#senseThemeCss").attr("href", "css/sense." + theme + ".css");
}

function applyCurrentSettings(editor) {
if (typeof editor === "undefined") {
applyCurrentSettings(require('input'));
applyCurrentSettings(require('output'));
applyThemeToBody();
}
if (editor) {
editor.setTheme(getAceTheme());
Expand All @@ -76,7 +80,7 @@ define([
var theme_ctl = settings_popup.find("#theme");
var theme = getTheme();
theme_ctl.val(theme);
//setTheme(theme);
applyThemeToBody();

function save() {
if (!setFontSize(font_size_ctl.val())) font_size_ctl.val(getFontSize());
Expand Down
7 changes: 7 additions & 0 deletions sense/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
<span class="pull-left btn btn-link"><span id="notification" style="visibility: hidden"
class="label label-info"></span></span>
<ul class="nav pull-right">
<li id="nav_btn" class="dropdown">
<a href="#" title="Goto" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-globe"></i>
</a>
<ul class="dropdown-menu" role="menu">
</ul>
</li>
<li id="history_btn" data-toggle="modal" data-target="#history_popup">
<a title="History" href="#" data-placement="bottom"><i class="fa fa-clock-o"></i></a>
</li>
Expand Down
3 changes: 2 additions & 1 deletion tasks/options/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ module.exports = function (config) {
'^/kibana/app/panels/marvel/(.*)$': '/kibana/panels/$1',
'^/kibana/config.js$': '/<%= buildTempDir %>/config.js',
'^/kibana(.*)$': '<%= kibanaCheckoutDir %>/src$1',
'^/sense(.*)$': '/sense$1'
'^/sense(.*)$': '/sense$1',
'^/common(.*)$': '/common$1'
}
};
};
2 changes: 1 addition & 1 deletion tasks/options/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function (config) {
{
cwd: '.',
expand: true,
src: ['index.html'],
src: ['index.html', 'common'],
dest: '<%= buildSiteDir %>'
}
]},
Expand Down

0 comments on commit 4904524

Please sign in to comment.