GithubHelp home page GithubHelp logo

lukemurphey / splunk-dashboard-tabs-example Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 11.0 45 KB

An example of the use of tabs on a Splunk dashboard. #splunk

License: MIT License

CSS 14.02% JavaScript 85.98%

splunk-dashboard-tabs-example's People

Contributors

adamcoolcat avatar fredclown avatar lukemurphey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

splunk-dashboard-tabs-example's Issues

Sub Tabs

This is pretty awesome. I love being able to put tabs on a dashboard. It would be handy if this could support sub tabs. What I mean by that is that if you select a tab you get a set of sub tabs that show up that can be linked to their own rows. I thought maybe I could just do something like this. It kinda works, but not really. The highlighting doesn't work right and the sub_tab section starts off visible.

<row id="tabs">
	<panel>
		<html>
			<ul id="tabs" class="nav nav-tabs">
				<li class="active"><a href="#" class="toggle-tab" data-toggle="tab" data-elements="row1">Tab 1</a></li>
				<li><a href="#" class="toggle-tab" data-toggle="tab" data-elements="row2">Tab 2</a></li>
				<li><a href="#" class="toggle-tab" data-toggle="tab" data-elements="row3">Tab 3</a></li>
				<li><a href="#" class="toggle-tab" data-toggle="tab" data-elements="row4">Tab 4</a></li>
				<li><a href="#" class="toggle-tab" data-toggle="tab" data-elements="sub_tabs,row5_1,row5_2">Tab 5</a></li>
			</ul>
		</html>
	</panel>
</row>
<row id="sub_tabs">
	<panel>
		<html>
			<ul id="tabs" class="nav nav-tabs">
				<li class="active"><a href="#" class="toggle-tab" data-toggle="tab" data-elements="sub_tabs,row5_1">Tab 5_1</a></li>
				<li><a href="#" class="toggle-tab" data-toggle="tab" data-elements="sub_tabs,row5_2">Tab 5_2</a></li>
			</ul>
		</html>
	</panel>
</row>

Conflicts with depends="$token$"

I have found that the tabs conflict with depends="$token$". The main reason for this is that you are using the jQuery show() and hide() functions which add inline styles that override the hide css class added by depends="$token$". I would suggest this change that I believe would fix this issue and allow the expected behavior.

tabs.css - add class row-hide

.row-hide {
    display: none;
}

tabs.js - change show and hide lines to use removeClass and addClass

...
var hideTabTargets = function(tabSetClass) {
...
				//$('#' + targets[d], this.$el).hide();
				$('#' + targets[d], this.$el).addClass('row-hide');
...
};
...
var selectTab = function (e) {
...
			//$('#' + toToggle[c], this.$el).show();
			$('#' + toToggle[c], this.$el).removeClass('row-hide');
...
};

Only working at first round

Hi Luke, hope you are ok:

First the environment:
Splunk 7.3.3 with python2-pip-8.1.2-6.el7
Google Chrome Version 80.0.3987.162
Source code used is the last one you have updated only with the tab5.xml view

Problem:
The first time time picker gets a value it works, as I can see when the internal tab only charges when I click on it. But when I change the time picker value and next click the summit button, all tabs start the filling process.

Thank you,
Emill

Styles for tabs in dark mode

Here are some styles that will change the tab colors if the dashboard is in dark mode.

.dashboard-panel[class*="dashboardPanel---pages-dark"] ul.nav-tabs {
	background-color: #3c444d;
}

.dashboard-panel[class*="dashboardPanel---pages-dark"] ul.nav-tabs li a {
	color: #c3cbd4;
}

.dashboard-panel[class*="dashboardPanel---pages-dark"] ul.nav-tabs li.active a {
	color: #ffffff;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.