Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Poduptime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diasporg
Poduptime
Commits
2dcc68fa
Commit
2dcc68fa
authored
Aug 14, 2018
by
dmorley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use array to support all the other services
parent
79d78010
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
25 deletions
+22
-25
db/migrations/2.3.0-2.4.0.sql
db/migrations/2.3.0-2.4.0.sql
+2
-0
db/pull.php
db/pull.php
+2
-12
db/tables.sql
db/tables.sql
+1
-4
tabledata.php
tabledata.php
+17
-9
No files found.
db/migrations/2.3.0-2.4.0.sql
0 → 100644
View file @
2dcc68fa
ALTER
TABLE
pods
ADD
services
text
;
ALTER
TABLE
pods
DROP
COLUMN
service_facebook
,
DROP
COLUMN
service_wordpress
,
DROP
COLUMN
service_tumblr
,
DROP
COLUMN
service_twitter
;
\ No newline at end of file
db/pull.php
View file @
2dcc68fa
...
...
@@ -137,17 +137,10 @@ foreach ($pods as $pod) {
$local_posts
=
$jsonssl
->
usage
->
localPosts
??
0
;
$comment_counts
=
$jsonssl
->
usage
->
localComments
??
0
;
$service_xmpp
=
(
$jsonssl
->
metadata
->
xmppChat
??
false
)
===
true
;
$service_facebook
=
false
;
$service_twitter
=
false
;
$service_tumblr
=
false
;
$service_wordpress
=
false
;
if
(
json_last_error
()
===
0
)
{
(
!
$jsonssl
->
software
->
version
)
||
$score
+=
1
;
if
(
is_array
(
$jsonssl
->
services
->
outbound
))
{
$service_facebook
=
in_array
(
'facebook'
,
$jsonssl
->
services
->
outbound
,
true
);
$service_twitter
=
in_array
(
'twitter'
,
$jsonssl
->
services
->
outbound
,
true
);
$service_tumblr
=
in_array
(
'tumblr'
,
$jsonssl
->
services
->
outbound
,
true
);
$service_wordpress
=
in_array
(
'wordpress'
,
$jsonssl
->
services
->
outbound
,
true
);
$services
=
json_encode
(
$jsonssl
->
services
->
outbound
);
}
}
...
...
@@ -411,11 +404,8 @@ foreach ($pods as $pod) {
$p
[
'local_posts'
]
=
$local_posts
;
$p
[
'name'
]
=
$name
;
$p
[
'comment_counts'
]
=
$comment_counts
;
$p
[
'service_facebook'
]
=
$service_facebook
;
$p
[
'service_tumblr'
]
=
$service_tumblr
;
$p
[
'service_twitter'
]
=
$service_twitter
;
$p
[
'service_wordpress'
]
=
$service_wordpress
;
$p
[
'service_xmpp'
]
=
$service_xmpp
;
$p
[
'services'
]
=
$services
;
$p
[
'softwarename'
]
=
$softwarename
;
}
...
...
db/tables.sql
View file @
2dcc68fa
...
...
@@ -30,11 +30,8 @@ CREATE TABLE pods (
uptime_alltime
numeric
(
5
,
2
),
status
smallint
DEFAULT
1
,
latency
smallint
,
service_facebook
boolean
,
service_twitter
boolean
,
service_tumblr
boolean
,
service_wordpress
boolean
,
service_xmpp
boolean
,
services
text
,
token
text
,
publickey
text
,
tokenexpire
timestamp
,
...
...
tabledata.php
View file @
2dcc68fa
...
...
@@ -16,7 +16,7 @@ $iso = new Matriphe\ISO639\ISO639;
try
{
$pods
=
R
::
getAll
(
'
SELECT domain, dnssec, podmin_statement, sslexpire, masterversion, shortversion, softwarename, daysmonitored, monthsmonitored, score, signup, name, country, countryname, city, state, detectedlanguage, uptime_alltime, active_users_halfyear, active_users_monthly, service
_facebook, service_twitter, service_tumblr, service_wordpres
s, service_xmpp, latency, date_updated, ipv6, total_users, local_posts, comment_counts, userrating, status
SELECT domain, dnssec, podmin_statement, sslexpire, masterversion, shortversion, softwarename, daysmonitored, monthsmonitored, score, signup, name, country, countryname, city, state, detectedlanguage, uptime_alltime, active_users_halfyear, active_users_monthly, services, service_xmpp, latency, date_updated, ipv6, total_users, local_posts, comment_counts, userrating, status
FROM pods
WHERE status < ?
AND score > 0
...
...
@@ -82,16 +82,24 @@ foreach ($pods as $pod) {
echo
'<td>'
.
$pod
[
'state'
]
.
'</td>'
;
echo
'<td data-toggle="tooltip" title="'
.
(
$pod
[
'detectedlanguage'
]
?
$iso
->
languageByCode1
(
$pod
[
'detectedlanguage'
])
:
''
)
.
'">'
.
(
$pod
[
'detectedlanguage'
]
?
strtoupper
(
$pod
[
'detectedlanguage'
])
:
''
)
.
'</td>'
;
echo
'<td class="text-truncate">'
;
$pod
[
'service_facebook'
]
&&
print
'<div class="smlogo smlogo-facebook" data-toggle="tooltip" title="Publish to Facebook"></div>'
;
$pod
[
'service_twitter'
]
&&
print
'<div class="smlogo smlogo-twitter" data-toggle="tooltip" title="Publish to Twitter"></div>'
;
$pod
[
'service_tumblr'
]
&&
print
'<div class="smlogo smlogo-tumblr" data-toggle="tooltip" title="Publish to Tumblr"></div>'
;
$pod
[
'service_wordpress'
]
&&
print
'<div class="smlogo smlogo-wordpress" data-toggle="tooltip" title="Publish to WordPress"></div>'
;
(
$pod
[
'services'
]
?
$services
=
json_decode
(
$pod
[
'services'
])
:
$services
=
''
);
if
(
is_array
(
$services
))
{
$facebook
=
array_search
(
'facebook'
,
$services
,
false
);
$twitter
=
array_search
(
'twitter'
,
$services
,
false
);
$tumblr
=
array_search
(
'tumblr'
,
$services
,
false
);
$wordpress
=
array_search
(
'wordpress'
,
$services
,
false
);
}
$facebook
!==
false
&&
print
'<div class="smlogo smlogo-facebook" data-toggle="tooltip" title="Publish to Facebook"></div>'
;
$twitter
!==
false
&&
print
'<div class="smlogo smlogo-twitter" data-toggle="tooltip" title="Publish to Twitter"></div>'
;
$tumblr
!==
false
&&
print
'<div class="smlogo smlogo-tumblr" data-toggle="tooltip" title="Publish to Tumblr"></div>'
;
$wordpress
!==
false
&&
print
'<div class="smlogo smlogo-wordpress" data-toggle="tooltip" title="Publish to WordPress"></div>'
;
$pod
[
'service_xmpp'
]
&&
print
'<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" data-toggle="tooltip" title="XMPP chat server" alt="XMPP chat server"></div>'
;
echo
'</td>'
;
echo
'<td>'
.
(
$
pod
[
'service_facebook'
]
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
pod
[
'service_twitter'
]
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
pod
[
'service_tumblr'
]
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
pod
[
'service_wordpress'
]
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
facebook
!==
false
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
twitter
!==
false
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
tumblr
!==
false
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$
wordpress
!==
false
?
'Yes'
:
'No'
)
.
'</td>'
;
echo
'<td>'
.
(
$pod
[
'service_xmpp'
]
?
'Yes'
:
'No'
)
.
'</td>'
;
$podmin_statement
=
htmlentities
(
$pod
[
'podmin_statement'
]
??
''
,
ENT_QUOTES
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment