Browse Source

vue formatting tweaks (#704)

* add .prettierrc

* apply formatting
pull/706/head
Jason Dove 4 years ago committed by GitHub
parent
commit
809a623a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ErsatzTV/client-app/.prettierrc
  2. 2
      ErsatzTV/client-app/babel.config.js
  3. 10
      ErsatzTV/client-app/src/App.vue
  4. 10
      ErsatzTV/client-app/src/components/Navigation/SideBarLogo.vue
  5. 16
      ErsatzTV/client-app/src/components/Navigation/SideBarMenu.vue
  6. 14
      ErsatzTV/client-app/src/components/Navigation/SideBarMenuItem.vue
  7. 20
      ErsatzTV/client-app/src/components/Navigation/SideBarMenuItemExpandable.vue
  8. 14
      ErsatzTV/client-app/src/components/Navigation/SideBarVersion.vue
  9. 26
      ErsatzTV/client-app/src/components/Navigation/ToolBar.vue
  10. 22
      ErsatzTV/client-app/src/components/Navigation/ToolBarLinks.vue
  11. 2
      ErsatzTV/client-app/src/components/Navigation/ToolBarSearch.vue
  12. 20
      ErsatzTV/client-app/src/components/PopUps/SnackBar.vue
  13. 20
      ErsatzTV/client-app/src/main.js
  14. 4
      ErsatzTV/client-app/src/mixins/autoPageTitle.js
  15. 22
      ErsatzTV/client-app/src/plugins/vuetify.js
  16. 268
      ErsatzTV/client-app/src/router/index.js
  17. 24
      ErsatzTV/client-app/src/stores/applicationState.js
  18. 12
      ErsatzTV/client-app/src/stores/snackbarState.js
  19. 2
      ErsatzTV/client-app/src/views/HomePage.vue
  20. 12
      ErsatzTV/client-app/vue.config.js

5
ErsatzTV/client-app/.prettierrc

@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "none"
}

2
ErsatzTV/client-app/babel.config.js

@ -1,3 +1,3 @@
module.exports = { module.exports = {
presets: ["@vue/cli-plugin-babel/preset"], presets: ['@vue/cli-plugin-babel/preset']
}; };

10
ErsatzTV/client-app/src/App.vue

@ -14,13 +14,13 @@
</template> </template>
<script> <script>
import Vue from "vue"; import Vue from 'vue';
import Toolbar from "@/components/Navigation/ToolBar.vue"; import Toolbar from '@/components/Navigation/ToolBar.vue';
import SnackBar from "@/components/PopUps/SnackBar"; import SnackBar from '@/components/PopUps/SnackBar';
export default Vue.extend({ export default Vue.extend({
name: "App", name: 'App',
components: { Toolbar, SnackBar }, components: { Toolbar, SnackBar },
data: () => ({}), data: () => ({})
}); });
</script> </script>
<style> <style>

10
ErsatzTV/client-app/src/components/Navigation/SideBarLogo.vue

@ -15,13 +15,13 @@
</template> </template>
<script> <script>
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { applicationState } from "@/stores/applicationState"; import { applicationState } from '@/stores/applicationState';
export default { export default {
name: "SideBarLogo", name: 'SideBarLogo',
computed: { computed: {
...mapState(applicationState, ["isNavigationMini"]), ...mapState(applicationState, ['isNavigationMini'])
}, }
}; };
</script> </script>

16
ErsatzTV/client-app/src/components/Navigation/SideBarMenu.vue

