Commit 3cca47aa authored by David Morley's avatar David Morley

Merge branch 'cleanup' into 'develop'

Cleanup for release

See merge request !215
parents 8f8aeb32 4ceb8da2
# Changelog
The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning].
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
## [2.4.1] - 2018-10-18
:exclamation: DB migrations required! (see [SQL migration script][2.4.1-sql-migration])
### Changed
- Pod wizard switch from language to users (#195)
- Files renamed to change wording from pull to update to be more clear (#190)
- Use SVG for icons
### Removed
- userurl remove from table in DB, was unused
### Fixed
- Users chart fix (#194)
- Dev branch detection (#185) (#193)
- User deletion fixed (#198)
- Jump to domain fixed (#192)
- Updated yarn and composer packages - update both on git pull
## [2.4.0] - 2018-09-03
:exclamation: DB migrations required! (see [SQL migration script][2.4.0-sql-migration])
:exclimation: config.php rewritten - requires migration
:exclamation: `config.php` rewritten - requires migration
### Added
- Added bootstrapping to simplify initialisation of config and database
- Config syntax has changed to array style (#155)
......@@ -28,12 +51,10 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
- Backup script rewrite
- Store services as json array
- Paging can be changed to some or all on advanced view
### Deprecated
### Removed
### Fixed
- Notify podmins just once at 50 when pod failing (#186)
- Add missing meta and PHP module requirements to `composer.json`
### Security
## [2.3.1] - 2018-08-05
### Added
......@@ -89,11 +110,14 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
### Fixed
- Fix ipv6
[2.4.1-sql-migration]: https://git.feneas.org/diasporg/Poduptime/blob/master/db/migrations/2.4.0-2.4.1.sql
[2.4.0-sql-migration]: https://git.feneas.org/diasporg/Poduptime/blob/master/db/migrations/2.3.0-2.4.0.sql
[2.3.0-sql-migration]: https://git.feneas.org/diasporg/Poduptime/blob/master/db/migrations/2.2.0-2.3.0.sql
[2.2.0-sql-migration]: https://git.feneas.org/diasporg/Poduptime/blob/master/db/migrations/2.1.4-2.2.0.sql
[Unreleased]: https://git.feneas.org/diasporg/Poduptime/compare/master...develop
[2.4.1]: https://git.feneas.org/diasporg/Poduptime/compare/2.4.0...2.4.1
[2.4.0]: https://git.feneas.org/diasporg/Poduptime/compare/2.3.1...2.4.0
[2.3.1]: https://git.feneas.org/diasporg/Poduptime/compare/2.3.0...2.3.1
[2.3.0]: https://git.feneas.org/diasporg/Poduptime/compare/v2.2.0...2.3.0
[2.2.0]: https://git.feneas.org/diasporg/Poduptime/compare/2.1.3...v2.2.0
......
......@@ -22,9 +22,9 @@
"geoip2/geoip2": "^2.9",
"maxmind-db/reader": "^1.3",
"matriphe/iso-639": "^1.2",
"rinvex/country": "^3.1",
"detectlanguage/detectlanguage": "^2.2",
"longman/ip-tools": "^1.2"
"longman/ip-tools": "^1.2",
"rinvex/countries": "^5.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.3"
......
This diff is collapsed.
ALTER TABLE ratingcomments DROP COLUMN userurl;
UPDATE pods SET date_updated=null;
......@@ -3,14 +3,14 @@
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"
FLAG_FILE="/tmp/poduptime.pulling"
FLAG_FILE="/tmp/poduptime.updating"
HOUR=$(date +%H)
DAY=$(date +%d)
HAPPY=" :-)"
SAD=" :-("
if [ -f "$FLAG_FILE" ]; then
echo "Already running pull"
echo "Already running update"
exit 1
fi
touch "$FLAG_FILE"
......@@ -26,20 +26,20 @@ fi
echo "$HAPPY"
if [ "$HOUR" = 23 ] || [ "$1" = 'init' ]; then
printf "%s" "Pulling in master versions..."
if php pull-masterversions.php; then
printf "%s" "Updating master versions..."
if php update-masterversions.php; then
echo "$HAPPY"
else
echo "$SAD"
fi
printf "%s" "Updating Monthy Stats Table..."
if php monthly_stats.php; then
if php update-monthly-stats.php; then
echo "$HAPPY"
else
echo "$SAD"
fi
printf "%s" "Crawling the federation..."
if php podcrawler.php; then
printf "%s" "Crawling and updating from the federation..."
if php update-remote-data.php; then
echo "$HAPPY"
else
echo "$SAD"
......@@ -62,10 +62,10 @@ if [ "$HOUR" = 23 ] || [ "$1" = 'init' ]; then
fi
fi
echo "Pulling in new pod data...";
php pull.php $@
echo "Updating in new pod data...";
php update.php $@
touch last.data
echo "Finished pull!"
echo "Finished update!"
echo "Backing up..."
php backup.php
......
......@@ -10,7 +10,6 @@ use RedBeanPHP\R;
// Required parameters.
($_username = $_POST['username'] ?? null) || die('Name is required');
//($_userurl = $_POST['userurl'] ?? null) || die('no userurl given');//lets not annoy people on this for now
($_domain = $_POST['domain'] ?? null) || die('no pod domain given');
($_comment = $_POST['comment'] ?? null) || die('A comment is required');
($_rating = $_POST['rating'] ?? null) || die('A rating is required');
......@@ -23,7 +22,6 @@ try {
$r['comment'] = $_comment;
$r['rating'] = $_rating;
$r['username'] = $_username;
//$r['userurl'] = $_userurl;
R::store($r);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
......
......@@ -54,7 +54,6 @@ CREATE TABLE ratingcomments (
pod_id int,
rating int,
username text,
userurl text,
date_created timestamp DEFAULT current_timestamp
);
......
......@@ -193,18 +193,18 @@ foreach ($pods as $pod) {
try {
$lastpodupdates = R::getRow('
SELECT DISTINCT ON (shortversion, date_checked) shortversion, date_checked
SELECT DISTINCT ON (version, date_checked) version, date_checked
FROM checks
WHERE domain = ?
AND shortversion IS NOT NULL
ORDER BY shortversion DESC, date_checked
AND version IS NOT NULL
ORDER BY version DESC, date_checked
LIMIT 1
', [$domain]);
} catch (\RedBeanPHP\RedException $e) {
die('Error in SQL query: ' . $e->getMessage());
}
$lastdatechecked = ($lastpodupdates['date_checked'] ?? date('Y-m-d H:i:s'));
$lastdatechecked = ($lastpodupdates['date_checked'] ?? date('Y-m-d H:i:s.u'));
$devlastdays = $devlastcommit ? date_diff(new DateTime($devlastcommit), new DateTime())->format('%a') : 30;//tmp//if no dev branch then what?
debug('Dev last commit was ', $devlastdays);
......@@ -214,9 +214,9 @@ foreach ($pods as $pod) {
if (strpos($version, 'dev') !== false || strpos($version, 'rc') !== false || $shortversioncheck > $masterversioncheck) {
//tmp//if pod is on the development branch - see when you last updated your pod and when the last commit was made to dev branch - if the repo is active and your not updating every 120 days why are you on dev branch?
if ($updategap + $devlastdays > 400) {
if ($updategap + $devlastdays > 200) {
debug('Outdated More than 400 days', 'Yes');
debug('Outdated More than 200 days', 'Yes');
$podminhelp = 'Your code base seems too out of date to be used. Last time you updated was ' . $updategap;
$score -= 2;
......@@ -230,9 +230,9 @@ foreach ($pods as $pod) {
$updategap = date_diff(new DateTime($lastdatechecked), new DateTime($releasedate))->format('%a');
$podminhelp = 'Your code base seems too out of date to be used. Current version is ' . $masterversion . ' and you are running ' . $shortversion;
} elseif ($updategap - date_diff(new DateTime($releasedate), new DateTime())->format('%a') > 400) {
} elseif ($updategap - date_diff(new DateTime($releasedate), new DateTime())->format('%a') > 200) {
debug('Outdated more than 400 days since x ', 'Yes');
debug('Outdated more than 200 days since x ', 'Yes');
$score -= 2;
$updategap = date_diff(new DateTime($lastdatechecked), new DateTime($releasedate))->format('%a');
......@@ -361,12 +361,15 @@ foreach ($pods as $pod) {
debug('Mail Notice', 'sent to ' . $email);
}
$weightedscore = ($uptime + $score - (10 - $weight)) / 2;
if ($score > 100) {
$score = 100;
} elseif ($score < 1) {
$weightedscore = 0;
} elseif ($score < -6000) {
$status = PodStatus::SYSTEM_DELETED;
}
$weightedscore = ($uptime + $score - (10 - $weight)) / 2;
debug('Score', $score);
debug('Weighted Score', $weightedscore);
......@@ -379,8 +382,8 @@ foreach ($pods as $pod) {
$p['monthsmonitored'] = $months;
$p['uptime_alltime'] = $uptime;
$p['status'] = $status;
$p['date_laststats'] = $statslastdate;
$p['date_updated'] = date('Y-m-d H:i:s');
$p['date_laststats'] = date('Y-m-d H:i:s.u');
$p['date_updated'] = $lastpodupdates['date_checked'];
$p['latency'] = $avglatency;
$p['score'] = $score;
$p['country'] = $country;
......@@ -403,7 +406,7 @@ foreach ($pods as $pod) {
$p['active_users_monthly'] = $active_users_monthly;
$p['local_posts'] = $local_posts;
$p['name'] = $name;
$p['detectedlanguage'] = $detectedlanguage;
$p['detectedlanguage'] = $detectedlanguage;
$p['comment_counts'] = $comment_counts;
$p['service_xmpp'] = $service_xmpp;
$p['services'] = $services;
......
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 511.984 511.984" style="enable-background:new 0 0 511.984 511.984;" xml:space="preserve">
<g>
<g>
<path d="M510.992,358.154l-0.544-4.512c-0.928-8.096-7.776-13.952-16.096-14.112l-52.544,0.832
c-4.192,0.064-9.696,3.264-12.672,6.304c-17.504,17.952-24.384,13.408-26.56,11.936c-5.76-3.808-16.992-15.872-29.28-54.144
l78.4-223.072c3.968-9.728,5.28-17.632,4.096-24.864c-2.08-12.96-11.456-21.76-27.936-23.712l-68.48,0.416
c-6.752,0.032-12.736,4.32-14.976,10.656l-32.288,92.352c-9.344-17.472-18.976-32.512-29.12-45.536
c-21.728-27.84-46.144-46.24-72.512-54.72c-0.288-0.064-2.912-0.704-3.2-0.8c-53.76-8.384-98.272,0.928-132.064,27.904
C38.256,92.618,14.448,141.706,2.16,214.954c-4.608,57.088-1.856,103.008,8.384,140.448c11.744,42.912,33.76,74.208,65.056,92.896
c45.76,29.088,90.944,37.408,134.272,24.8c31.712-9.216,61.696-29.12,91.264-60.544c12.448,18.688,26.496,33.6,41.824,44.48
c21.216,15.04,45.312,22.752,73.6,22.752c4.768,0,9.664-0.224,14.688-0.64c0.608-0.16,2.688-0.736,3.296-0.992
c27.712-11.136,48.416-26.976,61.44-47.104C509.264,410.474,514.32,385.93,510.992,358.154z M469.104,413.674
c-9.152,14.112-24.32,25.632-45.12,34.208c-23.52,1.504-44.192-3.968-62.528-16.96c-16.288-11.52-31.04-29.344-43.776-52.896
c-2.528-4.672-7.2-7.776-12.48-8.288c-0.544-0.064-1.056-0.096-1.6-0.096c-4.704,0-9.248,2.08-12.288,5.728
c-29.696,35.648-60.128,58.208-90.368,66.976c-34.592,10.048-69.984,3.168-108.576-21.312
c-24.672-14.72-41.344-38.944-50.976-74.08c-9.12-33.344-11.584-76.864-7.456-128.448c10.56-62.464,31.168-106.368,61.248-130.432
c26.848-21.408,61.92-28.352,105.504-21.632c20.448,6.56,39.104,20.96,57.056,43.936c14.784,18.944,28.544,43.136,42.112,73.952
c2.656,6.016,8.736,9.632,15.296,9.504c6.56-0.224,12.32-4.48,14.464-10.688l41.28-118.048l52.736-0.352
c-0.352,1.248-0.96,2.976-1.856,5.248L341.36,298.826c-1.12,3.232-1.216,6.72-0.224,9.984c12.224,40.064,26.56,65.12,43.84,76.512
c13.408,8.864,35.008,13.504,63.68-13.056l31.296-0.544C480.432,387.914,476.816,401.706,469.104,413.674z"/>
</g>
</g>
<g>
<g>
<path d="M295.76,274.282c-15.36-61.536-31.968-102.208-52.416-127.936c-21.728-27.36-48.64-40.192-84.704-40.288
c-0.128,0-0.224,0-0.288,0c-28.032,0.32-53.088,18.08-70.528,49.984C76.4,176.874,68.496,202.89,65.04,231.306
c-3.488,28.32-2.24,56.64,3.616,81.824c10.816,46.56,36.48,78.048,72.224,88.672c0.8,0.224,2.368,0.576,3.2,0.672
c5.984,0.8,11.808,1.216,17.568,1.216c24.416,0,46.72-7.2,66.528-21.536c26.112-18.944,47.904-49.92,66.624-94.72
c0.64-1.6,1.28-6.4,1.408-8.128C296.336,277.61,296.176,275.946,295.76,274.282z M209.424,356.17
c-17.824,12.96-37.792,17.728-59.392,14.944c-31.104-9.216-44.448-40.576-50.208-65.248c-4.928-21.248-6.016-46.368-3.04-70.688
c2.944-24.064,9.728-46.688,19.104-63.776c8.224-15.04,22.336-33.024,42.784-33.344c26.208,0.096,44.032,8.544,59.616,28.192
c17.344,21.824,32,58.176,45.44,112.448C247.952,315.466,229.68,341.514,209.424,356.17z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="400" height="400" id="svg3668" version="1.1" inkscape:version="0.48.3.1 r9886" inkscape:export-filename="/home/mray/Desktop/pump.io.png" inkscape:export-xdpi="720" inkscape:export-ydpi="720" sodipodi:docname="pump.io-logo.svg">
<title id="title2989">pump.io logo</title>
<defs id="defs3670"/>
<sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="0.27058824" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:zoom="1.6239393" inkscape:cx="103.00555" inkscape:cy="162.48159" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:showpageshadow="false" showguides="true" inkscape:guide-bbox="true" showborder="true" inkscape:snap-bbox="true" inkscape:snap-global="true" inkscape:snap-bbox-edge-midpoints="true" inkscape:bbox-nodes="true" inkscape:bbox-paths="true" inkscape:window-width="1676" inkscape:window-height="1011" inkscape:window-x="0" inkscape:window-y="37" inkscape:window-maximized="0">
<inkscape:grid type="xygrid" id="grid3694" empspacing="5" dotted="true" visible="true" enabled="true" snapvisiblegridlinesonly="true"/>
</sodipodi:namedview>
<metadata id="metadata3673">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title>pump.io logo</dc:title>
<dc:creator>
<cc:Agent>
<dc:title>Robert Martinez</dc:title>
</cc:Agent>
</dc:creator>
<dc:source/>
<cc:license rdf:resource="http://pump.io"/>
</cc:Work>
</rdf:RDF>
</metadata>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(0,-652.3622)">
<g id="g40398" transform="matrix(25.871959,0,0,25.871959,-6.0153603,-26167.148)">
<path style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" d="m 5.8906243,1037.6993 -1.2723214,1.0044 6.7968751,5.692 -6.7968751,5.692 1.3058036,0.904 7.6674105,-6.6295 -7.7008927,-6.6629 z" id="path4694" inkscape:connector-curvature="0"/>
<path id="path4696" d="m 7.9999998,1036.8622 c -4.1421354,0 -7.5000002,3.3579 -7.5000002,7.5 0,4.1421 3.3578648,7.5 7.5000002,7.5 4.1421352,0 7.5000002,-3.3579 7.5000002,-7.5 0,-4.1421 -3.357865,-7.5 -7.5000002,-7.5 z m 0,1.4398 c 3.3449672,0 6.0602682,2.7152 6.0602682,6.0602 0,3.345 -2.715301,6.0603 -6.0602682,6.0603 -3.3449679,0 -6.060268,-2.7153 -6.060268,-6.0603 0,-3.345 2.7153001,-6.0602 6.060268,-6.0602 z" style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" inkscape:connector-curvature="0"/>
<path transform="translate(0,1036.3622)" inkscape:connector-curvature="0" id="path40343" d="M 4.8595235,13.159952 C 4.1367871,12.722794 3.428041,12.03704 2.9500471,11.31242 2.1461441,10.093734 1.8086343,8.5782403 2.0190821,7.1321812 2.2742718,5.3786856 3.3055996,3.8059968 4.8181536,2.863831 4.9989668,2.751203 5.0399467,2.7355243 5.0830902,2.7624678 c 0.055264,0.034513 6.2656908,5.2322785 6.2854928,5.2605907 0.0098,0.013948 -6.1520446,5.1951335 -6.2514517,5.2565705 -0.016254,0.01005 -0.1321777,-0.04381 -0.2576078,-0.119677 z" style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.16328508;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"/>
<path transform="translate(0,1036.3622)" inkscape:connector-curvature="0" id="path40345" d="M 7.2032088,13.992835 C 7.0610147,13.973368 6.9072144,13.947075 6.8614304,13.934407 6.7798017,13.911821 6.844378,13.854163 10.189718,10.962698 12.06606,9.3409261 13.597578,8.0043232 13.593091,7.992469 13.588605,7.980615 12.060259,6.6520953 10.196768,5.0402033 8.3332776,3.4283113 6.8052427,2.1004295 6.8011353,2.089355 6.7853955,2.0469169 7.5959886,1.9518986 7.9788129,1.9513069 c 1.380889,-0.00213 2.8165831,0.5150586 3.8644131,1.3921128 1.213826,1.0159959 1.974439,2.4113727 2.162829,3.9678019 0.04691,0.3875133 0.03443,1.1385585 -0.02571,1.5473011 -0.198724,1.3507443 -0.849067,2.6049023 -1.829468,3.5280473 -0.918366,0.864734 -2.04659,1.410379 -3.2964476,1.594265 -0.4238166,0.06235 -1.2400821,0.06829 -1.6512216,0.012 z" style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.16328508;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"/>
</g>
</g>
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="xmpp.svg"
xml:space="preserve"
style="enable-background:new 0 0 512.007 512.007;;opacity:1"
viewBox="0 0 512.007 512.007"
y="0px"
x="0px"
id="Capa_1"
version="1.1"
inkscape:version="0.92.3 (2405546, 2018-03-11)"><sodipodi:namedview
inkscape:current-layer="Capa_1"
inkscape:window-maximized="1"
inkscape:window-y="0"
inkscape:window-x="0"
inkscape:cy="256.00351"
inkscape:cx="256.00351"
inkscape:zoom="1.6386494"
showgrid="false"
id="namedview3904"
inkscape:window-height="1026"
inkscape:window-width="1920"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff" /><metadata
id="metadata3908"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
id="defs3906" />
<path
id="path3859"
d="m 338.00678,116.83702 140.4221,-55.427388 c 0,0 1.95973,137.297878 -122.37587,252.606428 C 233.11439,428.02954 142.88323,427.39938 142.88323,427.39938 v -12.5985 c 0,0 28.14183,-3.28189 61.4686,-25.19699 55.54558,-36.52096 135.9102,-145.19938 133.65495,-272.76687 z"
style="opacity:1;fill:#575757;stroke-width:1.49436414"
inkscape:connector-curvature="0" />
<path
id="path3861"
d="m 338.02233,119.12076 c 0.008,-0.76756 0.0269,-1.53197 0.0283,-2.30111 l 69.18594,-27.308593 c 0,0 1.32204,103.750843 -75.99976,212.539833 C 242.13538,427.4136 142.8804,427.40254 142.8804,427.40254 v -12.5985 c 0,0 28.14183,-3.28189 61.46861,-25.19541 55.21612,-36.30775 134.9388,-143.91063 133.67332,-270.48787 z"
style="opacity:1;fill:#a6a6a6;stroke-width:1.49436414"
inkscape:connector-curvature="0" />
<path
id="path3863"
d="M 172.77411,116.83702 32.3506,61.409632 c 0,0 -1.959733,137.297878 122.37587,252.606428 122.93862,114.01348 213.16977,113.38332 213.16977,113.38332 v -12.5985 c 0,0 -28.14182,-3.28189 -61.4686,-25.19699 C 250.88207,353.08293 170.51886,244.40451 172.77411,116.83702 Z"
style="opacity:1;fill:#575757;stroke-width:1.49436414"
inkscape:connector-curvature="0" />
<path
d="m 172.75714,119.12076 c -0.008,-0.76756 -0.0269,-1.53197 -0.0283,-2.30111 L 103.5429,89.511057 c 0,0 -1.32204,103.750843 75.99976,212.539833 89.10144,125.36271 188.35641,125.35165 188.35641,125.35165 v -12.5985 c 0,0 -28.14182,-3.28189 -61.4686,-25.19541 C 251.21435,353.30088 171.49166,245.698 172.75714,119.12076 Z"
style="opacity:1;fill:#a0a0a0;stroke-width:1.49436414"
id="SVGCleanerId_0"
inkscape:connector-curvature="0" />
<g
id="g3867"
transform="matrix(1.413949,0,0,1.5793528,-106.5812,-159.90982)">
<path
d="m 197.559,176.674 c -0.006,-0.486 -0.019,-0.97 -0.02,-1.457 l -48.931,-17.291 c 0,0 -0.935,65.692 53.75,134.574 63.016,79.376 133.213,79.369 133.213,79.369 v -7.977 c 0,0 -19.903,-2.078 -43.473,-15.953 -39.051,-22.989 -95.434,-91.12 -94.539,-171.265 z"
style="opacity:1;fill:#a0a0a0"
id="SVGCleanerId_0_1_"
inkscape:connector-curvature="0" />
</g>
<path
id="path3869"
d="M 244.20681,358.11001 C 131.67768,253.74954 116.07334,94.456011 116.07334,94.456011 L 97.437504,87.100965 c 0,0 4.783386,106.159355 82.103766,214.948345 89.10141,125.36271 188.35639,125.35165 188.35639,125.35165 v -0.21163 -12.38687 c -26.31783,-1.68043 -84.92743,-20.74322 -123.69085,-56.69245 z"
style="opacity:1;fill:#7a7a7a;stroke-width:1.49436414"
inkscape:connector-curvature="0" />
<path
id="path3871"
d="M 266.57266,358.11001 C 379.10179,253.74954 394.70613,94.456011 394.70613,94.456011 l 18.63585,-7.355046 c 0,0 -4.78339,106.159355 -82.10378,214.948345 -89.10141,125.36271 -188.35638,125.35165 -188.35638,125.35165 v -0.21163 -12.38687 c 26.31924,-1.68043 84.92743,-20.74322 123.69084,-56.69245 z"
style="opacity:1;fill:#888888;stroke-width:1.49436414"
inkscape:connector-curvature="0" />
<g
id="g3873">
</g>
<g
id="g3875">
</g>
<g
id="g3877">
</g>
<g
id="g3879">
</g>
<g
id="g3881">
</g>
<g
id="g3883">
</g>
<g
id="g3885">
</g>
<g
id="g3887">
</g>
<g
id="g3889">
</g>
<g
id="g3891">
</g>
<g
id="g3893">
</g>
<g
id="g3895">
</g>
<g
id="g3897">
</g>
<g
id="g3899">
</g>
<g
id="g3901">
</g>
</svg>
\ No newline at end of file
......@@ -57,10 +57,11 @@ $(document).ready(function () {
$('table').trigger('update', [true]);
var columns = [];
var input = $('input:input[name="input"]').val();
columns[7] = 'Yes';
if (input) {
columns[0] = input;
columns[7] = '';
}
columns[7] = 'Yes';
$('table').trigger('search', [columns]);
$('.pagerhidden').delay(900).show(200);
$('[data-toggle="tooltip"]').tooltip();
......
......@@ -198,3 +198,15 @@ function detectWebsiteLanguageFromUrl(string $url): ?string
getWebsiteLanguageSnippetFromUrl($url)
);
}
/**
* Send to browser debug console
*
* @param string|array $data
*/
function debugToConsole($data): void
{
$output = implode(',', (array) $data);
echo "<script>console.log('Debug Objects: {$output}');</script>";
}
......@@ -13,6 +13,7 @@
"leaflet": "^1.3.3",
"leaflet.markercluster": "^1.3.0",
"popper.js": "^1.14.3",
"simple-icons": "^1.9.2",
"tablesorter": "^2.30.7",
"typeface-roboto": "^0.0.54"
},
......
......@@ -17,7 +17,7 @@
<tr>
<td>
<div class="col text-center">Average Network User Growth<br>
<canvas id="user_growth" style="height:300px; width:500px"></canvas>
<canvas id="user_growth" style="height:300px; width:900px"></canvas>
</div>
</td>
</tr>
......
......@@ -57,13 +57,14 @@ foreach ($pods as $pod) {
$classver = 'text-danger';
}
echo '<td>' . $pod['name'] . '</td>';
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ?: 'unknown') . '" data-toggle="tooltip">' . $version . '</div></td>';
$lastupdated = ($pod['date_updated'] ? Carbon::createFromFormat('Y-m-d H:i:s.u', $pod['date_updated'])->diffForHumans() : 'unknown');
echo '<td class="' . $classver . '"><div title="' . $pre . ' version: ' . $pod['shortversion'] . ' master version is: ' . ($pod['masterversion'] ?: 'unknown') . ' pod code was last updated: ' . $lastupdated . '" data-toggle="tooltip">' . $version . '</div></td>';
echo '<td>' . $pod['softwarename'] . '</td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td><a href="#" class="green" data-featherlight-variant="table-responsive" data-featherlight="podstat-uptime.php?domain=' . $pod['domain'] . '">' . ($pod['uptime_alltime'] > 0 ? $pod['uptime_alltime'] . '%' : '') . '</a></td>';
echo '<td>' . ($pod['ipv6'] ? 'Yes' : 'No') . '</td>';
echo '<td>' . ($pod['latency'] > 0 ? $pod['latency'] : '') . '</td>';
echo '<td>' . ($pod['signup'] ? 'Yes' : 'No') . '</td>';
echo '<td><a href="#" data-featherlight-variant="table-responsive" data-featherlight="podstat-counts.php?domain=' . $pod['domain'] . '">' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . '</a></td>';
echo '<td><a href="#" class="green" data-featherlight-variant="table-responsive" data-featherlight="podstat-counts.php?domain=' . $pod['domain'] . '">' . ($pod['total_users'] > 0 ? $pod['total_users'] : '') . '</a></td>';
echo '<td>' . ($pod['active_users_halfyear'] > 0 ? $pod['active_users_halfyear'] : '') . '</td>';
echo '<td>' . ($pod['active_users_monthly'] > 0 ? $pod['active_users_monthly'] : '') . '</td>';
echo '<td>' . ($pod['local_posts'] > 0 ? $pod['local_posts'] : '') . '</td>';
......@@ -88,33 +89,36 @@ foreach ($pods as $pod) {
($pod['service_xmpp'] ?? false) && $services[] = 'xmpp';
$services_list = [
'facebook' => ['fa' => 'fab fa-facebook-f', 'title' => 'Publish to Facebook'],
'twitter' => ['fa' => 'fab fa-twitter', 'title' => 'Publish to Twitter'],
'tumblr' => ['fa' => 'fab fa-tumblr', 'title' => 'Publish to Tumblr'],
'wordpress' => ['fa' => 'fab fa-wordpress-simple', 'title' => 'Publish to WordPress'],
'xmpp' => ['fa' => 'fas fa-comments', 'title' => 'XMPP chat server'],
'appnet' => ['fa' => 'fas fa-th', 'title' => 'Publish to App.net'],
'atom1.0' => ['fa' => 'fas fa-rss', 'title' => 'Publish to Atom'],
'blogger' => ['fa' => 'fab fa-blogger-b', 'title' => 'Publish to Blogger'],
'gnusocial' => ['fa' => 'fab fa-grunt', 'title' => 'Publish to GNUSocial'],
'google' => ['fa' => 'fab fa-google', 'title' => 'Publish to Google+'],
'libertree' => ['fa' => 'fas fa-tree', 'title' => 'Publish to Libertree'],
'linkedin' => ['fa' => 'fab fa-linkedin-in', 'title' => 'Publish to LinkedIn'],
'livejournal' => ['fa' => 'fas fa-pencil-alt', 'title' => 'Publish to Live Journal'],
'pinterest' => ['fa' => 'fab fa-pinterest-p', 'title' => 'Publish to Pinterest'],
'pumpio' => ['fa' => 'fas fa-greater-than', 'title' => 'Publish to Pump.io'],
'facebook' => ['img' => 'node_modules/simple-icons/icons/facebook.svg', 'title' => 'Publish to Facebook'],
'twitter' => ['img' => 'node_modules/simple-icons/icons/twitter.svg', 'title' => 'Publish to Twitter'],
'tumblr' => ['img' => 'node_modules/simple-icons/icons/tumblr.svg', 'title' => 'Publish to Tumblr'],
'wordpress' => ['img' => 'node_modules/simple-icons/icons/wordpress.svg', 'title' => 'Publish to WordPress'],
'xmpp' => ['img' => 'images/xmpp.svg', 'title' => 'XMPP chat server'],
'appnet' => ['img' => 'images/app-net.svg', 'title' => 'Publish to App.net'],
'atom1.0' => ['img' => 'node_modules/simple-icons/icons/atom.svg', 'title' => 'Publish to Atom'],
'rss2.0' => ['img' => 'node_modules/simple-icons/icons/atom.svg', 'title' => 'Publish to RSS'],
'blogger' => ['img' => 'node_modules/simple-icons/icons/blogger.svg', 'title' => 'Publish to Blogger'],
'gnusocial' => ['img' => 'node_modules/simple-icons/icons/gnusocial.svg', 'title' => 'Publish to GNUSocial'],
'google' => ['img' => 'node_modules/simple-icons/icons/google.svg', 'title' => 'Publish to Google+'],
'libertree' => ['img' => 'images/libertree.svg', 'title' => 'Publish to Libertree'],
'medium' => ['img' => 'node_modules/simple-icons/icons/medium.svg', 'title' => 'Publish to Medium'],
'linkedin' => ['img' => 'node_modules/simple-icons/icons/linkedin.svg', 'title' => 'Publish to LinkedIn'],
'livejournal' => ['img' => 'node_modules/simple-icons/icons/livejournal.svg', 'title' => 'Publish to Live Journal'],
'pinterest' => ['img' => 'node_modules/simple-icons/icons/pinterest.svg', 'title' => 'Publish to Pinterest'],
'pumpio' => ['img' => 'images/pumpio.svg', 'title' => 'Publish to Pump.io'],
];
echo '<td class="text-truncate">';
foreach ($services as $service) {
// Make sure we have this service in the list.
if (!isset($services_list[$service])) {
debugToConsole($service);
continue;
}
printf(
'<div class="smlogo mr-sm-1"><i class="%1$s" data-toggle="tooltip" title="%2$s"></i><div class="hidden">%3$s</div></div>',
$services_list[$service]['fa'],
'<div class="smlogo mr-sm-1"><img src="%1$s" data-toggle="tooltip" title="%2$s" height="16" width="16"/><div class="hidden">%3$s</div></div>',
$services_list[$service]['img'],
$services_list[$service]['title'],
$service
);
......
......@@ -14,7 +14,7 @@ require_once __DIR__ . '/boot.php';
$page = (int) ($_GET['page'] ?? 1);
$softwarename = $_GET['softwarename'] ?? null;
$country = $_GET['country'] ?? null;
$language = $_GET['language'] ?? null;
$users = $_GET['users'] ?? null;
$iso = new Matriphe\ISO639\ISO639;
......@@ -42,13 +42,13 @@ $iso = new Matriphe\ISO639\ISO639;
}
});
$('.wizardnext4').on('click', function () {
var language = $('input:radio[name="language"]:checked').val();
if (language) {
$.get('wizard.php?page=4&softwarename=<?php echo $softwarename; ?>&country=<?php echo $country; ?>&language=' + language, function (html) {
var users = $('input:text[name="users"]').val();
if (users) {
$.get('wizard.php?page=4&softwarename=<?php echo $softwarename; ?>&country=<?php echo $country; ?>&users=' + users, function (html) {
$('.wizard').replaceWith(html);
});
} else {
$('.wizardnext4').text('Select Language, then. Next..');
$('.wizardnext4').text('Select Users, then. Next..');
}
});
$('.suggestpod').on('click', function () {
......@@ -63,9 +63,14 @@ $iso = new Matriphe\ISO639\ISO639;
columns[13] = '>= 0';
}
columns[18] = '<?php echo $country; ?>';
columns[21] = '<?php echo $language; ?>';
var users = '<?php echo $users; ?>';
if (users) {
columns[8] = '>= ' + users;
} else {
columns[8] = '>= 0';
}
$('table')
.trigger('refreshColumnSelector', ['columns', [3, 4, 13, 18, 21, 22, 28]])
.trigger('refreshColumnSelector', ['columns', [3, 4, 13, 18, 8, 22, 28]])
.trigger('search', [columns])
.trigger('update', [true]);
});
......@@ -122,23 +127,21 @@ EOF;
}
echo '</div></div><button type="button" class="wizardnext3 btn bg-grey">Next</button>';
} elseif ($page === 3) {
$languages = data('detectedlanguage', $softwarename, $country);
// Sort language names correctly.
uasort($languages, function ($l1, $l2) use ($iso) {
return $iso->languageByCode1($l1) <=> $iso->languageByCode1($l2);
});
$users = data('total_users', $softwarename, $country);
$umin = min($users);
$umax = max($users);
echo '<div class="row m-1 p-1"><div class="col-9">Languages we found:</div><div class="col-8 p-3">';
foreach ($languages as $language) {
printf(
'<label><input class="ml-2" type="radio" name="language" value="%1$s" /> %2$s</label><br>',
strtoupper($language),
$iso->languageByCode1($language)
);
echo '<div class="row m-1 p-1"><div class="col-9">Users we found:</div><div class="col-8 p-3">';
if ($umin === $umax) {
echo '<div class="row m-1 p-1"><div class="col-9"></div><div class="col-8">';
printf('<input type="text" name="users" value="%d" hidden>', $umin);
} else {
echo '<div class="row m-1 p-1"><div class="col-9">Users Minimum:</div><div class="col-8">';
printf('<input type="text" name="users" id="month" data-min="%d" data-max="%d" data-step="1">', $umin, $umax);
}
echo '</div></div><button type="button" class="wizardnext4 btn bg-grey">Next</button>';
} elseif ($page === 4) {
$months = data('monthsmonitored', $softwarename, $country, strtolower($language));
$months = data('monthsmonitored', $softwarename, $country, $users);
$min = min($months);
$max = max($months);
if ($min === $max) {
......@@ -152,7 +155,7 @@ EOF;
}
function data($column, $software = null, $country = null, $language = null)
function data($column, $software = null, $country = null, $users = null)
{
try {
$sql = "
......@@ -168,9 +171,9 @@ function data($column, $software = null, $country = null, $language = null)
$sql .= ' AND country = ?';
$params[] = $country;
}
if ($language) {
$sql .= ' AND detectedlanguage = ?';
$params[] = $language;
if ($users) {
$sql .= ' AND total_users >= ?';
$params[] = $users;
}
$data = R::getAll($sql, $params);
} catch (\RedBeanPHP\RedException $e) {
......
......@@ -3,16 +3,19 @@
"@fortawesome/fontawesome-free@^5.2.0":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.3.1.tgz#5466b8f31c1f493a96754c1426c25796d0633dd9"
version "5.4.1"
resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-5.4.1.tgz#6194786c1a705ab84253e06429834466670e3c3f"
integrity sha512-ZcxfUmLFl4RLG71cPeZcTXRa6rt3xLnMmomAb7aYKRzUmlRRj7E8EVqSwYSXBiV2x6XpSQmGOQmNQx6HSeSwVQ==
bootstrap@^4.1.3: