Outage notice on home page

This commit is contained in:
2021-02-14 10:06:48 +01:00
parent 71f3c37ea3
commit 3a3cdaa59d
3 changed files with 56 additions and 20 deletions

View File

@@ -279,11 +279,14 @@
{{template `TextViewer.js`}}
{{template `FileViewer.js`}}
// This info gets filled in on the server side to prevent having to make an API call right after the page loads.
// Just to slice another few milliseconds from the load time :)
window.addEventListener("load", function(){
new Viewer('{{.Other.Type}}', '{{.Other.ViewToken}}', {{.Other.APIResponse}});
});
// DOMContentLoaded fires when the DOM tree has been parsed, but
// before the assets have loaded
window.addEventListener("DOMContentLoaded", () => {
// This info gets filled in on the server side to prevent having to
// make an API call right after the page loads. Just to slice
// another few milliseconds from the load time :)
new Viewer('{{.Other.Type}}', '{{.Other.ViewToken}}', {{.Other.APIResponse}})
})
</script>
{{template "analytics"}}
@@ -295,10 +298,14 @@
{{ else if eq .Other.AdType 7 }}
<!-- PropellerAds -->
<script>
// Load fires when the page is completely finished loading,
// including assets
window.addEventListener("load", () => {
(function(d,z,s){
s.src='//'+d+'/400/'+z
try{(document.body||document.documentElement).appendChild(s)}catch(e){}
})('in-page-push.com',3724132,document.createElement('script'))
})
</script>
{{ end }}
{{ end }}

View File

@@ -125,6 +125,37 @@
<img class="header_image" src="/res/img/header_orbitron_wide.png" alt="Header image">
</picture>
<br/>
<div class="highlight_blue">
<div class="limit_width">
<p>
Hello! Due to
<a href="https://nypost.com/2021/02/14/hundreds-of-thousands-without-power-after-oregon-ice-storm/" target="_blank">an ice storm in Oregon</a>
the datacenter where pixeldrain is hosted in North America
was cut off from the internet and has lost power. This
caused an outage of a few hours yesterday (it happened when
I was out ice skating).
</p>
<p>
I am now redirecting all American (north and south) traffic
to the UK, the server there has more than enough capacity to
handle it all. Due to the long distance the website might
feel a bit slower.
</p>
<p>
Files which were uploaded to the server in Oregon shortly
before the outage will not be available until the server is
back up. Normally all files are backed up in Finland, but
this process takes a while. Due to the abruptness of the
outage a lot of files could not make it over. When the
server comes back online your files will be downloadable
again.
</p>
<p>
I will post updates <a href="https://twitter.com/Fornax96"
target="_blank">on Twitter</a> when the situation changes.
</p>
</div>
</div>
<div class="page_content" style="padding-top: 0; margin-bottom: 100px;">
<div id="instruction_1" class="instruction_highlight" style="margin-top: 0;"><div class="limit_width">
<span class="big_number">1</span>

View File

@@ -48,22 +48,20 @@ func adType() int {
// or 1 we need to give it n=2. We can use this function to make other
// splits like 1/3 1/4, etc
switch i := rand.Intn(20); i {
case 0, 1, 2:
case 0, 1: // 10%
return amarulaSolutions
case 3:
case 2: // 5%
return pdpro1
case 4:
case 3: // 5%
return pdpro2
case 5:
case 4: // 5%
return pdpro3
case 6:
case 5: // 5%
return pdpro4
case 7, 8, 9:
return adMaven
case 10, 11, 12, 13, 14, 15, 16, 17, 18, 19:
default: // 70%
return propellerAds
default:
panic(fmt.Errorf("random number generator returned unrecognised number: %d", i))
// default:
// panic(fmt.Errorf("random number generator returned unrecognised number: %d", i))
}
}