All Apps and Add-ons

Web Framework Require Local File

alacercogitatus
SplunkTrust
SplunkTrust

Hello, in developing a new app, I want to referance a local file, not a website.

I have this: require(["https://code.jquery.com/ui/1.10.0/jquery-ui.js"], but want it to be local to the /appserver/static folder.

How to achieve?

In case of any clarifications please revert.

0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

Found it. I did this:

require(["{{SPLUNKWEB_URL_PREFIX}}/static/app/APPNAME/jquery-ui.js"]

alacercogitatus
SplunkTrust
SplunkTrust

It's built in to Splunk 6, no additional django items needed. A little more seamless, IMHO. Splunk 5 - Definitely requires Django framework.

0 Karma

aelliott
Motivator

Gotcha, thanks.. I've only used the django framework, Is there a reason you choose the html dashboards over django?

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Right in the HTML Dashboard. I'm using Splunk 6.

0 Karma

aelliott
Motivator

What file do you place that in?

0 Karma

aelliott
Motivator

Put the javascript file in Splunk/etc/apps/MyAppName/django/MyAppName/static/MyAppName

Add this to html file in Splunk/etc/apps/MyAppName/django/MyAppName/templates

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...