Browse Source

initial commit, with working template app

Romain Kerguelen 1 year ago
commit
80a677e0e4
Signed by: Rigel Kent <sendmemail@rigelk.eu> GPG Key ID: EA12971B0E438F36

+ 24
- 0
.eslintrc.js View File

@@ -0,0 +1,24 @@
1
+module.exports = {
2
+  root: true,
3
+  env: {
4
+    browser: true,
5
+    node: true
6
+  },
7
+  parserOptions: {
8
+    parser: 'babel-eslint'
9
+  },
10
+  extends: [
11
+    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12
+    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
13
+    'plugin:vue/essential'
14
+  ],
15
+  // required to lint *.vue files
16
+  plugins: [
17
+    'vue'
18
+  ],
19
+  // add your custom rules here
20
+  rules: {
21
+	"indent": ["error", "tab"],
22
+  	"no-tabs": 0
23
+  }
24
+}

+ 14
- 0
.gitignore View File

@@ -0,0 +1,14 @@
1
+# dependencies
2
+node_modules
3
+
4
+# logs
5
+npm-debug.log
6
+
7
+# Nuxt build
8
+.nuxt
9
+
10
+# Nuxt generate
11
+dist
12
+
13
+# Mac OS
14
+.DS_Store

+ 18
- 0
README.md View File

@@ -0,0 +1,18 @@
1
+# prismediatoid
2
+
3
+> a GUI for prismedia, using Electron.
4
+
5
+## Build Setup
6
+
7
+```bash
8
+# install dependencies
9
+$ npm install
10
+
11
+# development with vue devtools
12
+$ npm run dev
13
+
14
+# build for production (might take some time)
15
+$ npm run build
16
+```
17
+
18
+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/).

+ 8
- 0
assets/README.md View File

@@ -0,0 +1,8 @@
1
+# ASSETS
2
+
3
+This directory contains your un-compiled assets such as LESS, SASS, or JavaScript.
4
+
5
+More information about the usage of this directory in the documentation:
6
+https://nuxtjs.org/guide/assets#webpacked
7
+
8
+**This directory is not required, you can delete it if you don't want to use it.**

+ 4
- 0
assets/css/color.css View File

@@ -0,0 +1,4 @@
1
+:root {
2
+	--primary: #00b786;
3
+	--secondary: #8ceaf6;
4
+}

+ 38
- 0
assets/css/global.css View File

@@ -0,0 +1,38 @@
1
+@import './color.css';
2
+html {
3
+	font-size: 16px;
4
+	word-spacing: 1px;
5
+	-ms-text-size-adjust: 100%;
6
+	-webkit-text-size-adjust: 100%;
7
+	-moz-osx-font-smoothing: grayscale;
8
+	-webkit-font-smoothing: antialiased;
9
+	box-sizing: border-box;
10
+}
11
+body {
12
+	font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
13
+}
14
+*, *:before, *:after {
15
+	box-sizing: border-box;
16
+	margin: 0;
17
+}
18
+a.btn-primary {
19
+	text-decoration: none;
20
+	background: none;
21
+}
22
+.btn, .pointer {
23
+	cursor: pointer;
24
+}
25
+.primary {
26
+	color: var(--primary);
27
+}
28
+.secondary {
29
+	color: var(--secondary);
30
+}
31
+.btn-primary {
32
+	background-color: var(--primary);
33
+	color: #fff;
34
+}
35
+.btn-secondary {
36
+	background-color: var(--secondary);
37
+	color: #000;
38
+}

BIN
assets/img/logo.png View File


+ 4
- 0
assets/scss/color.scss View File

@@ -0,0 +1,4 @@
1
+:root {
2
+	--primary: orange;
3
+	--secondary: #8ceaf6;
4
+}

+ 38
- 0
assets/scss/global.scss View File

@@ -0,0 +1,38 @@
1
+@import './color.scss';
2
+html {
3
+	font-size: 16px;
4
+	word-spacing: 1px;
5
+	-ms-text-size-adjust: 100%;
6
+	-webkit-text-size-adjust: 100%;
7
+	-moz-osx-font-smoothing: grayscale;
8
+	-webkit-font-smoothing: antialiased;
9
+	box-sizing: border-box;
10
+}
11
+body {
12
+	font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
13
+}
14
+*, *:before, *:after {
15
+	box-sizing: border-box;
16
+	margin: 0;
17
+}
18
+a.btn-primary {
19
+	text-decoration: none;
20
+	background: none;
21
+}
22
+.btn, .pointer {
23
+	cursor: pointer;
24
+}
25
+.primary {
26
+	color: var(--primary);
27
+}
28
+.secondary {
29
+	color: var(--secondary);
30
+}
31
+.btn-primary {
32
+	background-color: var(--primary);
33
+	color: #fff;
34
+}
35
+.btn-secondary {
36
+	background-color: var(--secondary);
37
+	color: #000;
38
+}

