File tree 2 files changed +9
-8
lines changed
scala/fr/brouillard/gitbucket/h2/controller
twirl/fr/brouillard/gitbucket/h2
2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class H2BackupController extends ControllerBase with AdminAuthenticator {
27
27
// private val defaultBackupFile:String = new File(GitBucketHome, "gitbucket-database-backup.zip").toString;
28
28
29
29
def exportDatabase (exportFile : File ): Unit = {
30
- val destFile = if (exportFile.isAbsolute()) exportFile else new File (GitBucketHome , exportFile.toString)
30
+ val destFile = if (exportFile.isAbsolute()) exportFile else new File (GitBucketHome + " /backup " , exportFile.toString)
31
31
32
32
val session = Database .getSession(request)
33
33
val conn = session.conn
@@ -64,13 +64,14 @@ class H2BackupController extends ControllerBase with AdminAuthenticator {
64
64
65
65
post(" /database/backup" , backupForm) { form : BackupForm =>
66
66
exportDatabase(new File (form.destFile))
67
- flash += " info" -> " H2 Database has been exported."
67
+ val msg : String = " H2 Database has been exported to '" + form.destFile+ " '."
68
+ flash += " info" -> msg
68
69
flash += " dest" -> form.destFile
69
70
redirect(" /admin/h2backup" )
70
71
}
71
72
72
73
private def defaultBackupFileName (): String = {
73
- val format = new java.text.SimpleDateFormat (" yyyy-MM-dd-HHmm " )
74
- " gitbucket-database-backup -" + format.format(new Date ())+ " .zip"
74
+ val format = new java.text.SimpleDateFormat (" yyyy-MM-dd_HH-mm " )
75
+ " gitbucket-db -" + format.format(new Date ())+ " .zip"
75
76
}
76
77
}
Original file line number Diff line number Diff line change 10
10
@information(info)
11
11
< form action ="@path/database/backup " method ="POST ">
12
12
< div class ="panel panel-default ">
13
- < div class ="panel-heading strong "> Database backup </ div >
13
+ < div class ="panel-heading strong "> H2 Database Backup </ div >
14
14
< div class ="panel-body ">
15
15
< fieldset >
16
- < label > < span class ="strong "> Database backup file :</ span > </ label >
16
+ < label > < span class ="strong "> H2 Database Backup File :</ span > </ label >
17
17
< p class ="muted ">
18
- Allows to export/backup the database content. The same action can be achieved via an HTTP GET call to @path/database/backup
18
+ Allows to export/backup the H2 database content. The same action can be achieved via an HTTP GET call to @path/database/backup .
19
19
</ p >
20
- < input type ="text " name ="dest " value ="@dest " style ="width: 400px " />
20
+ backup/ < input type ="text " name ="dest " value ="@dest " style ="width: 400px " />
21
21
</ fieldset >
22
22
</ div >
23
23
</ div >
You can’t perform that action at this time.
0 commit comments