Moved marvelLinks.json to a common folder and added navigation menu to Sense

Relates to #35
This commit is contained in:
Boaz Leskes 2014-01-22 12:06:13 +01:00
parent f2b2fa9db7
commit 49045243e9
15 changed files with 56 additions and 43 deletions

16
common/marvelLinks.json Normal file
View file

@ -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"
}
]
}

View file

@ -260,7 +260,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {

View file

@ -49,7 +49,7 @@ dashboard.nav = [
{
type: "marvel.navigation",
source: "url",
url: "app/panels/marvel/navigation/marvelLinks.json"
url: "../common/marvelLinks.json"
}
];

View file

@ -49,7 +49,7 @@ dashboard.nav = [
{
type: "marvel.navigation",
source: "url",
url: "app/panels/marvel/navigation/marvelLinks.json"
url: "../common/marvelLinks.json"
}
];

View file

@ -408,7 +408,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {

View file

@ -1302,7 +1302,7 @@
{
"type": "marvel.navigation",
"source": "url",
"url": "app/panels/marvel/navigation/marvelLinks.json"
"url": "../common/marvelLinks.json"
}
],
"loader": {

View file

@ -1,16 +0,0 @@
<div class="editor-row">
<div class="section">
<div class="editor-option">
<label class="small">Relative time options <small>comma seperated</small></label>
<input type="text" array-join class="input-large" ng-model="panel.time_options">
</div>
<div class="editor-option">
<label class="small">Auto-refresh options <small>comma seperated</small></label>
<input type="text" array-join class="input-large" ng-model="panel.refresh_intervals">
</div>
<div class="editor-option">
<label class="small">Time Field</label>
<input type="text" class="input-small" ng-model="panel.timefield">
</div>
</div>
</div>

View file

@ -1,12 +0,0 @@
{
"links": [
{
"name": "Google",
"url": "http://google.com"
},
{
"name": "Yahoo",
"url": "http://yahoo.com"
}
]
}

View file

@ -9,7 +9,7 @@ define([
'output',
'misc_inputs',
'utils'
],
],
function (_gaq, curl, $helpPopup, history, input, $, mappings, output, miscInputs, utils) {
'use strict';
@ -198,9 +198,6 @@ define([
}
});
/**
*
*/
$send.click(function () {
submitCurrentRequestToES(function (resp) {
output.update(resp);
@ -208,6 +205,21 @@ define([
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
@ -220,4 +232,5 @@ define([
$welcomePopup.modal('show');
});
}
});

View file

@ -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());
@ -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());

View file

@ -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>

View file

@ -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'
}
};
};

View file

@ -19,7 +19,7 @@ module.exports = function (config) {
{
cwd: '.',
expand: true,
src: ['index.html'],
src: ['index.html', 'common'],
dest: '<%= buildSiteDir %>'
}
]},