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
|
before_filter :require_user
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if session[:uploadSuccess]
|
|
||||||
flash.now[:notice] = "File has been uploaded successfully"
|
|
||||||
session[:uploadSuccess] = false
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def uploadFile
|
def uploadFile
|
||||||
@@ -37,4 +34,23 @@ class MapsController < ApplicationController
|
|||||||
redirect_to(:back)
|
redirect_to(:back)
|
||||||
end
|
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
|
end #EOF
|
||||||
|
|||||||
@@ -62,8 +62,4 @@ class Map < ActiveRecord::Base
|
|||||||
map.map = sha1.hexdigest
|
map.map = sha1.hexdigest
|
||||||
map.save
|
map.save
|
||||||
end
|
end
|
||||||
|
|
||||||
def getMap()
|
|
||||||
|
|
||||||
end
|
|
||||||
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>
|
<h1>Exception Handler Maps</h1>
|
||||||
<br/>
|
<br/>
|
||||||
|
<br/>
|
||||||
<%= form_tag ({:action => 'uploadFile'}, :multipart => true) %>
|
<strong>Current Maps:</strong>
|
||||||
<label for="package">Package:</label>
|
<% Map.all.each do |map| %>
|
||||||
<br/>
|
<br/>
|
||||||
<input name="package" id="package" type="text" maxlength="5555500" size=50%/>
|
<div>
|
||||||
<br/>
|
<%= map[:package] %> <%= map[:build] %> <%= button_to "Delete", "delete/#{map[:map]}", :confirm => "Are you sure?" %>
|
||||||
<label for="package">Build:</label>
|
</div>
|
||||||
<br/>
|
<% end %>
|
||||||
<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] %>
|
|
||||||
|
|
||||||
<% 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.
|
# 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 there is a match, the existing issue will be updated
|
||||||
# if not a new bug issue will be generated.
|
# if not a new bug issue will be generated.
|
||||||
ActionController::Routing::Routes.draw do |map|
|
if Rails::VERSION::MAJOR >= 3
|
||||||
map.connect '/exceptionhandler', :controller => 'exceptionhandler', :action => 'index'
|
RedmineApp::Application.routes.draw do
|
||||||
map.connect '/maps', :controller => 'maps', :action => 'index'
|
match 'exceptionhandler', :to => 'exceptionhandler#index', :via => [:get, :post]
|
||||||
map.connect '/uploadFile', :controller => 'maps', :action => 'uploadFile'
|
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 '/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
|
end
|
||||||
|
|||||||
21
init.rb
21
init.rb
@@ -1,10 +1,29 @@
|
|||||||
require 'redmine'
|
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
|
Redmine::Plugin.register :redmine_exception_handler do
|
||||||
name 'Redmine Exception Handler plugin'
|
name 'Redmine Exception Handler plugin'
|
||||||
author 'Rick Barrette <rickbarrette@gmail.com>'
|
author 'Rick Barrette <rickbarrette@gmail.com>'
|
||||||
description 'An Exception Report Handler plugin for Redmine <= 1.4.x'
|
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'
|
url 'http://example.com/redmine/exceptionhandler'
|
||||||
author_url 'http://rickbarrette.dyndns.org'
|
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
|
end
|
||||||
|
|||||||
@@ -9,4 +9,4 @@
|
|||||||
|
|
||||||
PROGUARD_HOME=`dirname "$0"`/..
|
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