Изменения документа Space Used

Редактировал(а) Dmitriy Rybakov 08.08.2025, 15:49

От версии 2.1
отредактировано Dmitriy Rybakov
на 08.08.2025, 15:49
Изменить комментарий: К данной версии нет комментариев
К версии 1.1
отредактировано Dmitriy Rybakov
на 05.08.2025, 13:07
Изменить комментарий: Imported from XAR

Сводка

Подробности

Свойства страницы
Содержимое
... ... @@ -9,6 +9,7 @@
9 9  __xwikiattrecyclebin__ : Recycle bin of attachments.
10 10  
11 11  {{velocity}}
12 +
12 12  ## Check if Filesystem Storage is enabled at the moment.
13 13  #set($fsstore = false)
14 14  #if($xcontext.getContext().getWiki().getAttachmentStore().getClass().getName().contains("Filesystem"))
... ... @@ -15,6 +15,7 @@
15 15   #set($fsstore = true)
16 16  #end
17 17  
19 +
18 18  #if($hasProgramming)
19 19   #set($sqlTools = $xwiki.parseGroovyFromPage('Admin.SQLToolsGroovy'))
20 20   #set($system = $sqlTools.getXWikiDatabaseSystemFromDatabaseMetadata($xcontext))
... ... @@ -22,13 +22,13 @@
22 22   #if($system == 'HSQL Database Engine')
23 23   {{warning}}$system is not supported for this action{{/warning}}
24 24   #else
25 - ## >>> FIX: никогда не используем wikimanager (ломается на Hibernate 6)
26 - #if($services.wiki)
27 + #if($services.wikimanager)
28 + #set($dbs = $services.wikimanager.getAllWikis())
29 + #elseif($services.wiki)
27 27   #set($dbs = $services.wiki.getAllIds())
28 28   #else
29 29   #set($dbs = ["$xcontext.getDatabase()"])
30 30   #end
31 - ## <<<
32 32  
33 33   #if($fsstore)
34 34   #set($tables = ['xwikirecyclebin','xwikircs'])
... ... @@ -38,7 +38,6 @@
38 38  
39 39   #set($prefix = $xwiki.getXWiki().Param('xwiki.db.prefix',''))
40 40   #set($connection = $sqlTools.getXWikiConnection($xwiki, $xcontext))
41 -
42 42   #foreach($schema in $dbs)
43 43   #set($alltables = '')
44 44   $xcontext.setDatabase($schema)
... ... @@ -46,13 +46,11 @@
46 46   #if($schema == "xwiki")
47 47   #set($schema = $xwiki.getXWiki().Param('xwiki.db', $schema))
48 48   #end
49 -
50 50   #foreach($table in $tables)
51 51   #set($query = "select sum(round(data_length/1024/1024,2)) as '${table}' from information_schema.tables where table_name='${table}' and table_schema='${prefix}${schema}';")
52 52   #set($results = $sqlTools.getResults($connection, $query, false))
53 53   #set($alltables = $alltables + $results)
54 54   #end
55 -
56 56   $alltables
57 57   #end
58 58   #end
... ... @@ -65,5 +65,4 @@
65 65  #if($fsstore != true)
66 66  {{warning}}It appears that you're not using the filesystem attachment store feature. You should use it if you plan to have large documents in your wiki. This feature is available since XWiki 3.4. More information [[here>>http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Attachments#HFilesystemAttachmentStore]]{{/warning}}
67 67  #end
68 -
69 69  {{/velocity}}