mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-09 06:55:54 +01:00
Add Result case classes for plugin
This commit is contained in:
8
src/main/scala/plugin/Results.scala
Normal file
8
src/main/scala/plugin/Results.scala
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
package plugin
|
||||||
|
|
||||||
|
import play.twirl.api.Html
|
||||||
|
|
||||||
|
object Results {
|
||||||
|
case class Redirect(path: String)
|
||||||
|
case class Fragment(html: Html)
|
||||||
|
}
|
||||||
@@ -9,6 +9,7 @@ import plugin.PluginRegistry
|
|||||||
import service.SystemSettingsService
|
import service.SystemSettingsService
|
||||||
import util.Keys
|
import util.Keys
|
||||||
import app.Context
|
import app.Context
|
||||||
|
import plugin.Results._
|
||||||
|
|
||||||
class PluginActionFilter extends Filter with SystemSettingsService {
|
class PluginActionFilter extends Filter with SystemSettingsService {
|
||||||
|
|
||||||
@@ -39,6 +40,11 @@ class PluginActionFilter extends Filter with SystemSettingsService {
|
|||||||
// TODO title of plugin action
|
// TODO title of plugin action
|
||||||
res.getWriter.write(html.main("TODO")(x).body)
|
res.getWriter.write(html.main("TODO")(x).body)
|
||||||
res.getWriter.flush()
|
res.getWriter.flush()
|
||||||
|
case Redirect(x) =>
|
||||||
|
res.sendRedirect(x)
|
||||||
|
case Fragment(x) =>
|
||||||
|
res.getWriter.write(x.body)
|
||||||
|
res.getWriter.flush()
|
||||||
}
|
}
|
||||||
}.getOrElse {
|
}.getOrElse {
|
||||||
chain.doFilter(req, res)
|
chain.doFilter(req, res)
|
||||||
|
|||||||
Reference in New Issue
Block a user