+ 6
- 0
components/README.md View File

@@ -0,0 +1,6 @@
1
+# COMPONENTS
2
+
3
+The components directory contains your Vue.js Components.
4
+Nuxt.js doesn't supercharge these components.
5
+
6
+**This directory is not required, you can delete it if you don't want to use it.**

+ 8
- 0
layouts/README.md View File

@@ -0,0 +1,8 @@
1
+# LAYOUTS
2
+
3
+This directory contains your Application Layouts.
4
+
5
+More information about the usage of this directory in the documentation:
6
+https://nuxtjs.org/guide/views#layouts
7
+
8
+**This directory is not required, you can delete it if you don't want to use it.**

+ 5
- 0
layouts/default.vue View File

@@ -0,0 +1,5 @@
1
+<template>
2
+	<div>
3
+		<nuxt/>
4
+	</div>
5
+</template>

+ 57
- 0
main.js View File

@@ -0,0 +1,57 @@
1
+/*
2
+**  Nuxt
3
+*/
4
+const http = require('http')
5
+const { Nuxt, Builder } = require('nuxt')
6
+let config = require('./nuxt.config.js')
7
+config.rootDir = __dirname // for electron-builder
8
+// Init Nuxt.js
9
+const nuxt = new Nuxt(config)
10
+const builder = new Builder(nuxt)
11
+const server = http.createServer(nuxt.render)
12
+// Build only in dev mode
13
+if (config.dev) {
14
+	builder.build().catch(err => {
15
+		console.error(err) // eslint-disable-line no-console
16
+		process.exit(1)
17
+	})
18
+}
19
+// Listen the server
20
+server.listen()
21
+const _NUXT_URL_ = `http://localhost:${server.address().port}`
22
+console.log(`Nuxt working on ${_NUXT_URL_}`)
23
+
24
+/*
25
+** Electron
26
+*/
27
+let win = null // Current window
28
+const electron = require('electron')
29
+const path = require('path')
30
+const app = electron.app
31
+const newWin = () => {
32
+	win = new electron.BrowserWindow({
33
+		icon: path.join(__dirname, 'static/icon.png'),
34
+    center: true,
35
+    width: 1024,
36
+    height: 565,
37
+    minWidth: 1024,
38
+    minHeight: 565,
39
+    frame: false
40
+	})
41
+	win.on('closed', () => win = null)
42
+	if (config.dev) {
43
+		// Install vue dev tool and open chrome dev tools
44
+		const { default: installExtension, VUEJS_DEVTOOLS } = require('electron-devtools-installer')
45
+		installExtension(VUEJS_DEVTOOLS.id).then(name => {
46
+			console.log(`Added Extension:  ${name}`)
47
+			win.webContents.openDevTools({ detach: true })
48
+		}).catch(err => console.log('An error occurred: ', err))
49
+		// Wait for nuxt to build
50
+    nuxt.hook('build:done', () => {
51
+    	win.loadURL(_NUXT_URL_) 
52
+  	})
53
+	} else { return win.loadURL(_NUXT_URL_) }
54
+}
55
+app.on('ready', newWin)
56
+app.on('window-all-closed', () => app.quit())
57
+app.on('activate', () => win === null && newWin())

+ 9
- 0
middleware/README.md View File

@@ -0,0 +1,9 @@
1
+# MIDDLEWARE
2
+
3
+This directory contains your Application Middleware.
4
+The middleware lets you define custom function to be ran before rendering a page or a group of pages (layouts).
5
+
6
+More information about the usage of this directory in the documentation:
7
+https://nuxtjs.org/guide/routing#middleware
8
+
9
+**This directory is not required, you can delete it if you don't want to use it.**

+ 24
- 0
nuxt.config.js View File

@@ -0,0 +1,24 @@
1
+module.exports = {
2
+	mode: 'spa',
3
+	head: {title: 'prismediatoid'}, // Headers of the page
4
+	loading: false, // Disable default loading bar
5
+	build: {
6
+		extend (config, { isDev, isClient }) {
7
+			if (isDev && isClient) {
8
+				// Run ESLint on save
9
+				config.module.rules.push({
10
+					enforce: 'pre',
11
+					test: /\.(js|vue)$/,
12
+					loader: 'eslint-loader',
13
+					exclude: /(node_modules)/
14
+				})
15
+			}
16
+			// Extend only webpack config for client-bundle
17
+			if (isClient) { config.target = 'electron-renderer' }
18
+		}
19
+	},
20
+	dev: process.env.NODE_ENV === 'DEV',
21
+	css: [
22
+		'@/assets/css/global.css'
23
+	]
24
+}

