From ed2a1066cc2615d1df19f461955ebf6fae938c96 Mon Sep 17 00:00:00 2001 From: les Date: Fri, 9 Aug 2019 13:21:32 +0200 Subject: [PATCH] restore color on cal --- components/Calendar.vue | 18 +++++++++++------- server/index.js | 35 +++-------------------------------- 2 files changed, 14 insertions(+), 39 deletions(-) diff --git a/components/Calendar.vue b/components/Calendar.vue index 91701443..9b46f014 100644 --- a/components/Calendar.vue +++ b/components/Calendar.vue @@ -41,10 +41,11 @@ export default { computed: { ...mapGetters(['filteredEventsWithPast']), ...mapState(['tags', 'filters']), + + // TODO: should be better attributes () { - const colors = ['indigo', 'orange', 'yellow', 'green', 'teal', 'blue', 'red', 'purple', 'pink', 'grey'] - const tags = take(this.tags, 10)//.map(t=>t.tag) - // const tags = [this.tags[0].tag, this.tags[1].tag, this.tags[2].tag, this.tags[3].tag, this.tags[4].tag, this.tags[5].tag ] + const colors = ['green', 'orange', 'yellow', 'teal', 'indigo', 'blue', 'red', 'purple', 'pink', 'grey'] + const tags = take(this.tags, 10).map(t=>t.tag) let attributes = [] attributes.push ({ key: 'today', dates: new Date(), highlight: { color: 'green' }}) @@ -61,10 +62,13 @@ export default { attributes = attributes.concat(this.filteredEventsWithPast .filter(e => !e.multidate) - .map(e => ({ - key: e.id, - dot: getColor(e), - dates: new Date(e.start_datetime*1000)}))) + .map(e => { + const color = getColor(e) + return { + key: e.id, + dot: color, + dates: new Date(e.start_datetime*1000) + }})) attributes = attributes.concat(this.filteredEventsWithPast .filter(e => e.multidate) diff --git a/server/index.js b/server/index.js index 9e89b6e3..8105ee69 100644 --- a/server/index.js +++ b/server/index.js @@ -1,20 +1,13 @@ //#!/bin/env node -//const path = require('path') -//const express = require('express') -//const consola = require('consola') -//const morgan = require('morgan') const { Nuxt, Builder } = require('nuxt') -//const api = require('./api') -//const federation = require('./federation') -//const webfinger = require('./federation/webfinger') - // Import and Set Nuxt.js options const nuxt_config = require('../nuxt.config.js') const config = require('config') -async function start() { +async function main() { nuxt_config.server = config.server + // Init Nuxt.js const nuxt = new Nuxt(nuxt_config) @@ -27,36 +20,14 @@ async function start() { } nuxt.listen() - // configurable favicon && logo - //app.use('/favicon.ico', express.static(path.resolve(config.favicon || 'assets/favicon.ico'))) - - //app.use(morgan('dev')) - //app.use('/media/', express.static(config.upload_path)) - - // gancio standard api - //app.use('/api', api) - - // federation api / activitypub / webfinger / nodeinfo - //app.use('/.well-known', webfinger) - //app.use('/federation', federation) - - // Give nuxt middleware to express - //app.use(nuxt.render) - - // Listen - //const server = app.listen(nuxt_config.server) - // close connections/port/unix socket function shutdown() { - consola.info(`Closing connections..`) nuxt.close(() => { - // TODO, close db connection? process.exit() }) } process.on('SIGTERM', shutdown) process.on('SIGINT', shutdown) - } -start() +main()