Skip to content
This repository was archived by the owner on Feb 21, 2018. It is now read-only.

Commit

Permalink
Add appserver needed for manager.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeerbeek committed May 25, 2017
1 parent c33a17d commit a31617e
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 0 deletions.
5 changes: 5 additions & 0 deletions appserver/modules/admin/widgets/password_copy_fix.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script type="text/javascript">
$(document).ready(function(){
$('#password_id_confirm').val($('#password_id').val());
})
</script>
154 changes: 154 additions & 0 deletions appserver/modules/admin/widgets/selection_dialog.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
<%page args="element" />
<div class="selection_panel" style="display:none">
<div class="description">${element['description']}</div>
<%
import json
import collections

choices = json.loads(element['options'])
choices = collections.OrderedDict(sorted(choices.items()))
%>
<ul>
% for name, value in choices.items():
<li>
<a class="selection_choice" href="#" title="${value}" data-value="${value}">${name}</a>
</li>
% endfor
</ul>
</div>
<style>
#selection_dialog_content{
padding: 16px;
min-height: 150px;
min-width: 400px;
max-height: 300px;
overflow-y: scroll;
}

#selection_dialog_content td{
padding: 3px;
}

#selection_dialog_content table.matches{
width: 95%;
}

#selection_dialog_content table.matches tbody tr:nth-of-type(2n)
{
background:#EEE;
}

#selection_dialog_content .table_scroll{
max-height: 200px;
overflow-y: scroll;
border: 1px solid #888;
}

#selection_dialog_content div.matches{
margin-top: 16px;
font-weight: bold;
}

#selection_dialog_content .validation_errors{
color: #C42323;
font-weight: bold;
}

#selection_dialog_content ul{
margin-left: 0px;
}

#selection_dialog_content li{
border:1px solid #eee;
background-color: #f6f6f6;
margin: 5px;
padding: 3px;
list-style-type: none;
}

#selection_dialog_content .error_message{
color: #C42323;
font-weight: bold;
}

.selection_panel > .description{
margin-bottom: 12px;
}

.selection_panel{
font-size: small;
}

#show_dialog{
padding-left: 2px;
}
</style>

<div>
<a id="show_dialog" href="#">${element['title']}</a>
</div>
<script type="text/javascript">

var popup = null;

var entityMap = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;'
};

function escapeHtml(string) {
return String(string).replace(/[&<>"'\/]/g, function (s) {
return entityMap[s];
});
}

function shortenString(s){
var max_length = 80;

if(s.length > max_length){
return s.substr(0, max_length-1) + "..."
}
else{
return s;
}
}

function selectItem(ev){
var value = $(ev.target).data('value');
console.info("Selected value of " + value);
$("#${element['field_to_populate']}").val(value);

popup.destroyPopup();
return false;
}

function openDialog(){
$(".selection_panel").clone().appendTo("#selection_dialog_content");
$("#selection_dialog_content > .selection_panel").show();
$(".selection_choice").on("click", selectItem);
}

$(document).ready(
function(){

$('#show_dialog').click(
function() {
_mypopup = new Splunk.Popup('<div id="selection_dialog_content"></div>',
{
title : "${element['title']}",
pclass : "selection_dialog",
cloneFlag : false
});

popup = _mypopup;
openDialog();
return false;
}
);
}
);
</script>
11 changes: 11 additions & 0 deletions appserver/modules/admin/widgets/sourcetype_selection_fix.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<script type="text/javascript">
$('#eaiform').on('submit', function(event){

if( $('#spl-ctrl_sourcetypeSelect_id').val() === "auto" ){
$('#sourcetype_id').val("");
}
else if( $('#spl-ctrl_sourcetypeSelect_id').val() === "spl-ctrl_from_list" ){
$('#sourcetype_id').val( $('#spl-ctrl_from_list_id').val() );
}
});
</script>

0 comments on commit a31617e

Please sign in to comment.