+ 10530
- 0
package-lock.json
File diff suppressed because it is too large
View File


+ 41
- 0
package.json View File

@@ -0,0 +1,41 @@
1
+{
2
+  "name": "prismediatoid",
3
+  "version": "0.6.2",
4
+  "description": "a GUI for prismedia, using Electron.",
5
+  "homepage": "https://git.lecygnenoir.info/rigelk/prismediatoid",
6
+  "author": "Rigel Kent <sendmemail@rigelk.eu>",
7
+  "private": true,
8
+  "main": "main.js",
9
+  "build": {
10
+    "appId": "org.framasoft.org",
11
+    "directories": {
12
+      "buildResources": "static"
13
+    },
14
+    "linux": {
15
+      "target": [
16
+        "deb",
17
+        "AppImage"
18
+      ],
19
+      "category": "Network"
20
+    }
21
+  },
22
+  "scripts": {
23
+    "dev": "cross-env NODE_ENV=DEV electron .",
24
+    "build": "nuxt build && electron-builder"
25
+  },
26
+  "dependencies": {
27
+    "nuxt": "^2.4.3"
28
+  },
29
+  "devDependencies": {
30
+    "babel-eslint": "^10.0.1",
31
+    "cross-env": "^5.1.4",
32
+    "electron": "^4.0.5",
33
+    "electron-builder": "^20.38.5",
34
+    "electron-devtools-installer": "^2.2.3",
35
+    "eslint": "^5.14.0",
36
+    "eslint-friendly-formatter": "^4.0.1",
37
+    "eslint-loader": "^2.1.2",
38
+    "eslint-plugin-vue": "^5.2.2",
39
+    "vue-loader": "^15.6.2"
40
+  }
41
+}

+ 7
- 0
pages/README.md View File

@@ -0,0 +1,7 @@
1
+# PAGES
2
+
3
+This directory contains your Application Views and Routes.
4
+The framework reads all the .vue files inside this directory and creates the router of your application.
5
+
6
+More information about the usage of this directory in the documentation:
7
+https://nuxtjs.org/guide/routing

+ 32
- 0
pages/index.vue View File

@@ -0,0 +1,32 @@
1
+<template>
2
+	<section class="container">
3
+		<div>
4
+			<h2>Your friendly uploader to PeerTube and other platforms.</h2>
5
+			login on your instance or <a href="https://instances.joinpeertube.org/" target="_blank" class="btn btn-primary">register on one first</a>.
6
+		</div>
7
+	</section>
8
+</template>
9
+
10
+<script>
11
+export default {
12
+}
13
+</script>
14
+
15
+<style scoped>
16
+:root {
17
+  color: white;
18
+}
19
+a {
20
+  color: orange;
21
+}
22
+.container {
23
+	min-height: 100vh;
24
+	display: flex;
25
+	justify-content: center;
26
+	align-items: center;
27
+	text-align: center;
28
+}
29
+.btn {
30
+	margin: 0 8px;
31
+}
32
+</style>

+ 8
- 0
plugins/README.md View File

@@ -0,0 +1,8 @@
1
+# PLUGINS
2
+
3
+This directory contains your Javascript plugins that you want to run before instantiating the root vue.js application.
4
+
5
+More information about the usage of this directory in the documentation:
6
+https://nuxtjs.org/guide/plugins
7
+
8
+**This directory is not required, you can delete it if you don't want to use it.**

+ 11
- 0
static/README.md View File

@@ -0,0 +1,11 @@
1
+# STATIC
2
+
3
+This directory contains your static files.
4
+Each file inside this directory is mapped to /.
5
+
6
+Example: /static/robots.txt is mapped as /robots.txt.
7
+
8
+More information about the usage of this directory in the documentation:
9
+https://nuxtjs.org/guide/assets#static
10
+
11
+**This directory is not required, you can delete it if you don't want to use it.**

BIN
static/icon.png View File


BIN
static/icons/512x512.png View File


+ 10
- 0
store/README.md View File

@@ -0,0 +1,10 @@
1
+# STORE
2
+
3
+This directory contains your Vuex Store files.
4
+Vuex Store option is implemented in the Nuxt.js framework.
5
+Creating a index.js file in this directory activate the option in the framework automatically.
6
+
7
+More information about the usage of this directory in the documentation:
8
+https://nuxtjs.org/guide/vuex-store
9
+
10
+**This directory is not required, you can delete it if you don't want to use it.**

Loading…
Cancel
Save