photoprism/frontend/src/app.js

68 lines
1.7 KiB
JavaScript
Raw Normal View History

import Vue from 'vue';
2018-09-06 21:58:16 +00:00
import Vuetify from 'vuetify';
import Router from 'vue-router';
import '../css/app.css';
import App from 'app/main.vue';
import routes from 'app/routes';
import Api from 'common/api';
import Config from 'common/config';
import Components from 'component/components';
import Alert from 'common/alert';
import Gallery from 'common/gallery';
import Session from 'common/session';
import Event from 'pubsub-js';
2018-08-07 18:17:14 +00:00
import Moment from 'vue-moment';
import InfiniteScroll from 'vue-infinite-scroll';
import VueTruncate from 'vue-truncate-filter';
2018-09-25 07:45:06 +00:00
import VueFullscreen from 'vue-fullscreen';
// Initialize client-side session
const session = new Session(window.localStorage);
const config = new Config(window.localStorage, window.appConfig);
// Set global helpers
Vue.prototype.$event = Event;
Vue.prototype.$alert = Alert;
Vue.prototype.$gallery = new Gallery;
Vue.prototype.$session = session;
Vue.prototype.$api = Api;
Vue.prototype.$config = config;
// Register Vuetify
2018-09-06 21:58:16 +00:00
Vue.use(Vuetify, {
theme: {
2018-09-13 18:54:34 +00:00
primary: '#FFD600',
2018-09-06 21:58:16 +00:00
secondary: '#b0bec5',
accent: '#00B8D4',
2018-09-13 18:54:34 +00:00
error: '#E57373',
info: '#00B8D4',
success: '#00BFA5',
warning: '#FFD600',
2018-09-13 18:54:34 +00:00
delete: '#E57373',
love: '#EF5350',
2018-09-06 21:58:16 +00:00
},
});
// Register other VueJS plugins
2018-08-07 18:17:14 +00:00
Vue.use(Moment);
Vue.use(InfiniteScroll);
Vue.use(VueTruncate);
2018-09-25 07:45:06 +00:00
Vue.use(VueFullscreen);
Vue.use(Components);
Vue.use(Router);
// Configure client-side routing
const router = new Router({
routes,
mode: 'history',
saveScrollPosition: true,
});
// Run app
/* eslint-disable no-unused-vars */
const app = new Vue({
el: '#app',
router,
render: h => h(App),
});