@ -0,0 +1,24 @@ | |||||
module.exports = { | |||||
root: true, | |||||
env: { | |||||
browser: true, | |||||
node: true | |||||
}, | |||||
parserOptions: { | |||||
parser: 'babel-eslint' | |||||
}, | |||||
extends: [ | |||||
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention | |||||
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. | |||||
'plugin:vue/essential' | |||||
], | |||||
// required to lint *.vue files | |||||
plugins: [ | |||||
'vue' | |||||
], | |||||
// add your custom rules here | |||||
rules: { | |||||
"indent": ["error", "tab"], | |||||
"no-tabs": 0 | |||||
} | |||||
} |
@ -0,0 +1,14 @@ | |||||
# dependencies | |||||
node_modules | |||||
# logs | |||||
npm-debug.log | |||||
# Nuxt build | |||||
.nuxt | |||||
# Nuxt generate | |||||
dist | |||||
# Mac OS | |||||
.DS_Store |
@ -0,0 +1,18 @@ | |||||
# prismediatoid | |||||
> a GUI for prismedia, using Electron. | |||||
## Build Setup | |||||
```bash | |||||
# install dependencies | |||||
$ npm install | |||||
# development with vue devtools | |||||
$ npm run dev | |||||
# build for production (might take some time) | |||||
$ npm run build | |||||
``` | |||||
For detailed explanation on how things work, checkout [Nuxt.js](https://github.com/nuxt/nuxt.js), [Electron.js](https://electronjs.org/), and [electron-builder](https://www.electron.build/). |
@ -0,0 +1,8 @@ | |||||
# ASSETS | |||||
This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/assets#webpacked | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,4 @@ | |||||
:root { | |||||
--primary: #00b786; | |||||
--secondary: #8ceaf6; | |||||
} |
@ -0,0 +1,38 @@ | |||||
@import './color.css'; | |||||
html { | |||||
font-size: 16px; | |||||
word-spacing: 1px; | |||||
-ms-text-size-adjust: 100%; | |||||
-webkit-text-size-adjust: 100%; | |||||
-moz-osx-font-smoothing: grayscale; | |||||
-webkit-font-smoothing: antialiased; | |||||
box-sizing: border-box; | |||||
} | |||||
body { | |||||
font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; | |||||
} | |||||
*, *:before, *:after { | |||||
box-sizing: border-box; | |||||
margin: 0; | |||||
} | |||||
a.btn-primary { | |||||
text-decoration: none; | |||||
background: none; | |||||
} | |||||
.btn, .pointer { | |||||
cursor: pointer; | |||||
} | |||||
.primary { | |||||
color: var(--primary); | |||||
} | |||||
.secondary { | |||||
color: var(--secondary); | |||||
} | |||||
.btn-primary { | |||||
background-color: var(--primary); | |||||
color: #fff; | |||||
} | |||||
.btn-secondary { | |||||
background-color: var(--secondary); | |||||
color: #000; | |||||
} |
@ -0,0 +1,4 @@ | |||||
:root { | |||||
--primary: orange; | |||||
--secondary: #8ceaf6; | |||||
} |
@ -0,0 +1,38 @@ | |||||
@import './color.scss'; | |||||
html { | |||||
font-size: 16px; | |||||
word-spacing: 1px; | |||||
-ms-text-size-adjust: 100%; | |||||
-webkit-text-size-adjust: 100%; | |||||
-moz-osx-font-smoothing: grayscale; | |||||
-webkit-font-smoothing: antialiased; | |||||
box-sizing: border-box; | |||||
} | |||||
body { | |||||
font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; | |||||
} | |||||
*, *:before, *:after { | |||||
box-sizing: border-box; | |||||
margin: 0; | |||||
} | |||||
a.btn-primary { | |||||
text-decoration: none; | |||||
background: none; | |||||
} | |||||
.btn, .pointer { | |||||
cursor: pointer; | |||||
} | |||||
.primary { | |||||
color: var(--primary); | |||||
} | |||||
.secondary { | |||||
color: var(--secondary); | |||||
} | |||||
.btn-primary { | |||||
background-color: var(--primary); | |||||
color: #fff; | |||||
} | |||||
.btn-secondary { | |||||
background-color: var(--secondary); | |||||
color: #000; | |||||
} |
@ -0,0 +1,6 @@ | |||||
# COMPONENTS | |||||
The components directory contains your Vue.js Components. | |||||
Nuxt.js doesn't supercharge these components. | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,8 @@ | |||||
# LAYOUTS | |||||
This directory contains your Application Layouts. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/views#layouts | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,5 @@ | |||||
<template> | |||||
<div> | |||||
<nuxt/> | |||||
</div> | |||||
</template> |
@ -0,0 +1,57 @@ | |||||
/* | |||||
** Nuxt | |||||
*/ | |||||
const http = require('http') | |||||
const { Nuxt, Builder } = require('nuxt') | |||||
let config = require('./nuxt.config.js') | |||||
config.rootDir = __dirname // for electron-builder | |||||
// Init Nuxt.js | |||||
const nuxt = new Nuxt(config) | |||||
const builder = new Builder(nuxt) | |||||
const server = http.createServer(nuxt.render) | |||||
// Build only in dev mode | |||||
if (config.dev) { | |||||
builder.build().catch(err => { | |||||
console.error(err) // eslint-disable-line no-console | |||||
process.exit(1) | |||||
}) | |||||
} | |||||
// Listen the server | |||||
server.listen() | |||||
const _NUXT_URL_ = `http://localhost:${server.address().port}` | |||||
console.log(`Nuxt working on ${_NUXT_URL_}`) | |||||
/* | |||||
** Electron | |||||
*/ | |||||
let win = null // Current window | |||||
const electron = require('electron') | |||||
const path = require('path') | |||||
const app = electron.app | |||||
const newWin = () => { | |||||
win = new electron.BrowserWindow({ | |||||
icon: path.join(__dirname, 'static/icon.png'), | |||||
center: true, | |||||
width: 1024, | |||||
height: 565, | |||||
minWidth: 1024, | |||||
minHeight: 565, | |||||
frame: false | |||||
}) | |||||
win.on('closed', () => win = null) | |||||
if (config.dev) { | |||||
// Install vue dev tool and open chrome dev tools | |||||
const { default: installExtension, VUEJS_DEVTOOLS } = require('electron-devtools-installer') | |||||
installExtension(VUEJS_DEVTOOLS.id).then(name => { | |||||
console.log(`Added Extension: ${name}`) | |||||
win.webContents.openDevTools({ detach: true }) | |||||
}).catch(err => console.log('An error occurred: ', err)) | |||||
// Wait for nuxt to build | |||||
nuxt.hook('build:done', () => { | |||||
win.loadURL(_NUXT_URL_) | |||||
}) | |||||
} else { return win.loadURL(_NUXT_URL_) } | |||||
} | |||||
app.on('ready', newWin) | |||||
app.on('window-all-closed', () => app.quit()) | |||||
app.on('activate', () => win === null && newWin()) |
@ -0,0 +1,9 @@ | |||||
# MIDDLEWARE | |||||
This directory contains your Application Middleware. | |||||
The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts). | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/routing#middleware | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,24 @@ | |||||
module.exports = { | |||||
mode: 'spa', | |||||
head: {title: 'prismediatoid'}, // Headers of the page | |||||
loading: false, // Disable default loading bar | |||||
build: { | |||||
extend (config, { isDev, isClient }) { | |||||
if (isDev && isClient) { | |||||
// Run ESLint on save | |||||
config.module.rules.push({ | |||||
enforce: 'pre', | |||||
test: /\.(js|vue)$/, | |||||
loader: 'eslint-loader', | |||||
exclude: /(node_modules)/ | |||||
}) | |||||
} | |||||
// Extend only webpack config for client-bundle | |||||
if (isClient) { config.target = 'electron-renderer' } | |||||
} | |||||
}, | |||||
dev: process.env.NODE_ENV === 'DEV', | |||||
css: [ | |||||
'@/assets/css/global.css' | |||||
] | |||||
} |
@ -0,0 +1,41 @@ | |||||
{ | |||||
"name": "prismediatoid", | |||||
"version": "0.6.2", | |||||
"description": "a GUI for prismedia, using Electron.", | |||||
"homepage": "https://git.lecygnenoir.info/rigelk/prismediatoid", | |||||
"author": "Rigel Kent <sendmemail@rigelk.eu>", | |||||
"private": true, | |||||
"main": "main.js", | |||||
"build": { | |||||
"appId": "org.framasoft.org", | |||||
"directories": { | |||||
"buildResources": "static" | |||||
}, | |||||
"linux": { | |||||
"target": [ | |||||
"deb", | |||||
"AppImage" | |||||
], | |||||
"category": "Network" | |||||
} | |||||
}, | |||||
"scripts": { | |||||
"dev": "cross-env NODE_ENV=DEV electron .", | |||||
"build": "nuxt build && electron-builder" | |||||
}, | |||||
"dependencies": { | |||||
"nuxt": "^2.4.3" | |||||
}, | |||||
"devDependencies": { | |||||
"babel-eslint": "^10.0.1", | |||||
"cross-env": "^5.1.4", | |||||
"electron": "^4.0.5", | |||||
"electron-builder": "^20.38.5", | |||||
"electron-devtools-installer": "^2.2.3", | |||||
"eslint": "^5.14.0", | |||||
"eslint-friendly-formatter": "^4.0.1", | |||||
"eslint-loader": "^2.1.2", | |||||
"eslint-plugin-vue": "^5.2.2", | |||||
"vue-loader": "^15.6.2" | |||||
} | |||||
} |
@ -0,0 +1,7 @@ | |||||
# PAGES | |||||
This directory contains your Application Views and Routes. | |||||
The framework reads all the .vue files inside this directory and creates the router of your application. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/routing |
@ -0,0 +1,32 @@ | |||||
<template> | |||||
<section class="container"> | |||||
<div> | |||||
<h2>Your friendly uploader to PeerTube and other platforms.</h2> | |||||
login on your instance or <a href="https://instances.joinpeertube.org/" target="_blank" class="btn btn-primary">register on one first</a>. | |||||
</div> | |||||
</section> | |||||
</template> | |||||
<script> | |||||
export default { | |||||
} | |||||
</script> | |||||
<style scoped> | |||||
:root { | |||||
color: white; | |||||
} | |||||
a { | |||||
color: orange; | |||||
} | |||||
.container { | |||||
min-height: 100vh; | |||||
display: flex; | |||||
justify-content: center; | |||||
align-items: center; | |||||
text-align: center; | |||||
} | |||||
.btn { | |||||
margin: 0 8px; | |||||
} | |||||
</style> |
@ -0,0 +1,8 @@ | |||||
# PLUGINS | |||||
This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/plugins | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,11 @@ | |||||
# STATIC | |||||
This directory contains your static files. | |||||
Each file inside this directory is mapped to /. | |||||
Example: /static/robots.txt is mapped as /robots.txt. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/assets#static | |||||
**This directory is not required, you can delete it if you don't want to use it.** |
@ -0,0 +1,10 @@ | |||||
# STORE | |||||
This directory contains your Vuex Store files. | |||||
Vuex Store option is implemented in the Nuxt.js framework. | |||||
Creating a index.js file in this directory activate the option in the framework automatically. | |||||
More information about the usage of this directory in the documentation: | |||||
https://nuxtjs.org/guide/vuex-store | |||||
**This directory is not required, you can delete it if you don't want to use it.** |