瀏覽代碼

feat(webapp): breaking news on homepage

Nils Wisiol 5 年之前
父節點
當前提交
7713f34e0e
共有 1 個文件被更改,包括 18 次插入1 次删除
  1. 18 1
      webapp/src/views/Home.vue

+ 18 - 1
webapp/src/views/Home.vue

@@ -174,8 +174,13 @@ export default {
   },
   created() {
     this.domainType = this.$route.query.domainType || 'none';
+    for (let news of this.breaking_news) {
+      if (new Date() >= news.start && new Date() < news.end) {
+        this.$store.commit('alert', news);
+      }
+    }
   },
-    data: () => ({
+  data: () => ({
     contact_email: process.env.VUE_APP_EMAIL,
     contact_subject: 'Adopting of a Frontend Server',
     contact_body: 'Dear deSEC,\n\nI would like to adopt a frontend server in your networks!',
@@ -359,6 +364,18 @@ export default {
         text: "We provide easy integration with Let's Encrypt and their certbot tool.",
       },
     ],
+    breaking_news: [
+      {
+        id: 'news-20200604001',
+        start: new Date(Date.UTC(2020, 6 - 1, 4)),  // first day of showing
+        end: new Date(Date.UTC(2020, 6 - 1, 7)),  // first day of not showing
+        icon: 'mdi-heart-broken',
+        teaser: 'DNS operations experienced a partial service disruption on June 4, 2020, starting at 12am UTC. ' +
+                'The issue was resolved at 7am UTC.',
+        button: 'Learn More',
+        href: '//talk.desec.io/t/service-disruption-on-june-4-2020/98',
+      },
+    ],
   })
 }
 </script>