vlayout: true,
isDark: null
},
- created: function () {
+ created: async function () {
let that = this;
- this.isDark = 'overrideDark' in localStorage ?
+ this.isDark = 'overrideDark' in localStorage ?
JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches;
if ('vlayout' in localStorage) {
this.vlayout = JSON.parse(localStorage.vlayout)
}
-
+
this.checkOffline();
- that.getConfig().then(function (config) {
- that.config = config;
- }).catch(function () {
- that.offline = true;
- });
+ try {
+ this.config = await this.getConfig();
+ } catch (error) {
+ this.offline = true;
+ }
+
+ // Look for a new message if an endpoint is provided.
+ if (this.config.message.url) {
+ this.getMessage(this.config.message.url).then(function(message){
+ // keep the original config value if no value is provided by the endpoint
+ for (const prop of ['title','style','content']) {
+ if (prop in message && message[prop] !== null) {
+ that.config.message[prop] = message[prop];
+ }
+ }
+ });
+ }
document.addEventListener('visibilitychange', function () {
if (document.visibilityState == "visible") {
});
});
},
+ getMessage: function (url) {
+ return fetch(url).then(function (response) {
+ if (response.status != 200) {
+ return;
+ }
+ return response.json();
+ });
+ },
toggleTheme: function() {
this.isDark = !this.isDark;
localStorage.overrideDark = this.isDark;
},
toggleLayout: function() {
this.vlayout = !this.vlayout;
- localStorage.vlayout = this.vlayout;
- },
+ localStorage.vlayout = this.vlayout;
+ },
}
});
if ('serviceWorker' in navigator) {
window.addEventListener('load', function () {
- navigator.serviceWorker.register('/worker.js');
+ navigator.serviceWorker.register('worker.js');
});
}
# Optional message
# See https://bulma.io/documentation/components/message/#colors for styling options.
message:
+ # url: https://....
style: "is-warning"
title: "Optional message!"
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque risus mi, tempus quis placerat ut, porta nec nulla. Vestibulum rhoncus ac ex sit amet fringilla. Nullam gravida purus diam, et dictum felis venenatis efficitur. Aenean ac eleifend lacus, in mollis lectus. Donec sodales, arcu et sollicitudin porttitor, tortor urna tempor ligula."
icon: "fas fa-code-branch"
items:
- name: "Jenkins"
- logo: "/assets/tools/jenkins.png"
+ logo: "assets/tools/jenkins.png"
subtitle: "Continuous integration server"
tag: "CI"
url: "#"
- name: "RabbitMQ Management"
- logo: "/assets/tools/rabbitmq.png"
+ logo: "assets/tools/rabbitmq.png"
subtitle: "Manage & monitor RabbitMQ server"
tag: "haproxy"
# Optional tagstyle
icon: "fas fa-heartbeat"
items:
- name: "M/Monit"
- logo: "/assets/tools/monit.png"
+ logo: "assets/tools/monit.png"
subtitle: "Monitor & manage all monit enabled hosts"
tag: "monit"
url: "#"
- name: "Grafana"
- logo: "/assets/tools/grafana.png"
+ logo: "assets/tools/grafana.png"
subtitle: "Metric analytics & dashboards"
url: "#"
- name: "Kibana"
- logo: "/assets/tools/elastic.png"
+ logo: "assets/tools/elastic.png"
subtitle: "Explore & visualize logs"
tag: "elk"
url: "#"
- name: "Website monitoring"
- logo: "/assets/tools/pingdom.png"
+ logo: "assets/tools/pingdom.png"
subtitle: "Pingdom public reports overview"
tag: "CI"
url: "#"