lukemurphey / splunk-dashboard-tabs-example Goto Github PK
View Code? Open in Web Editor NEWAn example of the use of tabs on a Splunk dashboard. #splunk
License: MIT License
An example of the use of tabs on a Splunk dashboard. #splunk
License: MIT License
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>
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');
...
};
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
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;
}
Splunk is no longer supporting jquery older than 3.5 so as a result the require statement where you import jquery is causing the script to crash and the tabs to not work properly. Is there a way to change the script to reference the jquery that splunk ships with or something? Or to bundle it in app/bin/ folder and reference it locally?
https://docs.splunk.com/Documentation/UpgradejQuery/1/UpgradejQuery/jQueryOverview
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.