mirror of
https://github.com/khairul169/honey.git
synced 2025-04-28 14:59:32 +07:00
Overview: Nicer privacy report boxes
This commit is contained in:
parent
68b676ed6e
commit
f109160d07
@ -30,25 +30,38 @@ export default class Overview {
|
|||||||
this.div.querySelector(".big").innerText = stats.total
|
this.div.querySelector(".big").innerText = stats.total
|
||||||
this.div.querySelector(".small").innerText = `Available service${s(stats.total)}`
|
this.div.querySelector(".small").innerText = `Available service${s(stats.total)}`
|
||||||
|
|
||||||
let encryption_t
|
let encryption_t, encryption_d
|
||||||
let donot = ""
|
if (stats.secure == stats.total) {
|
||||||
if (stats.secure == stats.total) encryption_t = "All"
|
encryption_t = "Full encryption"
|
||||||
else if (stats.secure == 0) encryption_t = "None of"
|
encryption_d = "All services use secure connections (HTTPS)."
|
||||||
else {
|
|
||||||
encryption_t = stats.total - stats.secure
|
|
||||||
donot = "do not"
|
|
||||||
}
|
}
|
||||||
encryption_t = `${encryption_t} service${s(encryption_t)} ${donot} use secure connections (HTTPS).`
|
else if (stats.secure == 0) {
|
||||||
|
encryption_t = "No encryption"
|
||||||
|
encryption_d = "It seems server does not support HTTPS."
|
||||||
|
|
||||||
let indepencence_t
|
}
|
||||||
if (stats.thirdParties == 0) indepencence_t =
|
else {
|
||||||
"This server is free of 3rd party services."
|
let insecure = stats.total - stats.secure
|
||||||
else if (stats.thirdParties == stats.total) indepencence_t =
|
encryption_t = "Partial encryption"
|
||||||
"It seems only 3rd-party services are listed."
|
encryption_d = `${insecure} service${s(insecure)} do not use secure connections.`
|
||||||
else indepencence_t =
|
|
||||||
`${stats.thirdParties} service${s(stats.thirdParties)} ${isare(stats.thirdParties)} provided by 3rd-parties.`
|
|
||||||
|
|
||||||
privacyBox("lock", "#0D6", "Encryption", encryption_t, stats.secure / stats.total)
|
}
|
||||||
privacyBox("home", "#68F", "Independence", indepencence_t, 1 - stats.thirdParties / stats.total)
|
|
||||||
|
let indepencence_t, indepencence_d
|
||||||
|
if (stats.thirdParties == 0) {
|
||||||
|
indepencence_t = "Independence"
|
||||||
|
indepencence_d = "This server is free of 3rd party services."
|
||||||
|
}
|
||||||
|
else if (stats.thirdParties == stats.total) {
|
||||||
|
indepencence_t = "Something is wrong..."
|
||||||
|
indepencence_d = "It seems only 3rd-party services are listed."
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
indepencence_t = "Partial independence"
|
||||||
|
indepencence_d = `${stats.thirdParties} service${s(stats.thirdParties)} ${isare(stats.thirdParties)} provided by 3rd-parties.`
|
||||||
|
}
|
||||||
|
|
||||||
|
privacyBox("lock", "#0D6", encryption_t, encryption_d, stats.secure / stats.total)
|
||||||
|
privacyBox("home", "#68F", indepencence_t, indepencence_d, 1 - stats.thirdParties / stats.total)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user