Simplify service structure

This commit is contained in:
Bastien Wirtz 2020-09-04 15:43:44 -07:00
parent bcf0e1bec2
commit ffe3404a2a
4 changed files with 9 additions and 19 deletions

View File

@ -13,7 +13,7 @@ Title, icons, links, colors, and services can be configured in the `config.yml`
title: "App dashboard" title: "App dashboard"
subtitle: "Homer" subtitle: "Homer"
logo: "assets/homer.png" logo: "assets/logo.png"
# Alternatively a fa icon can be provided: # Alternatively a fa icon can be provided:
# icon: "fas fa-skull-crossbones" # icon: "fas fa-skull-crossbones"

View File

@ -2,8 +2,7 @@
/* Custom card colors */ /* Custom card colors */
/* Use with `class:` property of services in config.yml */ /* Use with `class:` property of services in config.yml */
body #app .card .green body #app .card.green {
{
background-color: #006600; background-color: #006600;
color: #00ff00; color: #00ff00;
} }

View File

@ -161,7 +161,7 @@ export default {
this.services = this.config.services; this.services = this.config.services;
document.title = `${this.config.title} | ${this.config.subtitle}`; document.title = `${this.config.title} | ${this.config.subtitle}`;
if (this.config.stylesheet) { if (this.config.stylesheet) {
let stylesheet = ''; let stylesheet = "";
for (const file of this.config.stylesheet) { for (const file of this.config.stylesheet) {
stylesheet += `@import "${file}";`; stylesheet += `@import "${file}";`;
} }
@ -242,8 +242,8 @@ export default {
}, },
}; };
}, },
createStylesheet: function(css) { createStylesheet: function (css) {
let style = document.createElement('style'); let style = document.createElement("style");
style.appendChild(document.createTextNode(css)); style.appendChild(document.createTextNode(css));
document.head.appendChild(style); document.head.appendChild(style);
}, },

View File

@ -1,11 +1,8 @@
<template> <template>
<div> <div>
<div class="card"> <div class="card" :class="item.class">
<a :href="item.url" :target="item.target" rel="noreferrer"> <a :href="item.url" :target="item.target" rel="noreferrer">
<div <div class="card-content">
class="card-content"
:class="item.class"
>
<div class="media"> <div class="media">
<div v-if="item.logo" class="media-left"> <div v-if="item.logo" class="media-left">
<figure class="image is-48x48"> <figure class="image is-48x48">
@ -18,14 +15,8 @@
</figure> </figure>
</div> </div>
<div class="media-content"> <div class="media-content">
<p <p class="title is-4">{{ item.name }}</p>
class="title is-4" <p class="subtitle is-6">{{ item.subtitle }}</p>
:class="item.class"
>{{ item.name }}</p>
<p
class="subtitle is-6"
:class="item.class"
>{{ item.subtitle }}</p>
</div> </div>
</div> </div>
<div class="tag" :class="item.tagstyle" v-if="item.tag"> <div class="tag" :class="item.tagstyle" v-if="item.tag">