Compare commits
10 Commits
483dd95295
...
e9848ae6b3
| Author | SHA1 | Date | |
|---|---|---|---|
| e9848ae6b3 | |||
| 243b33810b | |||
| b9a084cf16 | |||
| 00dad43024 | |||
| 49e44b87cb | |||
|
|
7e223f9212 | ||
| 1c60004c4a | |||
| 7a0f6e5f27 | |||
| 0efbb785c3 | |||
| cbb37e750b |
@@ -25,10 +25,7 @@ class MapsController < ApplicationController
|
||||
before_filter :require_user
|
||||
|
||||
def index
|
||||
if session[:uploadSuccess]
|
||||
flash.now[:notice] = "File has been uploaded successfully"
|
||||
session[:uploadSuccess] = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def uploadFile
|
||||
@@ -37,4 +34,23 @@ class MapsController < ApplicationController
|
||||
redirect_to(:back)
|
||||
end
|
||||
|
||||
def deleteMap
|
||||
map = Map.find_by_map(params[:map])
|
||||
if map != nil
|
||||
map.destroy
|
||||
directory = "public/maps"
|
||||
File.delete("#{Rails.root}/public/maps/#{params[:map]}")
|
||||
flash.now[:notice] = "Map deleted successfully"
|
||||
else
|
||||
flash.now[:error] = "No Map Found"
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
if session[:uploadSuccess]
|
||||
flash.now[:notice] = "File has been uploaded successfully"
|
||||
session[:uploadSuccess] = false
|
||||
end
|
||||
end
|
||||
|
||||
end #EOF
|
||||
|
||||
@@ -62,8 +62,4 @@ class Map < ActiveRecord::Base
|
||||
map.map = sha1.hexdigest
|
||||
map.save
|
||||
end
|
||||
|
||||
def getMap()
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
2
app/views/maps/deleteMap.html.erb
Normal file
2
app/views/maps/deleteMap.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<strong>exterminate!</strong>
|
||||
<%= params[:map] %>
|
||||
@@ -1,29 +1,10 @@
|
||||
<h1>Exception Handler Maps</h1>
|
||||
<br/>
|
||||
|
||||
<%= form_tag ({:action => 'uploadFile'}, :multipart => true) %>
|
||||
<label for="package">Package:</label>
|
||||
<br/>
|
||||
<input name="package" id="package" type="text" maxlength="5555500" size=50%/>
|
||||
<br/>
|
||||
<label for="package">Build:</label>
|
||||
<br/>
|
||||
<input name="build" id="build" type="text" maxlength="5555500" size=50%/>
|
||||
<br/>
|
||||
<%= form_tag ({:action => 'uploadFile'}, :multipart => true) %>
|
||||
<p><label for="upload_file">Select File</label> :
|
||||
<br/>
|
||||
<%= file_field 'upload', 'datafile' %></p>
|
||||
<%= submit_tag "Upload" %>
|
||||
|
||||
<br/>
|
||||
<br/>
|
||||
<strong>Current Maps:</strong>
|
||||
|
||||
<% Map.all.each do |map| %>
|
||||
|
||||
<br/>
|
||||
<%= map[:package] %> <%= map[:build] %>
|
||||
|
||||
<div>
|
||||
<%= map[:package] %> <%= map[:build] %> <%= button_to "Delete", "delete/#{map[:map]}", :confirm => "Are you sure?" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= form_tag %>
|
||||
|
||||
16
app/views/maps/new.html.erb
Normal file
16
app/views/maps/new.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h1>Exception Handler Map Uploader</h1>
|
||||
<%= form_tag({:action => :uploadFile}, :multipart => true) do %>
|
||||
<label for="package">Package:</label>
|
||||
<br/>
|
||||
<input name="package" id="package" type="text" maxlength="5555500" size=50%/>
|
||||
<br/>
|
||||
<label for="package">Build:</label>
|
||||
<br/>
|
||||
<input name="build" id="build" type="text" maxlength="5555500" size=50%/>
|
||||
<br/>
|
||||
<p><label for="upload_file">Select File</label> :
|
||||
<br/>
|
||||
<%= file_field 'upload', 'datafile' %></p>
|
||||
<%= submit_tag "Upload" %>
|
||||
<% end %>
|
||||
<%= form_tag %>
|
||||
@@ -20,8 +20,20 @@
|
||||
# When a new exception report is recieved, it will be compared to existing bug issues.
|
||||
# If there is a match, the existing issue will be updated
|
||||
# if not a new bug issue will be generated.
|
||||
if Rails::VERSION::MAJOR >= 3
|
||||
RedmineApp::Application.routes.draw do
|
||||
match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post]
|
||||
match '/exceptionhandler/maps', :to => 'maps#index', :via => [:get, :post]
|
||||
match '/uploadFile', :to => 'maps#uploadFile', :via => :post
|
||||
match '/exceptionhandler/delete/:map', :to => 'maps#deleteMap', :via => :post
|
||||
match '/exceptionhandler/new', :to => 'maps#new', :via => [:get, :post]
|
||||
end
|
||||
else
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.connect '/exceptionhandler', :controller => 'exceptionhandler', :action => 'index'
|
||||
map.connect '/maps', :controller => 'maps', :action => 'index'
|
||||
map.connect '/exceptionhandler/maps', :controller => 'maps', :action => 'index'
|
||||
map.connect '/uploadFile', :controller => 'maps', :action => 'uploadFile'
|
||||
map.connect '/exceptionhandler/maps/delete/:map', :controller => 'maps', :action => 'deleteMap'
|
||||
map.connect '/exceptionhandler/maps/new', :controller => 'maps', :action => 'new'
|
||||
end
|
||||
end
|
||||
|
||||
21
init.rb
21
init.rb
@@ -1,10 +1,29 @@
|
||||
require 'redmine'
|
||||
|
||||
::Rails.logger.info 'Starting Exception Report Handler for Redmine'
|
||||
|
||||
if Rails::VERSION::MAJOR >= 3
|
||||
|
||||
ActionDispatch::Callbacks.to_prepare do
|
||||
require_dependency 'issue'
|
||||
require_dependency 'project'
|
||||
#require_dependency 'customfield'
|
||||
require_dependency 'time'
|
||||
#require_dependency 'issuepriority'
|
||||
require_dependency 'user'
|
||||
#require_dependency 'issuestatus'
|
||||
require_dependency 'tracker'
|
||||
require_dependency 'tempfile'
|
||||
require_dependency 'open3'
|
||||
end
|
||||
end
|
||||
|
||||
Redmine::Plugin.register :redmine_exception_handler do
|
||||
name 'Redmine Exception Handler plugin'
|
||||
author 'Rick Barrette <rickbarrette@gmail.com>'
|
||||
description 'An Exception Report Handler plugin for Redmine <= 1.4.x'
|
||||
version '0.0.5'
|
||||
version '0.1.0'
|
||||
url 'http://example.com/redmine/exceptionhandler'
|
||||
author_url 'http://rickbarrette.dyndns.org'
|
||||
menu :top_menu, :maps, { :controller => 'maps', :action => 'index' }, :caption => 'Maps', :before => :help, :if => Proc.new { User.current.logged? }
|
||||
end
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
|
||||
PROGUARD_HOME=`dirname "$0"`/..
|
||||
|
||||
/opt/java/jre/bin/java -jar $PROGUARD_HOME/lib/retrace.jar "$@"
|
||||
/usr/bin/java -jar $PROGUARD_HOME/lib/retrace.jar "$@"
|
||||
|
||||
Reference in New Issue
Block a user