1- import javax .servlet .ServletContext
2-
31import fr .brouillard .gitbucket .h2 .controller .H2BackupController
4- import gitbucket .core .plugin .PluginRegistry
5- import gitbucket .core .service .SystemSettingsService .SystemSettings
6- import gitbucket .core .util .Version
2+ import io .github .gitbucket .solidbase .model .Version
3+ import gitbucket .core .controller .Context
4+ import gitbucket .core .plugin .Link
5+
76
87class Plugin extends gitbucket.core.plugin.Plugin {
98 override val pluginId : String = " h2-backup"
@@ -13,25 +12,13 @@ class Plugin extends gitbucket.core.plugin.Plugin {
1312 override val description : String = " Allows to export h2 database of gitbucket"
1413
1514 override val versions : List [Version ] = List (
16- Version (1 , 0 )
15+ new Version (" 1.2.0" ),
16+ new Version (" 1.0.0" )
1717 )
1818
19- override def javaScripts (registry : PluginRegistry , context : ServletContext , settings : SystemSettings ): Seq [(String , String )] = {
20- // Add Snippet link to the header
21- val path = settings.baseUrl.getOrElse(context.getContextPath)
22- Seq (
23- " .*/admin/h2backup" -> s """
24- | $$ ('#system-admin-menu-container>li:last').after(
25- | $$ ('<li class="active"><a href=" ${path}/admin/h2backup">H2 Backup</a></li>')
26- |);
27- """ .stripMargin,
28- " .*/admin/(?!h2backup).*" -> s """
29- | $$ ('#system-admin-menu-container>li:last').after(
30- | $$ ('<li><a href=" ${path}/admin/h2backup">H2 Backup</a></li>')
31- |);
32- """ .stripMargin
33- )
34- }
19+ override val systemSettingMenus : Seq [(Context ) => Option [Link ]] = Seq (
20+ (ctx : Context ) => Some (Link (" h2-backup" , " H2 Backup" , " admin/h2backup" ))
21+ )
3522
3623 override val controllers = Seq (
3724 " /admin/h2backup" -> new H2BackupController ()
0 commit comments