Show month/halfyear usage

This commit is contained in:
Michael 2022-02-07 05:29:00 +00:00
parent 2fdd33f504
commit 58b4ecd6ae
3 changed files with 76 additions and 66 deletions

View file

@ -58,6 +58,7 @@ class Federation extends BaseAdmin
'relay' => ['name' => 'ActivityPub Relay', 'color' => '#888888'], // Grey like the second color of the ActivityPub logo 'relay' => ['name' => 'ActivityPub Relay', 'color' => '#888888'], // Grey like the second color of the ActivityPub logo
'socialhome' => ['name' => 'SocialHome', 'color' => '#52056b'], // lilac from the Django Image used at the Socialhome homepage 'socialhome' => ['name' => 'SocialHome', 'color' => '#52056b'], // lilac from the Django Image used at the Socialhome homepage
'wordpress' => ['name' => 'WordPress', 'color' => '#016087'], // Background color of the homepage 'wordpress' => ['name' => 'WordPress', 'color' => '#016087'], // Background color of the homepage
'write.as' => ['name' => 'Write.as', 'color' => '#00ace3'], // Border color of the homepage
'writefreely' => ['name' => 'WriteFreely', 'color' => '#292929'], // Font color of the homepage 'writefreely' => ['name' => 'WriteFreely', 'color' => '#292929'], // Font color of the homepage
'other' => ['name' => DI::l10n()->t('Other'), 'color' => '#F1007E'], // ActivityPub main color 'other' => ['name' => DI::l10n()->t('Other'), 'color' => '#F1007E'], // ActivityPub main color
]; ];
@ -69,15 +70,21 @@ class Federation extends BaseAdmin
$counts[$platform] = []; $counts[$platform] = [];
} }
$total = 0; $total = 0;
$users = 0; $users = 0;
$month = 0;
$halfyear = 0;
$gservers = DBA::p("SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`, `platform`, $gservers = DBA::p("SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`,
SUM(IFNULL(`active-month-users`, `active-week-users`)) AS `month`,
SUM(IFNULL(`active-halfyear-users`, `active-week-users`)) AS `halfyear`, `platform`,
ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version` ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version`
FROM `gserver` WHERE NOT `failed` AND `detection-method` != ? AND NOT `network` IN (?, ?) GROUP BY `platform`", GServer::DETECT_MANUAL, Protocol::PHANTOM, Protocol::FEED); FROM `gserver` WHERE NOT `failed` AND `detection-method` != ? AND NOT `network` IN (?, ?) GROUP BY `platform`", GServer::DETECT_MANUAL, Protocol::PHANTOM, Protocol::FEED);
while ($gserver = DBA::fetch($gservers)) { while ($gserver = DBA::fetch($gservers)) {
$total += $gserver['total']; $total += $gserver['total'];
$users += $gserver['users']; $users += $gserver['users'];
$month += $gserver['month'];
$halfyear += $gserver['halfyear'];
$versionCounts = []; $versionCounts = [];
$versions = DBA::p("SELECT COUNT(*) AS `total`, `version` FROM `gserver` $versions = DBA::p("SELECT COUNT(*) AS `total`, `version` FROM `gserver`
@ -127,9 +134,11 @@ class Federation extends BaseAdmin
$versionCounts = array_merge($versionCounts, $counts[$platform][1] ?? []); $versionCounts = array_merge($versionCounts, $counts[$platform][1] ?? []);
} }
$gserver['platform'] = $platform; $gserver['platform'] = $platform;
$gserver['total'] += $counts[$platform][0]['total'] ?? 0; $gserver['total'] += $counts[$platform][0]['total'] ?? 0;
$gserver['users'] += $counts[$platform][0]['users'] ?? 0; $gserver['users'] += $counts[$platform][0]['users'] ?? 0;
$gserver['month'] += $counts[$platform][0]['month'] ?? 0;
$gserver['halfyear'] += $counts[$platform][0]['halfyear'] ?? 0;
} }
if ($platform == 'friendica') { if ($platform == 'friendica') {
@ -152,7 +161,7 @@ class Federation extends BaseAdmin
$gserver['platform'] = $systems[$platform]['name']; $gserver['platform'] = $systems[$platform]['name'];
$counts[$platform] = [$gserver, $versionCounts, str_replace([' ', '%'], '', $platform), $systems[$platform]['color']]; $counts[$platform] = [$gserver, $versionCounts, str_replace([' ', '%', '.'], '', $platform), $systems[$platform]['color']];
} }
DBA::close($gserver); DBA::close($gserver);
@ -167,7 +176,7 @@ class Federation extends BaseAdmin
'$intro' => $intro, '$intro' => $intro,
'$counts' => $counts, '$counts' => $counts,
'$version' => FRIENDICA_VERSION, '$version' => FRIENDICA_VERSION,
'$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes with %d registered users from the following platforms:', $total, $users), '$legendtext' => DI::l10n()->t('Currently this node is aware of %d nodes (%d active users last month, %d active users last six month, %d registered users in total) from the following platforms:', $total, $month, $halfyear, $users),
]); ]);
} }

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2022.05-dev\n" "Project-Id-Version: 2022.05-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-01-28 05:23+0000\n" "POT-Creation-Date: 2022-02-07 05:22+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -118,7 +118,7 @@ msgid "The feed for this item is unavailable."
msgstr "" msgstr ""
#: mod/editpost.php:38 mod/events.php:220 mod/follow.php:56 mod/follow.php:130 #: mod/editpost.php:38 mod/events.php:220 mod/follow.php:56 mod/follow.php:130
#: mod/item.php:185 mod/item.php:190 mod/item.php:940 mod/message.php:69 #: mod/item.php:185 mod/item.php:190 mod/item.php:930 mod/message.php:69
#: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:32 #: mod/message.php:111 mod/notes.php:44 mod/ostatus_subscribe.php:32
#: mod/photos.php:160 mod/photos.php:897 mod/repair_ostatus.php:31 #: mod/photos.php:160 mod/photos.php:897 mod/repair_ostatus.php:31
#: mod/settings.php:46 mod/settings.php:56 mod/settings.php:412 #: mod/settings.php:46 mod/settings.php:56 mod/settings.php:412
@ -464,7 +464,7 @@ msgstr ""
msgid "OStatus support is disabled. Contact can't be added." msgid "OStatus support is disabled. Contact can't be added."
msgstr "" msgstr ""
#: mod/follow.php:138 src/Content/Item.php:463 src/Content/Widget.php:76 #: mod/follow.php:138 src/Content/Item.php:452 src/Content/Widget.php:76
#: src/Model/Contact.php:1056 src/Model/Contact.php:1068 #: src/Model/Contact.php:1056 src/Model/Contact.php:1068
#: view/theme/vier/theme.php:172 #: view/theme/vier/theme.php:172
msgid "Connect/Follow" msgid "Connect/Follow"
@ -518,19 +518,19 @@ msgstr ""
msgid "Empty post discarded." msgid "Empty post discarded."
msgstr "" msgstr ""
#: mod/item.php:746 #: mod/item.php:736
msgid "Post updated." msgid "Post updated."
msgstr "" msgstr ""
#: mod/item.php:756 mod/item.php:761 #: mod/item.php:746 mod/item.php:751
msgid "Item wasn't stored." msgid "Item wasn't stored."
msgstr "" msgstr ""
#: mod/item.php:772 #: mod/item.php:762
msgid "Item couldn't be fetched." msgid "Item couldn't be fetched."
msgstr "" msgstr ""
#: mod/item.php:918 src/Module/Admin/Themes/Details.php:39 #: mod/item.php:908 src/Module/Admin/Themes/Details.php:39
#: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:41 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:41
#: src/Module/Debug/ItemBody.php:56 #: src/Module/Debug/ItemBody.php:56
msgid "Item not found." msgid "Item not found."
@ -1965,15 +1965,15 @@ msgstr ""
msgid "Friend Suggestions" msgid "Friend Suggestions"
msgstr "" msgstr ""
#: mod/tagger.php:78 src/Content/Item.php:346 src/Model/Item.php:2629 #: mod/tagger.php:78 src/Content/Item.php:335 src/Model/Item.php:2620
msgid "photo" msgid "photo"
msgstr "" msgstr ""
#: mod/tagger.php:78 src/Content/Item.php:341 src/Content/Item.php:350 #: mod/tagger.php:78 src/Content/Item.php:330 src/Content/Item.php:339
msgid "status" msgid "status"
msgstr "" msgstr ""
#: mod/tagger.php:111 src/Content/Item.php:360 #: mod/tagger.php:111 src/Content/Item.php:349
#, php-format #, php-format
msgid "%1$s tagged %2$s's %3$s with %4$s" msgid "%1$s tagged %2$s's %3$s with %4$s"
msgstr "" msgstr ""
@ -2714,55 +2714,55 @@ msgstr ""
msgid "show more" msgid "show more"
msgstr "" msgstr ""
#: src/Content/Item.php:305 #: src/Content/Item.php:294
#, php-format #, php-format
msgid "%1$s poked %2$s" msgid "%1$s poked %2$s"
msgstr "" msgstr ""
#: src/Content/Item.php:338 src/Model/Item.php:2627 #: src/Content/Item.php:327 src/Model/Item.php:2618
msgid "event" msgid "event"
msgstr "" msgstr ""
#: src/Content/Item.php:442 view/theme/frio/theme.php:254 #: src/Content/Item.php:431 view/theme/frio/theme.php:254
msgid "Follow Thread" msgid "Follow Thread"
msgstr "" msgstr ""
#: src/Content/Item.php:443 src/Model/Contact.php:1061 #: src/Content/Item.php:432 src/Model/Contact.php:1061
msgid "View Status" msgid "View Status"
msgstr "" msgstr ""
#: src/Content/Item.php:444 src/Content/Item.php:466 src/Model/Contact.php:995 #: src/Content/Item.php:433 src/Content/Item.php:455 src/Model/Contact.php:995
#: src/Model/Contact.php:1053 src/Model/Contact.php:1062 #: src/Model/Contact.php:1053 src/Model/Contact.php:1062
#: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:225 #: src/Module/Directory.php:157 src/Module/Settings/Profile/Index.php:225
msgid "View Profile" msgid "View Profile"
msgstr "" msgstr ""
#: src/Content/Item.php:445 src/Model/Contact.php:1063 #: src/Content/Item.php:434 src/Model/Contact.php:1063
msgid "View Photos" msgid "View Photos"
msgstr "" msgstr ""
#: src/Content/Item.php:446 src/Model/Contact.php:1054 #: src/Content/Item.php:435 src/Model/Contact.php:1054
#: src/Model/Contact.php:1064 #: src/Model/Contact.php:1064
msgid "Network Posts" msgid "Network Posts"
msgstr "" msgstr ""
#: src/Content/Item.php:447 src/Model/Contact.php:1055 #: src/Content/Item.php:436 src/Model/Contact.php:1055
#: src/Model/Contact.php:1065 #: src/Model/Contact.php:1065
msgid "View Contact" msgid "View Contact"
msgstr "" msgstr ""
#: src/Content/Item.php:448 src/Model/Contact.php:1066 #: src/Content/Item.php:437 src/Model/Contact.php:1066
msgid "Send PM" msgid "Send PM"
msgstr "" msgstr ""
#: src/Content/Item.php:449 src/Module/Admin/Blocklist/Contact.php:100 #: src/Content/Item.php:438 src/Module/Admin/Blocklist/Contact.php:100
#: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154 #: src/Module/Admin/Users/Active.php:140 src/Module/Admin/Users/Index.php:154
#: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348 #: src/Module/Contact.php:398 src/Module/Contact/Profile.php:348
#: src/Module/Contact/Profile.php:449 #: src/Module/Contact/Profile.php:449
msgid "Block" msgid "Block"
msgstr "" msgstr ""
#: src/Content/Item.php:450 src/Module/Contact.php:399 #: src/Content/Item.php:439 src/Module/Contact.php:399
#: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457 #: src/Module/Contact/Profile.php:349 src/Module/Contact/Profile.php:457
#: src/Module/Notifications/Introductions.php:132 #: src/Module/Notifications/Introductions.php:132
#: src/Module/Notifications/Introductions.php:204 #: src/Module/Notifications/Introductions.php:204
@ -2770,11 +2770,11 @@ msgstr ""
msgid "Ignore" msgid "Ignore"
msgstr "" msgstr ""
#: src/Content/Item.php:454 src/Object/Post.php:429 #: src/Content/Item.php:443 src/Object/Post.php:429
msgid "Languages" msgid "Languages"
msgstr "" msgstr ""
#: src/Content/Item.php:458 src/Model/Contact.php:1067 #: src/Content/Item.php:447 src/Model/Contact.php:1067
msgid "Poke" msgid "Poke"
msgstr "" msgstr ""
@ -3070,8 +3070,8 @@ msgid ""
"<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s" "<a href=\"%1$s\" target=\"_blank\" rel=\"noopener noreferrer\">%2$s</a> %3$s"
msgstr "" msgstr ""
#: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3158 #: src/Content/Text/BBCode.php:1185 src/Model/Item.php:3149
#: src/Model/Item.php:3164 src/Model/Item.php:3165 #: src/Model/Item.php:3155 src/Model/Item.php:3156
msgid "Link to source" msgid "Link to source"
msgstr "" msgstr ""
@ -4067,63 +4067,63 @@ msgstr ""
msgid "Forum" msgid "Forum"
msgstr "" msgstr ""
#: src/Model/Contact.php:2426 #: src/Model/Contact.php:2433
msgid "Disallowed profile URL." msgid "Disallowed profile URL."
msgstr "" msgstr ""
#: src/Model/Contact.php:2431 src/Module/Friendica.php:81 #: src/Model/Contact.php:2438 src/Module/Friendica.php:81
msgid "Blocked domain" msgid "Blocked domain"
msgstr "" msgstr ""
#: src/Model/Contact.php:2436 #: src/Model/Contact.php:2443
msgid "Connect URL missing." msgid "Connect URL missing."
msgstr "" msgstr ""
#: src/Model/Contact.php:2445 #: src/Model/Contact.php:2452
msgid "" msgid ""
"The contact could not be added. Please check the relevant network " "The contact could not be added. Please check the relevant network "
"credentials in your Settings -> Social Networks page." "credentials in your Settings -> Social Networks page."
msgstr "" msgstr ""
#: src/Model/Contact.php:2482 #: src/Model/Contact.php:2489
msgid "The profile address specified does not provide adequate information." msgid "The profile address specified does not provide adequate information."
msgstr "" msgstr ""
#: src/Model/Contact.php:2484 #: src/Model/Contact.php:2491
msgid "No compatible communication protocols or feeds were discovered." msgid "No compatible communication protocols or feeds were discovered."
msgstr "" msgstr ""
#: src/Model/Contact.php:2487 #: src/Model/Contact.php:2494
msgid "An author or name was not found." msgid "An author or name was not found."
msgstr "" msgstr ""
#: src/Model/Contact.php:2490 #: src/Model/Contact.php:2497
msgid "No browser URL could be matched to this address." msgid "No browser URL could be matched to this address."
msgstr "" msgstr ""
#: src/Model/Contact.php:2493 #: src/Model/Contact.php:2500
msgid "" msgid ""
"Unable to match @-style Identity Address with a known protocol or email " "Unable to match @-style Identity Address with a known protocol or email "
"contact." "contact."
msgstr "" msgstr ""
#: src/Model/Contact.php:2494 #: src/Model/Contact.php:2501
msgid "Use mailto: in front of address to force email check." msgid "Use mailto: in front of address to force email check."
msgstr "" msgstr ""
#: src/Model/Contact.php:2500 #: src/Model/Contact.php:2507
msgid "" msgid ""
"The profile address specified belongs to a network which has been disabled " "The profile address specified belongs to a network which has been disabled "
"on this site." "on this site."
msgstr "" msgstr ""
#: src/Model/Contact.php:2505 #: src/Model/Contact.php:2512
msgid "" msgid ""
"Limited profile. This person will be unable to receive direct/personal " "Limited profile. This person will be unable to receive direct/personal "
"notifications from you." "notifications from you."
msgstr "" msgstr ""
#: src/Model/Contact.php:2564 #: src/Model/Contact.php:2571
msgid "Unable to retrieve contact information." msgid "Unable to retrieve contact information."
msgstr "" msgstr ""
@ -4243,33 +4243,33 @@ msgstr ""
msgid "Edit groups" msgid "Edit groups"
msgstr "" msgstr ""
#: src/Model/Item.php:1680 #: src/Model/Item.php:1691
#, php-format #, php-format
msgid "Detected languages in this post:\\n%s" msgid "Detected languages in this post:\\n%s"
msgstr "" msgstr ""
#: src/Model/Item.php:2631 #: src/Model/Item.php:2622
msgid "activity" msgid "activity"
msgstr "" msgstr ""
#: src/Model/Item.php:2633 #: src/Model/Item.php:2624
msgid "comment" msgid "comment"
msgstr "" msgstr ""
#: src/Model/Item.php:2636 #: src/Model/Item.php:2627
msgid "post" msgid "post"
msgstr "" msgstr ""
#: src/Model/Item.php:2773 #: src/Model/Item.php:2764
#, php-format #, php-format
msgid "Content warning: %s" msgid "Content warning: %s"
msgstr "" msgstr ""
#: src/Model/Item.php:3123 #: src/Model/Item.php:3114
msgid "bytes" msgid "bytes"
msgstr "" msgstr ""
#: src/Model/Item.php:3152 src/Model/Item.php:3153 #: src/Model/Item.php:3143 src/Model/Item.php:3144
msgid "View on separate page" msgid "View on separate page"
msgstr "" msgstr ""
@ -4699,7 +4699,7 @@ msgstr ""
#: src/Module/Admin/Blocklist/Contact.php:94 #: src/Module/Admin/Blocklist/Contact.php:94
#: src/Module/Admin/Blocklist/Server/Add.php:89 #: src/Module/Admin/Blocklist/Server/Add.php:89
#: src/Module/Admin/Blocklist/Server/Index.php:78 #: src/Module/Admin/Blocklist/Server/Index.php:78
#: src/Module/Admin/Federation.php:159 src/Module/Admin/Item/Delete.php:64 #: src/Module/Admin/Federation.php:174 src/Module/Admin/Item/Delete.php:64
#: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:83 #: src/Module/Admin/Logs/Settings.php:79 src/Module/Admin/Logs/View.php:83
#: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:498 #: src/Module/Admin/Queue.php:72 src/Module/Admin/Site.php:498
#: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:232 #: src/Module/Admin/Storage.php:138 src/Module/Admin/Summary.php:232
@ -5109,29 +5109,30 @@ msgstr ""
msgid "Manage Additional Features" msgid "Manage Additional Features"
msgstr "" msgstr ""
#: src/Module/Admin/Federation.php:56 #: src/Module/Admin/Federation.php:63
msgid "Other" msgid "Other"
msgstr "" msgstr ""
#: src/Module/Admin/Federation.php:118 src/Module/Admin/Federation.php:348 #: src/Module/Admin/Federation.php:131 src/Module/Admin/Federation.php:363
msgid "unknown" msgid "unknown"
msgstr "" msgstr ""
#: src/Module/Admin/Federation.php:154 #: src/Module/Admin/Federation.php:169
msgid "" msgid ""
"This page offers you some numbers to the known part of the federated social " "This page offers you some numbers to the known part of the federated social "
"network your Friendica node is part of. These numbers are not complete but " "network your Friendica node is part of. These numbers are not complete but "
"only reflect the part of the network your node is aware of." "only reflect the part of the network your node is aware of."
msgstr "" msgstr ""
#: src/Module/Admin/Federation.php:160 src/Module/BaseAdmin.php:87 #: src/Module/Admin/Federation.php:175 src/Module/BaseAdmin.php:87
msgid "Federation Statistics" msgid "Federation Statistics"
msgstr "" msgstr ""
#: src/Module/Admin/Federation.php:164 #: src/Module/Admin/Federation.php:179
#, php-format #, php-format
msgid "" msgid ""
"Currently this node is aware of %d nodes with %d registered users from the " "Currently this node is aware of %d nodes (%d active users last month, %d "
"active users last six month, %d registered users in total) from the "
"following platforms:" "following platforms:"
msgstr "" msgstr ""
@ -8605,19 +8606,19 @@ msgstr ""
#: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329 #: src/Module/Profile/Profile.php:326 src/Module/Profile/Profile.php:329
#: src/Module/Profile/Status.php:65 src/Module/Profile/Status.php:68 #: src/Module/Profile/Status.php:65 src/Module/Profile/Status.php:68
#: src/Protocol/Feed.php:985 src/Protocol/OStatus.php:1242 #: src/Protocol/Feed.php:990 src/Protocol/OStatus.php:1242
#, php-format #, php-format
msgid "%s's timeline" msgid "%s's timeline"
msgstr "" msgstr ""
#: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:66 #: src/Module/Profile/Profile.php:327 src/Module/Profile/Status.php:66
#: src/Protocol/Feed.php:989 src/Protocol/OStatus.php:1246 #: src/Protocol/Feed.php:994 src/Protocol/OStatus.php:1246
#, php-format #, php-format
msgid "%s's posts" msgid "%s's posts"
msgstr "" msgstr ""
#: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:67 #: src/Module/Profile/Profile.php:328 src/Module/Profile/Status.php:67
#: src/Protocol/Feed.php:992 src/Protocol/OStatus.php:1249 #: src/Protocol/Feed.php:997 src/Protocol/OStatus.php:1249
#, php-format #, php-format
msgid "%s's comments" msgid "%s's comments"
msgstr "" msgstr ""

View file

@ -10,7 +10,7 @@
<ul> <ul>
{{foreach $counts as $c}} {{foreach $counts as $c}}
{{if $c[0]['total'] > 0}} {{if $c[0]['total'] > 0}}
<li>{{$c[0]['platform']}} ({{$c[0]['total']}}/{{$c[0]['users']}})</li> <li>{{$c[0]['platform']}} ({{$c[0]['total']}} &bull; {{$c[0]['month']}} &bull; {{$c[0]['halfyear']}} &bull; {{$c[0]['users']}})</li>
{{/if}} {{/if}}
{{/foreach}} {{/foreach}}
</ul> </ul>