@ -21,23 +21,23 @@
</template> </template>
<script> <script>
import SideBarMenuItem from "./SideBarMenuItem"; import SideBarMenuItem from './SideBarMenuItem';
import SideBarMenuItemExpandable from "./SideBarMenuItemExpandable"; import SideBarMenuItemExpandable from './SideBarMenuItemExpandable';
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { applicationState } from "@/stores/applicationState"; import { applicationState } from '@/stores/applicationState';
export default { export default {
name: "NavSidebar", name: 'NavSidebar',
components: { SideBarMenuItem, SideBarMenuItemExpandable }, components: { SideBarMenuItem, SideBarMenuItemExpandable },
data: () => ({ data: () => ({
navigation: null, navigation: null
}), }),
computed: { computed: {
...mapState(applicationState, ["disableMiniNavigation"]), ...mapState(applicationState, ['disableMiniNavigation'])
}, },
beforeMount: function () { beforeMount: function () {
//Pull in navigation from routes and load into DOM //Pull in navigation from routes and load into DOM
this.navigation = this.$router.options.routes; this.navigation = this.$router.options.routes;
}, }
}; };
</script> </script>

14
ErsatzTV/client-app/src/components/Navigation/SideBarMenuItem.vue

@ -14,24 +14,24 @@
<script> <script>
export default { export default {
name: "SideBarMenuItem", name: 'SideBarMenuItem',
props: { props: {
name: { name: {
type: String, type: String,
required: true, required: true
}, },
path: { path: {
type: String, type: String,
required: true, required: true
}, },
icon: { icon: {
type: String, type: String,
required: true, required: true
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
required: true, required: true
}, }
}, }
}; };
</script> </script>

20
ErsatzTV/client-app/src/components/Navigation/SideBarMenuItemExpandable.vue

@ -33,27 +33,27 @@
<script> <script>
export default { export default {
name: "SideBarMenuItemExpandable", name: 'SideBarMenuItemExpandable',
props: { props: {
name: { name: {
type: String, type: String,
required: true, required: true
}, },
icon: { icon: {
type: String, type: String,
required: true, required: true
}, },
disabled: { disabled: {
type: Boolean, type: Boolean,
required: true, required: true
}, },
children: { children: {
type: Array, type: Array,
required: true, required: true
}, }
}, },
data: () => ({ data: () => ({
opened: false, opened: false
}), }),
computed: { computed: {
menuItemOpened: { menuItemOpened: {
@ -62,8 +62,8 @@ export default {
}, },
set: function () { set: function () {
return !this.opened; return !this.opened;
}, }
}, }
}, }
}; };
</script> </script>

14
ErsatzTV/client-app/src/components/Navigation/SideBarVersion.vue

@ -8,17 +8,17 @@
</template> </template>
<script> <script>
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { applicationState } from "@/stores/applicationState"; import { applicationState } from '@/stores/applicationState';
export default { export default {
name: "SideBarVersion", name: 'SideBarVersion',
computed: { computed: {
...mapState(applicationState, [ ...mapState(applicationState, [
"currentServerVersion", 'currentServerVersion',
"isNavigationMini", 'isNavigationMini'
]), ])
}, }
}; };
</script> </script>

26
ErsatzTV/client-app/src/components/Navigation/ToolBar.vue

@ -22,28 +22,28 @@
</template> </template>
<script> <script>
import SideBarLogo from "./SideBarLogo.vue"; import SideBarLogo from './SideBarLogo.vue';
import SideBarMenu from "./SideBarMenu.vue"; import SideBarMenu from './SideBarMenu.vue';
import SideBarVersion from "./SideBarVersion"; import SideBarVersion from './SideBarVersion';
import ToolBarLinks from "./ToolBarLinks"; import ToolBarLinks from './ToolBarLinks';
import ToolBarSearch from "./ToolBarSearch"; import ToolBarSearch from './ToolBarSearch';
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { applicationState } from "@/stores/applicationState"; import { applicationState } from '@/stores/applicationState';
export default { export default {
name: "NavToolbar", name: 'NavToolbar',
components: { components: {
SideBarMenu, SideBarMenu,
SideBarLogo, SideBarLogo,
SideBarVersion, SideBarVersion,
ToolBarLinks, ToolBarLinks,
ToolBarSearch, ToolBarSearch
}, },
computed: { computed: {
...mapState(applicationState, [ ...mapState(applicationState, [
"isNavigationMini", 'isNavigationMini',
"toggleMiniNavigation", 'toggleMiniNavigation'
]), ])
}, }
}; };
</script> </script>

