work on logs, timetable, stats

This commit is contained in:
bkfox
2019-09-08 01:39:40 +02:00
parent 2d21ab2434
commit c68e21ee57
71 changed files with 19683 additions and 710 deletions

View File

@ -1,3 +1,13 @@
import Vue from 'vue';
import './admin.scss';
import Statistics from './statistics.vue';
Vue.component('a-statistics', Statistics)
import 'public';

View File

@ -0,0 +1,39 @@
<template>
<form ref="form">
<slot :counts="counts"></slot>
</form>
</template>
<script>
const splitReg = new RegExp(`,\s*`, 'g');
export default {
data() {
return {
counts: {},
}
},
methods: {
update() {
const items = this.$el.querySelectorAll('input[name="data"]:checked')
const counts = {};
console.log(items)
for(var item of items)
if(item.value)
for(var tag of item.value.split(splitReg))
counts[tag.trim()] = (counts[tag.trim()] || 0) + 1;
this.counts = counts;
console.log('counts', this.counts)
}
},
mounted() {
this.$refs.form.addEventListener('change', () => this.update())
this.update()
}
}
</script>

View File

@ -1,10 +0,0 @@
import '@fortawesome/fontawesome-free/css/all.min.css';
import '@fortawesome/fontawesome-free/css/fontawesome.min.css';
import './js';
import './vue';
import './styles.scss';
// import './noscript.scss';
import './admin';

View File

@ -1,4 +0,0 @@
import app from './app';
import LiveInfo from './liveInfo';

View File

@ -1,6 +0,0 @@
/**[noscript="hidden"] {
display: none;
}*/

View File

@ -1,9 +1,8 @@
import Vue from 'vue';
import Buefy from 'buefy';
Vue.use(Buefy);
export var app = null;
export default app;
function loadApp() {
app = new Vue({
@ -12,7 +11,7 @@ function loadApp() {
})
}
window.addEventListener('load', loadApp);

28
assets/public/index.js Normal file
View File

@ -0,0 +1,28 @@
/**
* This module includes code available for both the public website and
* administration interface)
*/
//-- vendor
import Vue from 'vue';
import '@fortawesome/fontawesome-free/css/all.min.css';
import '@fortawesome/fontawesome-free/css/fontawesome.min.css';
import 'buefy/dist/buefy.css';
//-- aircox
import app from './app';
import LiveInfo from './liveInfo';
import './styles.scss';
import Player from './player.vue';
Vue.component('a-player', Player)
window.aircox = {
app: app,
LiveInfo: LiveInfo,
}

View File

@ -26,7 +26,7 @@
<script>
import LiveInfo from 'js/liveInfo';
import LiveInfo from './liveInfo';
export const State = {
paused: 0,

View File

@ -1,28 +0,0 @@
<template>
<div>
<a-tabs class="tabs" @select="value = $event.value;">
<template v-slot:default><slot name="tabs" :value="value"/></template>
</a-tabs>
<slot :value="value"></slot>
</div>
</template>
<script>
import Tabs from './tabs.vue';
export default {
props: ['default'],
data() {
return {
value: this.default,
}
},
components: {
'a-tabs': Tabs,
}
}
</script>

View File

@ -1,13 +0,0 @@
import Vue from 'vue';
import Player from './player.vue';
import Tab from './tab.vue';
import Tabs from './tabs.vue';
Vue.component('a-player', Player);
Vue.component('a-tab', Tab);
Vue.component('a-tabs', Tabs);
export {Player, Tab, Tabs};

View File

@ -1,31 +0,0 @@
<template>
<li @click.prevent="onclick"
:class="{'is-active': $parent.value == value}">
<slot></slot>
</li>
</template>
<script>
export default {
props: {
value: { default: undefined },
},
methods: {
select() {
this.$parent.selectTab(this);
},
onclick(event) {
this.select();
/*if(event.target.href != document.location)
window.history.pushState(
{ url: event.target.href },
event.target.innerText + ' - ' + document.title,
event.target.href
) */
}
}
}
</script>

View File

@ -1,45 +0,0 @@
<template>
<div>
<div class="tabs is-centered is-medium">
<ul><slot name="tabs" :value="value" /></ul>
</div>
<slot :value="value"/>
</div>
</template>
<script>
export default {
props: {
default: { default: null },
},
data() {
return {
value: this.default,
}
},
computed: {
tab() {
const vnode = this.$slots.default && this.$slots.default.find(
elm => elm.child && elm.child.value == this.value
);
return vnode && vnode.child;
}
},
methods: {
selectTab(tab) {
const value = tab.value;
if(this.value === value)
return;
this.value = value;
this.$emit('select', {target: this, value: value, tab: tab});
},
},
}
</script>