mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
(refs #32)Add version to plugin meta information
This commit is contained in:
@@ -142,6 +142,7 @@ trait SystemSettingsControllerBase extends ControllerBase {
|
|||||||
SystemSettingsControllerBase.AvailablePlugin(
|
SystemSettingsControllerBase.AvailablePlugin(
|
||||||
repo.id,
|
repo.id,
|
||||||
properties.getProperty("id"),
|
properties.getProperty("id"),
|
||||||
|
properties.getProperty("version"),
|
||||||
properties.getProperty("author"),
|
properties.getProperty("author"),
|
||||||
properties.getProperty("url"),
|
properties.getProperty("url"),
|
||||||
properties.getProperty("description"))
|
properties.getProperty("description"))
|
||||||
@@ -153,5 +154,6 @@ trait SystemSettingsControllerBase extends ControllerBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
object SystemSettingsControllerBase {
|
object SystemSettingsControllerBase {
|
||||||
case class AvailablePlugin(repository: String, id: String, author: String, url: String, description: String)
|
case class AvailablePlugin(
|
||||||
|
repository: String, id: String, version: String, author: String, url: String, description: String)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import org.mozilla.javascript.{Function => JsFunction}
|
|||||||
import scala.collection.mutable.ListBuffer
|
import scala.collection.mutable.ListBuffer
|
||||||
import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
||||||
|
|
||||||
class JavaScriptPlugin(val id: String, val author: String, val url: String, val description: String) extends Plugin {
|
class JavaScriptPlugin(val id: String, val version: String,
|
||||||
|
val author: String, val url: String, val description: String) extends Plugin {
|
||||||
|
|
||||||
private val repositoryMenuList = ListBuffer[RepositoryMenu]()
|
private val repositoryMenuList = ListBuffer[RepositoryMenu]()
|
||||||
private val globalMenuList = ListBuffer[GlobalMenu]()
|
private val globalMenuList = ListBuffer[GlobalMenu]()
|
||||||
@@ -65,7 +66,8 @@ class JavaScriptPlugin(val id: String, val author: String, val url: String, val
|
|||||||
|
|
||||||
object JavaScriptPlugin {
|
object JavaScriptPlugin {
|
||||||
|
|
||||||
def define(id: String, author: String, url: String, description: String) = new JavaScriptPlugin(id, author, url, description)
|
def define(id: String, version: String, author: String, url: String, description: String)
|
||||||
|
= new JavaScriptPlugin(id, version, author, url, description)
|
||||||
|
|
||||||
def evaluateJavaScript(script: String, vars: Map[String, Any] = Map.empty): Any = {
|
def evaluateJavaScript(script: String, vars: Map[String, Any] = Map.empty): Any = {
|
||||||
val context = JsContext.enter()
|
val context = JsContext.enter()
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
|||||||
|
|
||||||
trait Plugin {
|
trait Plugin {
|
||||||
val id: String
|
val id: String
|
||||||
|
val version: String
|
||||||
val author: String
|
val author: String
|
||||||
val url: String
|
val url: String
|
||||||
val description: String
|
val description: String
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ object PluginSystem {
|
|||||||
try {
|
try {
|
||||||
JavaScriptPlugin.evaluateJavaScript(script, Map(
|
JavaScriptPlugin.evaluateJavaScript(script, Map(
|
||||||
"id" -> properties.getProperty("id"),
|
"id" -> properties.getProperty("id"),
|
||||||
|
"version" -> properties.getProperty("version"),
|
||||||
"author" -> properties.getProperty("author"),
|
"author" -> properties.getProperty("author"),
|
||||||
"url" -> properties.getProperty("url"),
|
"url" -> properties.getProperty("url"),
|
||||||
"description" -> properties.getProperty("description")
|
"description" -> properties.getProperty("description")
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
|||||||
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
|
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
|
||||||
|
|
||||||
// TODO This is a sample implementation for Scala based plug-ins.
|
// TODO This is a sample implementation for Scala based plug-ins.
|
||||||
class ScalaPlugin(val id: String, val author: String, val url: String, val description: String) extends Plugin {
|
class ScalaPlugin(val id: String, val version: String,
|
||||||
|
val author: String, val url: String, val description: String) extends Plugin {
|
||||||
|
|
||||||
private val repositoryMenuList = ListBuffer[RepositoryMenu]()
|
private val repositoryMenuList = ListBuffer[RepositoryMenu]()
|
||||||
private val globalMenuList = ListBuffer[GlobalMenu]()
|
private val globalMenuList = ListBuffer[GlobalMenu]()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Version</th>
|
||||||
<th>Provider</th>
|
<th>Provider</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
||||||
@plugin.id
|
@plugin.id
|
||||||
</td>
|
</td>
|
||||||
|
<td>@plugin.version</td>
|
||||||
<td><a href="@plugin.url">@plugin.author</a></td>
|
<td><a href="@plugin.url">@plugin.author</a></td>
|
||||||
<td>@plugin.description</td>
|
<td>@plugin.description</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
<th>Version</th>
|
||||||
<th>Provider</th>
|
<th>Provider</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
||||||
@plugin.id
|
@plugin.id
|
||||||
</td>
|
</td>
|
||||||
|
<td>@plugin.version</td>
|
||||||
<td><a href="@plugin.url">@plugin.author</a></td>
|
<td><a href="@plugin.url">@plugin.author</a></td>
|
||||||
<td>@plugin.description</td>
|
<td>@plugin.description</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user