22
ErsatzTV/client-app/src/components/Navigation/ToolBarLinks.vue

@ -64,21 +64,21 @@
</template> </template>
<script> <script>
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { applicationState } from "@/stores/applicationState"; import { applicationState } from '@/stores/applicationState';
import { snackbarState } from "@/stores/snackbarState"; import { snackbarState } from '@/stores/snackbarState';
export default { export default {
name: "ToolBarLinks.vue", name: 'ToolBarLinks.vue',
data: () => ({ data: () => ({
toast: false, toast: false,
clickToCopyText: "Click to copy to clipboard!", clickToCopyText: 'Click to copy to clipboard!',
successCopyText: "Successfully copied text to clipboard!", successCopyText: 'Successfully copied text to clipboard!',
failedCopyText: "Failed to copy text to clipboard! Error: ", failedCopyText: 'Failed to copy text to clipboard! Error: '
}), }),
computed: { computed: {
...mapState(applicationState, ["navBarURLs"]), ...mapState(applicationState, ['navBarURLs']),
...mapState(snackbarState, ["showSnackbar"]), ...mapState(snackbarState, ['showSnackbar'])
}, },
methods: { methods: {
copyTextToClipboard(text) { copyTextToClipboard(text) {
@ -89,8 +89,8 @@ export default {
console.error(e); console.error(e);
this.showSnackbar(`${this.failedCopyText}${e}`); this.showSnackbar(`${this.failedCopyText}${e}`);
} }
}, }
}, }
}; };
</script> </script>

2
ErsatzTV/client-app/src/components/Navigation/ToolBarSearch.vue

@ -11,7 +11,7 @@
<script> <script>
export default { export default {
name: "ToolBarSearch", name: 'ToolBarSearch'
}; };
</script> </script>

20
ErsatzTV/client-app/src/components/PopUps/SnackBar.vue

@ -8,19 +8,19 @@
</template> </template>
<script> <script>
import { mapState } from "pinia"; import { mapState } from 'pinia';
import { snackbarState } from "@/stores/snackbarState"; import { snackbarState } from '@/stores/snackbarState';
export default { export default {
data: () => ({ data: () => ({
timeout: 4000, timeout: 4000
}), }),
computed: { computed: {
...mapState(snackbarState, [ ...mapState(snackbarState, [
"currentMessage", 'currentMessage',
"isVisible", 'isVisible',
"closeSnackbar", 'closeSnackbar',
"openSnackbar", 'openSnackbar'
]), ]),
snackbar: { snackbar: {
get() { get() {
@ -28,8 +28,8 @@ export default {
}, },
set() { set() {
this.closeSnackbar(); this.closeSnackbar();
}, }
}, }
}, }
}; };
</script> </script>

20
ErsatzTV/client-app/src/main.js

@ -1,11 +1,11 @@
import Vue from "vue"; import Vue from 'vue';
import App from "./App.vue"; import App from './App.vue';
import vuetify from "./plugins/vuetify"; import vuetify from './plugins/vuetify';
import router from "./router"; import router from './router';
import { createPinia, PiniaVuePlugin } from "pinia"; import { createPinia, PiniaVuePlugin } from 'pinia';
import autoPageTitleMixin from "./mixins/autoPageTitle"; import autoPageTitleMixin from './mixins/autoPageTitle';
import "roboto-fontface/css/roboto/roboto-fontface.css"; import 'roboto-fontface/css/roboto/roboto-fontface.css';
import "@mdi/font/css/materialdesignicons.css"; import '@mdi/font/css/materialdesignicons.css';
Vue.config.productionTip = false; Vue.config.productionTip = false;
@ -19,5 +19,5 @@ new Vue({
vuetify, vuetify,
router, router,
pinia, pinia,
render: (h) => h(App), render: (h) => h(App)
}).$mount("#app"); }).$mount('#app');

