Splunk Search

Add a clock to the header

hartfoml
Motivator

Anyone have a suggestion on how I can add a digital clock or even a world clock to the header in the default view for my APP?

Tags (2)
0 Karma

jhupka
Path Finder

One way is via a simple javascript clock widget.

Within your app you can have a javascript file that gets included with your views when rendered. This is placed in the appserver/static/application.js file (it has to be that name/location) of your app.

For a simple clock example, try adding the javascript from here:

http://www.w3schools.com/js/tryit.asp?filename=tryjs_timing_clock

Then, you'll need to include the HTML portion from the W3 sample (i.e. the div tag) in your view somehow - via Sideview's HTMLModule or one of the other mechanisms to add raw HTML to your view.

0 Karma

hartfoml
Motivator

this is probably the right answer and thanks for the help.

I guess this is just a little out of my reach.
I don't know how to create the .js widget from the code sample. Is the .js just a text readable file with the .js extension?

Also I need the numbers to be color "white" since the clock is on a black background and I need them to be a larger font.

Please forgive me I'm learning here.
Thanks again for your help.

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...