awips2/edexOsgi/com.raytheon.edex.uengine/web/dataPurge/dataPurge.html
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

132 lines
No EOL
3.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css"></style>
<script type='text/javascript' src='/uEngineWeb/dwr/interface/PurgeService.js'></script>
<script type="text/javascript" src="/uEngineWeb/dwr/engine.js"></script>
<title>AWIPS II Purge Admin Interface</title>
</head>
<body>
For All Plugins:<p>
<input type="button" id="purgeExpiredButton" value="Purge Expired Data" onClick="purgeExpired()">
<input type="button" id="purgeAllButton" value="Purge ALL Data" onClick="purgeAll()">
<br><hr width = "500" align="left"><br>
For Specific Plugin:<p>
Plugin Name: <input type="text" id="pluginNameText" size="15" maxLength="15" /><br>
<input type="button" id="purgePluginButton" value="Purge Expired Data" onClick="purgePlugin()">
<input type="button" id="purgeExpiredButton" value="Purge ALL Data" onClick="purgeAllPlugin()">
<br><hr width = "500" align="left"><br>
DEFAULT RULE:
<span id="defaultRuleSpan" style="font-size:10pt"></span>
<p>
<input type="button" id="refreshButton" value="Refresh Table" onClick="refresh()">
<input type="button" id="reloadButton" value="Reload Rules" onClick="reloadRules()">
<p>
<span id="pluginTableSpan" style="font-size:10pt"></span>
</body>
<script type='text/javascript'>
this.defaultRule = ""
this.pluginNames = Array()
this.pluginRules = Array()
this.defaultRules = Array()
refresh()
function reloadRules(){
PurgeService.reloadRules(function(){self.refresh();})
}
function refresh(){
PurgeService.getPluginPurgeInfo(function(pluginInfo){self.getPluginInfoCallback(pluginInfo);})
}
function getPluginInfoCallback(pluginInfo){
tableHTML = "<table id = 'pluginTable' border = '3' >"
tableHTML +="<tr>"
tableHTML +="<th>PLUGIN</th>"
tableHTML +="<th>RULE</th>"
tableHTML +="</tr>"
idx = 0;
for (i = 0; i < pluginInfo.length;i+=2){
this.pluginNames[idx] = pluginInfo[i]
idx = idx+1
tableHTML+="<tr>"
tableHTML+="<td>"+pluginInfo[i]+"</td>"
tableHTML+="<td>"+pluginInfo[i+1].replace(" matching default","")+"</td>"
tableHTML+="</tr>"
}
tableHTML+="</table>"
document.getElementById("pluginTableSpan").innerHTML =tableHTML
}
function purgePlugin(){
var pluginName = getPluginName()
if(pluginName != null){
var answer = confirm("Are you sure you want to purge all expired "+pluginName+" data?")
if(answer){
PurgeService.routePurgeRequest("PURGE_PLUGIN="+pluginName)
}
}
}
function purgeAllPlugin(){
var pluginName=getPluginName()
if(pluginName != null){
var answer = confirm("Are you sure you want to purge ALL "+pluginName+" data?")
if(answer){
var answer2 = confirm("You're totally 100% sure?")
if(answer2){
PurgeService.routePurgeRequest("PURGE_ALL_PLUGIN="+pluginName)
}
}
}
}
function purgeExpired(){
var answer = confirm("Are you sure you want to purge all expired data for all data types?")
if(answer){
PurgeService.routePurgeRequest("PURGE_EXPIRED_DATA")
}
}
function purgeAll(){
var answer = confirm("Are you sure you want to purge ALL the data?")
if(answer){
var answer2 = confirm("You're totally 100% sure?")
if(answer2){
PurgeService.routePurgeRequest("PURGE_ALL_DATA")
}
}
}
function getPluginName(){
var pluginName = document.getElementById("pluginNameText").value;
if(pluginName.length == 0){
alert("Plugin name cannot be empty")
return
}
found = false
for (i = 0; i < pluginNames.length;i++){
if(pluginNames[i] == pluginName){
return pluginName
}
}
alert("Please enter a valid plugin name")
document.getElementById("pluginNameText").value=""
}
</script>
</html>