mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15: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(
|
||||
repo.id,
|
||||
properties.getProperty("id"),
|
||||
properties.getProperty("version"),
|
||||
properties.getProperty("author"),
|
||||
properties.getProperty("url"),
|
||||
properties.getProperty("description"))
|
||||
@@ -153,5 +154,6 @@ trait SystemSettingsControllerBase extends ControllerBase {
|
||||
}
|
||||
|
||||
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 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 globalMenuList = ListBuffer[GlobalMenu]()
|
||||
@@ -65,7 +66,8 @@ class JavaScriptPlugin(val id: String, val author: String, val url: String, val
|
||||
|
||||
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 = {
|
||||
val context = JsContext.enter()
|
||||
|
||||
@@ -4,6 +4,7 @@ import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
||||
|
||||
trait Plugin {
|
||||
val id: String
|
||||
val version: String
|
||||
val author: String
|
||||
val url: String
|
||||
val description: String
|
||||
|
||||
@@ -62,6 +62,7 @@ object PluginSystem {
|
||||
try {
|
||||
JavaScriptPlugin.evaluateJavaScript(script, Map(
|
||||
"id" -> properties.getProperty("id"),
|
||||
"version" -> properties.getProperty("version"),
|
||||
"author" -> properties.getProperty("author"),
|
||||
"url" -> properties.getProperty("url"),
|
||||
"description" -> properties.getProperty("description")
|
||||
|
||||
@@ -6,7 +6,8 @@ import plugin.PluginSystem.{Action, GlobalMenu, RepositoryMenu}
|
||||
import javax.servlet.http.{HttpServletResponse, HttpServletRequest}
|
||||
|
||||
// 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 globalMenuList = ListBuffer[GlobalMenu]()
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Version</th>
|
||||
<th>Provider</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
@@ -17,6 +18,7 @@
|
||||
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
||||
@plugin.id
|
||||
</td>
|
||||
<td>@plugin.version</td>
|
||||
<td><a href="@plugin.url">@plugin.author</a></td>
|
||||
<td>@plugin.description</td>
|
||||
</tr>
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Version</th>
|
||||
<th>Provider</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
@@ -17,6 +18,7 @@
|
||||
<input type="checkbox" name="pluginId[@i]" value="@plugin.id"/>
|
||||
@plugin.id
|
||||
</td>
|
||||
<td>@plugin.version</td>
|
||||
<td><a href="@plugin.url">@plugin.author</a></td>
|
||||
<td>@plugin.description</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user