Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbenakamoorthi <benaka.moorthi@gmail.com>2012-05-26 23:39:16 +0400
committerbenakamoorthi <benaka.moorthi@gmail.com>2012-05-26 23:39:16 +0400
commit71fc2e87eb99212ccd0da6235a8410f55c39c7b5 (patch)
tree6c1ca494613399a26eedbbff0247f46a63ecd84e /plugins/DBStats/templates
parent6add1fa233d9312651d79efb5f76fb5da62b0960 (diff)
Fixes #3004, redesigned DBStats plugin, added several new reports including database space taken up by tracker tables, database space taken up by archive blob tables, database space taken up by archive metric tables, database space taken up by individual reports & database space taken up by individual metrics.
Notes: * Added ability to highlight the summary row in ViewDataTable and the ability to always show the summary row regardless of what report page is currently being shown. * Fixed small issue w/ ViewDataTable::hasReportBeenPurged: default values should be specified in calls to getRequestVar. * Added Piwik_FetchAssoc function to PluginsFunctions/Sql.php * Augmented ColumnCallbackAddColumnQuotient filter so the divisor can be obtained from the summary row. * Modified AddSummaryRow filter so it wouldn't delete rows if desired. * Added ColumnCallbackAddColumn filer that adds a new column to each row based on the result of a callback. * Modified ColumnCallbackReplace filter so callback can operate on more than one column value if desired. * Modified Limit filter so, if desired, the summary row can be exempted from deletion. * Added GroupBy filter that groups/sums rows by the result of a callback function. * Fixed GenerateGraphData.php bug where priority filters were not called on view data table. * Added getPrettyNumber utility function. git-svn-id: http://dev.piwik.org/svn/trunk@6324 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/DBStats/templates')
-rw-r--r--plugins/DBStats/templates/DBStats.tpl52
-rwxr-xr-xplugins/DBStats/templates/index.tpl154
2 files changed, 154 insertions, 52 deletions
diff --git a/plugins/DBStats/templates/DBStats.tpl b/plugins/DBStats/templates/DBStats.tpl
deleted file mode 100644
index 686e3d1fca..0000000000
--- a/plugins/DBStats/templates/DBStats.tpl
+++ /dev/null
@@ -1,52 +0,0 @@
-{assign var=showSitesSelection value=false}
-{assign var=showPeriodSelection value=false}
-{include file="CoreAdminHome/templates/header.tpl"}
-<div style="max-width:980px;">
-
-<h2>{'DBStats_DatabaseUsage'|translate}</h2>
-{assign var=totalSize value=$tablesStatus.Total.Total_length}
-<p>{'DBStats_MainDescription'|translate:$totalSize}
-<br />
-{'DBStats_LearnMore'|translate:"<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' target='_blank'>Piwik Auto Archiving</a>"}
-<br />
-{'PrivacyManager_DeleteDataSettings'|translate}: <a href='{url module="PrivacyManager" action="privacySettings"}#deleteLogsAnchor'>
-{capture assign=clickDeleteLogSettings}{'PrivacyManager_DeleteDataSettings'|translate}{/capture}
- {'PrivacyManager_ClickHereSettings'|translate:"'$clickDeleteLogSettings'"}
- </a>
-
-<table class="dataTable entityTable">
- <thead>
- <tr>
- <th>{'DBStats_Table'|translate}</th>
- <th>{'DBStats_RowCount'|translate}</th>
- <th>{'DBStats_DataSize'|translate}</th>
- <th>{'DBStats_IndexSize'|translate}</th>
- <th>{'DBStats_TotalSize'|translate}</th>
- </tr>
- </thead>
- <tbody id="tables">
- {foreach from=$tablesStatus key=index item=table}
- <tr {if $table.Name == 'Total'}class="highlight" style="font-weight:bold;"{/if}>
- <td>
- {$table.Name}
- </td>
- <td>
- {$table.Rows}
- </td>
- <td>
- {$table.Data_length}b
- </td>
- <td>
- {$table.Index_length}b
- </td>
- <td>
- {$table.Total_length}b
- </td>
- </tr>
- {/foreach}
- </tbody>
-</table>
-
-</div>
-
-{include file="CoreAdminHome/templates/footer.tpl"}
diff --git a/plugins/DBStats/templates/index.tpl b/plugins/DBStats/templates/index.tpl
new file mode 100755
index 0000000000..b84ab4691c
--- /dev/null
+++ b/plugins/DBStats/templates/index.tpl
@@ -0,0 +1,154 @@
+{assign var=showSitesSelection value=false}
+{assign var=showPeriodSelection value=false}
+{include file="CoreAdminHome/templates/header.tpl"}
+{loadJavascriptTranslations plugins='CoreAdminHome CoreHome'}
+
+{literal}
+<style>
+.dbstatsTable {
+ display: inline-block;
+}
+.dbstatsTable>tbody>tr>td:first-child {
+ width: 550px;
+}
+.dbstatsTable h2 {
+ width: 500px;
+}
+.adminTable.dbstatsTable a {
+ color: black;
+ text-decoration: underline;
+}
+</style>
+{/literal}
+
+<a name="databaseUsageSummary"></a>
+<h2>{'DBStats_DatabaseUsage'|translate}</h2>
+<p>
+ {'DBStats_MainDescription'|translate:$totalSpaceUsed}<br/>
+ {'DBStats_LearnMore'|translate:"<a href='?module=Proxy&action=redirect&url=http://piwik.org/docs/setup-auto-archiving/' target='_blank'>Piwik Auto Archiving</a>"}<br/>
+ <br/>
+</p>
+<table class="adminTable dbstatsTable">
+ <tbody>
+ <tr>
+ <td>{$databaseUsageSummary}</td>
+ <td>
+ <h3 style="margin-top:0">{'General_GeneralInformation'|translate}</h3><br/>
+ <p style="font-size:1.4em;padding-left:21px;line-height:1.8em">
+ <strong><em>{$userCount}</strong></em>&nbsp;{if $userCount == 1}{'UsersManager_User'|translate}{else}{'UsersManager_MenuUsers'|translate}{/if}<br/>
+ <strong><em>{$siteCount}</strong></em>&nbsp;{if $siteCount == 1}{'General_Website'|translate}{else}{'Referers_Websites'|translate}{/if}
+ </p><br/>
+ {capture assign=clickDeleteLogSettings}{'PrivacyManager_DeleteDataSettings'|translate}{/capture}
+ <h3 style="margin-top:0">{'PrivacyManager_DeleteDataSettings'|translate}</h3><br/>
+ <p>
+ {'PrivacyManager_DeleteDataDescription'|translate}
+ <br/>
+ <a href='{url module="PrivacyManager" action="privacySettings"}#deleteLogsAnchor'>
+ {'PrivacyManager_ClickHereSettings'|translate:"'$clickDeleteLogSettings'"}
+ </a>
+ </p>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<br/>
+
+<a name="trackerDataSummary"></a>
+<table class="adminTable dbstatsTable">
+ <tbody>
+ <tr>
+ <td>
+ <h2>{'DBStats_TrackerTables'|translate}</h2>
+ {$trackerDataSummary}
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+ </tbody>
+</table>
+
+<a name="reportDataSummary"></a>
+<table class="adminTable dbstatsTable">
+ <tbody>
+ <tr>
+ <td>
+ <h2>{'DBStats_ReportTables'|translate}</h2>
+ {$reportDataSummary}
+ </td>
+ <td>
+ <h2>{'General_Reports'|translate}</h2>
+ <div class="ajaxLoad" href="/index.php?module=DBStats&action=getIndividualReportsSummary&viewDataTable=table">
+ <span class="loadingPiwik"><img src="themes/default/images/loading-blue.gif" />{'General_LoadingData'|translate}</span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<a name="metricDataSummary"></a>
+<table class="adminTable dbstatsTable">
+ <tbody>
+ <tr>
+ <td>
+ <h2>{'DBStats_MetricTables'|translate}</h2>
+ {$metricDataSummary}
+ </td>
+ <td>
+ <h2>{'General_Metrics'|translate}</h2>
+ <div class="ajaxLoad" href="/index.php?module=DBStats&action=getIndividualMetricsSummary&viewDataTable=table">
+ <span class="loadingPiwik"><img src="themes/default/images/loading-blue.gif" />{'General_LoadingData'|translate}</span>
+ </div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+
+<a name="adminDataSummary"></a>
+<table class="adminTable dbstatsTable">
+ <tbody>
+ <tr>
+ <td>
+ <h2>{'DBStats_OtherTables'|translate}</h2>
+ {$adminDataSummary}
+ </td>
+ <td>&nbsp;</td>
+ </tr>
+ </tbody>
+</table>
+
+{literal}
+<script type="text/javascript">
+(function( $ ){
+ $(document).ready(function() {
+ $('.ajaxLoad').each(function() {
+ var self = this,
+ reportUrl = $(this).attr('href');
+
+ // build & execute AJAX request
+ var request =
+ {
+ type: 'GET',
+ url: reportUrl,
+ dataType: 'html',
+ async: true,
+ error: piwikHelper.ajaxHandleError, // Callback when the request fails
+ data: {
+ idSite: broadcast.getValueFromUrl('idSite'),
+ period: broadcast.getValueFromUrl('period'),
+ date: broadcast.getValueFromUrl('date')
+ },
+ success: function(data) {
+ $('.loadingPiwik', self).hide();
+ $(self).html(data);
+ }
+ };
+
+ piwikHelper.queueAjaxRequest($.ajax(request));
+ });
+ });
+})( jQuery );
+</script>
+{/literal}
+
+{include file="CoreAdminHome/templates/footer.tpl"}
+