forked from xwikisas/application-admintools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for downloading important files xwikisas#8
* Created a JS listener for button events * UI optimizations * Moved the modals from AdminTools.WebHome to Macro.vm * Created macros for the modals * Modified translations
- Loading branch information
1 parent
b5499b7
commit 07628bf
Showing
10 changed files
with
350 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
application-admintools-ui/src/main/resources/AdminTools/Code/Macros.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
<?xml version='1.1' encoding='UTF-8'?> | ||
|
||
<!-- | ||
* See the NOTICE file distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
--> | ||
<xwikidoc version="1.4" reference="AdminTools.Code.Macros" locale=""> | ||
<web>AdminTools.Code</web> | ||
<name>Macros</name> | ||
<language/> | ||
<defaultLanguage/> | ||
<translation>0</translation> | ||
<creator>xwiki:XWiki.Admin</creator> | ||
<parent>AdminTools.WebHome</parent> | ||
<author>xwiki:XWiki.Admin</author> | ||
<contentAuthor>xwiki:XWiki.Admin</contentAuthor> | ||
<version>1.1</version> | ||
<title>Macros</title> | ||
<comment/> | ||
<minorEdit>false</minorEdit> | ||
<syntaxId>xwiki/2.1</syntaxId> | ||
<hidden>true</hidden> | ||
<content>{{velocity output="false"}} | ||
#macro (viewLastNLinesMoldal $id) | ||
#set ($modalId = $id + "ViewLastNLinesModal") | ||
#set ($formId = $id + "LastNLogLinesForm") | ||
#set ($inputId = $id + "NoLines") | ||
{{html clean='false'}} | ||
<div class="modal fade" id="$modalId" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
<div class="modal-dialog modal-sm" role="document"> | ||
<div class="modal-content"> | ||
<div class="logs-modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">&times;</span></button> | ||
<h1 class="modal-title" id="viewLastNLinesModalLabel"> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.title')) | ||
</h1> | ||
</div> | ||
<div class="modal-body"> | ||
<form class="xform" id="$formId" action="$request.getContextPath()/rest/admintools/files/logs"> | ||
<dl> | ||
<dt> | ||
<label for="noLines">$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.nLines.label')) </label> | ||
<span class="xHint">max 50000</span> | ||
</dt> | ||
<dd><input type="number" id="$inputId" name="noLines" placeholder="1000"></dd> | ||
</dl> | ||
</form> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary"> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.logs.modal.submit'))</button> | ||
<button type="button" class="btn btn-default" data-dismiss="modal"> | ||
$escapetool.xml($services.localization.render('cancel'))</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{/html}} | ||
#end | ||
|
||
#macro (downloadFiles $id) | ||
#set ($modalId = $id + "DownloadFilesModal") | ||
#set ($formId = $id + "DownloadForm") | ||
|
||
{{html clean='false'}} | ||
<div class="modal fade" id="$modalId" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> | ||
<div class="modal-dialog" role="document"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> | ||
<span aria-hidden="true">&times;</span></button> | ||
<h1 class="modal-title downloadFilesModalTitle"> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.title')) | ||
</h1> | ||
</div> | ||
<div class="modal-body"> | ||
<form id="$formId" action="$request.getContextPath()/rest/admintools/files"> | ||
<div class="download-modal-content"> | ||
<dl> | ||
<dt><label><input type="checkbox" name="files" value="xwikiConfig" checked> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.xwikiConfig.title')) | ||
</label> | ||
</dt> | ||
<dt><label><input type="checkbox" name="files" value="xwikiProperties" checked> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.xwikiProperties.title')) | ||
</label> | ||
</dt> | ||
<dt><label><input type="checkbox" name="files" value="dataProviderResource" checked> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.provided'))</label> | ||
</dt> | ||
<dt><label><input type="checkbox" name="files" value="logsDataResource" checked> Logs</label></dt> | ||
<dt> | ||
<div class="dateFields"> | ||
<label for="from">$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.date.from')) | ||
</label> <input type="date" id="from" name="from"> | ||
<label for="to">$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.date.to')) | ||
</label> <input type="date" id="to" name="to"> | ||
</div> | ||
</dt> | ||
</dl> | ||
</div> | ||
</form> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-primary"> | ||
$escapetool.xml($services.localization.render('adminTools.dashboard.download.modal.button'))</button> | ||
<button type="button" class="btn btn-default" data-dismiss="modal"> | ||
$escapetool.xml($services.localization.render('cancel'))</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{/html}} | ||
#end | ||
{{/velocity}}</content> | ||
</xwikidoc> |
Oops, something went wrong.