4
ErsatzTV/client-app/src/mixins/autoPageTitle.js

@ -1,7 +1,7 @@
function getTitle(vm) { function getTitle(vm) {
const { title } = vm.$options; const { title } = vm.$options;
if (title) { if (title) {
return typeof title === "function" ? title.call(vm) : title; return typeof title === 'function' ? title.call(vm) : title;
} }
} }
@ -11,5 +11,5 @@ export default {
if (title) { if (title) {
document.title = `ErsatzTV | ${title}`; document.title = `ErsatzTV | ${title}`;
} }
}, }
}; };

22
ErsatzTV/client-app/src/plugins/vuetify.js

@ -1,28 +1,28 @@
import Vue from "vue"; import Vue from 'vue';
import Vuetify from "vuetify/lib/framework"; import Vuetify from 'vuetify/lib/framework';
import colors from "vuetify/lib/util/colors"; import colors from 'vuetify/lib/util/colors';
Vue.use(Vuetify); Vue.use(Vuetify);
export default new Vuetify({ export default new Vuetify({
icons: { icons: {
iconfont: "mdi", // default - only for display purposes iconfont: 'mdi' // default - only for display purposes
}, },
theme: { theme: {
themes: { themes: {
dark: { dark: {
primary: "#c0c000", primary: '#c0c000',
secondary: "#00c0c0", secondary: '#00c0c0',
accent: colors.yellow.accent2, accent: colors.yellow.accent2,
error: colors.red, error: colors.red,
warning: colors.orange, warning: colors.orange,
info: colors.lightBlue, info: colors.lightBlue,
success: colors.green, success: colors.green
}, }
}, },
options: { options: {
customProperties: true, customProperties: true
}, },
dark: true, dark: true
}, }
}); });

268
ErsatzTV/client-app/src/router/index.js

@ -1,223 +1,223 @@
import Vue from "vue"; import Vue from 'vue';
import VueRouter from "vue-router"; import VueRouter from 'vue-router';
import HomePage from "../views/HomePage.vue"; import HomePage from '../views/HomePage.vue';
Vue.use(VueRouter); Vue.use(VueRouter);
const routes = [ const routes = [
{ {
path: "/", path: '/',
name: "Home", name: 'Home',
component: HomePage, component: HomePage,
meta: { meta: {
icon: "mdi-home", icon: 'mdi-home',
disabled: false, disabled: false
}, }
}, },
{ {
path: "/channels", path: '/channels',
name: "Channels", name: 'Channels',
meta: { meta: {
icon: "mdi-broadcast", icon: 'mdi-broadcast',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/ffmpeg-profiles", path: '/ffmpeg-profiles',
name: "FFmpeg Profiles", name: 'FFmpeg Profiles',
meta: { meta: {
icon: "mdi-video-input-component", icon: 'mdi-video-input-component',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/watermarks", path: '/watermarks',
name: "Watermarks", name: 'Watermarks',
meta: { meta: {
icon: "mdi-watermark", icon: 'mdi-watermark',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/sources", path: '/sources',
name: "Media Sources", name: 'Media Sources',
meta: { meta: {
icon: "mdi-server-network", icon: 'mdi-server-network',
disabled: false, disabled: false
}, },
children: [ children: [
{ {
path: "/sources/local", path: '/sources/local',
name: "Local", name: 'Local',
meta: { meta: {
icon: "mdi-folder", icon: 'mdi-folder',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/sources/emby", path: '/sources/emby',
name: "Emby", name: 'Emby',
meta: { meta: {
icon: "mdi-emby", icon: 'mdi-emby',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/sources/jellyfin", path: '/sources/jellyfin',
name: "Jellyfin", name: 'Jellyfin',
meta: { meta: {
icon: "mdi-jellyfish", icon: 'mdi-jellyfish',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/sources/plex", path: '/sources/plex',
name: "Plex", name: 'Plex',
meta: { meta: {
icon: "mdi-plex", icon: 'mdi-plex',
disabled: true, disabled: true
}, }
}, }
], ]
}, },
{ {
path: "/media", path: '/media',
name: "Media", name: 'Media',
meta: { meta: {
icon: "mdi-cog", icon: 'mdi-cog',
disabled: false, disabled: false
}, },
children: [ children: [
{ {
path: "/media/libraries", path: '/media/libraries',
name: "Libraries", name: 'Libraries',
meta: { meta: {
icon: "mdi-library", icon: 'mdi-library',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/trash", path: '/media/trash',
name: "Trash", name: 'Trash',
meta: { meta: {
icon: "mdi-trash-can", icon: 'mdi-trash-can',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/tv-shows", path: '/media/tv-shows',
name: "TV Shows", name: 'TV Shows',
meta: { meta: {
icon: "mdi-television-classic", icon: 'mdi-television-classic',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/movies", path: '/media/movies',
name: "Movies", name: 'Movies',
meta: { meta: {
icon: "mdi-movie", icon: 'mdi-movie',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/music-videos", path: '/media/music-videos',
name: "Music Videos", name: 'Music Videos',
meta: { meta: {
icon: "mdi-music-circle", icon: 'mdi-music-circle',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/other-videos", path: '/media/other-videos',
name: "Other Videos", name: 'Other Videos',
meta: { meta: {
icon: "mdi-video", icon: 'mdi-video',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/media/songs", path: '/media/songs',
name: "Songs", name: 'Songs',
meta: { meta: {
icon: "mdi-album", icon: 'mdi-album',
disabled: true, disabled: true
}, }
}, }
], ]
}, },
{ {
path: "/lists", path: '/lists',
name: "Lists", name: 'Lists',
meta: { meta: {
icon: "mdi-format-list-bulleted", icon: 'mdi-format-list-bulleted',
disabled: false, disabled: false
}, },
children: [ children: [
{ {
path: "/lists/collections", path: '/lists/collections',
name: "Collections", name: 'Collections',
meta: { meta: {
icon: "mdi-collage", icon: 'mdi-collage',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/lists/trakt-lists", path: '/lists/trakt-lists',
name: "Trakt Lists", name: 'Trakt Lists',
meta: { meta: {
icon: "mdi-hammer", icon: 'mdi-hammer',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/lists/filler-presets", path: '/lists/filler-presets',
name: "Filler Presets", name: 'Filler Presets',
meta: { meta: {
icon: "mdi-tune-vertical", icon: 'mdi-tune-vertical',
disabled: true, disabled: true
}, }
}, }
], ]
}, },
{ {
path: "/schedules", path: '/schedules',
name: "Schedules", name: 'Schedules',
meta: { meta: {
icon: "mdi-calendar", icon: 'mdi-calendar',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/playouts", path: '/playouts',
name: "Playouts", name: 'Playouts',
meta: { meta: {
icon: "mdi-clipboard-play-multiple", icon: 'mdi-clipboard-play-multiple',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/settings", path: '/settings',
name: "Settings", name: 'Settings',
meta: { meta: {
icon: "mdi-cog", icon: 'mdi-cog',
disabled: true, disabled: true
}, }
}, },
{ {
path: "/Logs", path: '/Logs',
name: "Logs", name: 'Logs',
meta: { meta: {
icon: "mdi-card-text", icon: 'mdi-card-text',
disabled: true, disabled: true
}, }
}, }
]; ];
const router = new VueRouter({ const router = new VueRouter({
mode: "history", mode: 'history',
base: process.env.BASE_URL, base: process.env.BASE_URL,
routes, routes
}); });
export default router; export default router;

24
ErsatzTV/client-app/src/stores/applicationState.js

@ -1,17 +1,17 @@
import { defineStore } from "pinia"; import { defineStore } from 'pinia';
const originURL = `${window.location.origin}`; const originURL = `${window.location.origin}`;
export const applicationState = defineStore("appState", { export const applicationState = defineStore('appState', {
state: () => { state: () => {
return { return {
miniMenu: false, miniMenu: false,
currentVersion: "0.4.3-7cd2f9a-docker-nvidia", // Needs to be pulled from API with an action when ready currentVersion: '0.4.3-7cd2f9a-docker-nvidia', // Needs to be pulled from API with an action when ready
m3uURL: originURL + "/iptv/channels.m3u", // this will need to be fixed for reverse proxies m3uURL: originURL + '/iptv/channels.m3u', // this will need to be fixed for reverse proxies
xmlURL: originURL + "/iptv/xmltv.xml", // this will need to be fixed for reverse proxies xmlURL: originURL + '/iptv/xmltv.xml', // this will need to be fixed for reverse proxies
documentationURL: "https://ersatztv.org/", documentationURL: 'https://ersatztv.org/',
githubURL: "https://github.com/jasongdove/ErsatzTV", githubURL: 'https://github.com/jasongdove/ErsatzTV',
discordURL: "https://discord.gg/hHaJm3yGy6", discordURL: 'https://discord.gg/hHaJm3yGy6'
}; };
}, },
getters: { getters: {
@ -27,9 +27,9 @@ export const applicationState = defineStore("appState", {
xmlURL: state.xmlURL, xmlURL: state.xmlURL,
documentationURL: state.documentationURL, documentationURL: state.documentationURL,
githubURL: state.githubURL, githubURL: state.githubURL,
discordURL: state.discordURL, discordURL: state.discordURL
}; };
}, }
}, },
actions: { actions: {
toggleMiniNavigation() { toggleMiniNavigation() {
@ -37,6 +37,6 @@ export const applicationState = defineStore("appState", {
}, },
disableMiniNavigation() { disableMiniNavigation() {
this.miniMenu = false; this.miniMenu = false;
}, }
}, }
}); });

12
ErsatzTV/client-app/src/stores/snackbarState.js

@ -1,10 +1,10 @@
import { defineStore } from "pinia"; import { defineStore } from 'pinia';
export const snackbarState = defineStore("snackbarState", { export const snackbarState = defineStore('snackbarState', {
state: () => { state: () => {
return { return {
visible: false, visible: false,
message: "", message: ''
}; };
}, },
getters: { getters: {
@ -13,7 +13,7 @@ export const snackbarState = defineStore("snackbarState", {
}, },
currentMessage(state) { currentMessage(state) {
return state.message; return state.message;
}, }
}, },
actions: { actions: {
showSnackbar(message) { showSnackbar(message) {
@ -22,6 +22,6 @@ export const snackbarState = defineStore("snackbarState", {
}, },
closeSnackbar() { closeSnackbar() {
this.visible = false; this.visible = false;
}, }
}, }
}); });

2
ErsatzTV/client-app/src/views/HomePage.vue

@ -8,6 +8,6 @@
export default { export default {
title() { title() {
return `Home`; return `Home`;
}, }
}; };
</script> </script>

12
ErsatzTV/client-app/vue.config.js

@ -1,13 +1,13 @@
const { defineConfig } = require("@vue/cli-service"); const { defineConfig } = require('@vue/cli-service');
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: ["vuetify"], transpileDependencies: ['vuetify'],
runtimeCompiler: true, runtimeCompiler: true,
pwa: { pwa: {
name: "ErsatzTV", name: 'ErsatzTV'
}, },
publicPath: "/v2/", publicPath: '/v2/',
outputDir: "../wwwroot/v2", outputDir: '../wwwroot/v2',
filenameHashing: false, filenameHashing: false
}); });

Loading…
Cancel
Save