Skip to content

Commit

Permalink
1.20 Refactor
Browse files Browse the repository at this point in the history
* WIP refactor

* Remove redundancy

* Versioning fixes

* More locales. More refactor fixes

* Semi working state

* Better semi working state

* better menu management

* Frameless windows

* Close buttons on frameless

* Vary provision calls if box is up or not

* State typo fix

* Tests

* More refactor

* Language pack update

* Language & reset options now work in settings

* Tweak documentation
  • Loading branch information
absalomedia authored Jan 17, 2018
1 parent 82cdd98 commit fe4919d
Show file tree
Hide file tree
Showing 64 changed files with 5,656 additions and 825 deletions.
14 changes: 14 additions & 0 deletions .bithoundrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"critics": {
"lint": {"engine": "standard"}
},
"dependencies": {
"unused-ignores": [
"jquery",
"shell-path",
"shelljs",
"i18next-node-fs-backend",
"i18next"
]
}
}
33 changes: 4 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,30 +1,5 @@
.DS_Store
.tags*
/assets/logo/VMLogoGif/
/.idea/
/dist/
/external_binaries/
/out/
/vendor/brightray/vendor/download/
/vendor/debian_wheezy_amd64-sysroot/
/vendor/debian_wheezy_arm-sysroot/
/vendor/debian_wheezy_i386-sysroot/
/vendor/python_26/
/vendor/npm/
/vendor/llvm/
/vendor/llvm-build/
/vendor/.gclient
node_modules/
*.xcodeproj
*.swp
*.pyc
*.VC.db
*.VC.VC.opendb
.vs/
.vscode/
*.vcxproj
*.vcxproj.user
*.vcxproj.filters
*.sln
debug.log
node_modules
npm-debug.log
.DS_Store
dist
coverage
56 changes: 15 additions & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
matrix:
include:
- os: osx
osx_image: xcode9.0
language: node_js
node_js: "8"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
language: node_js

- os: linux
services: docker
language: generic
os:
- linux
- osx

node_js: "7.9.0"

cache:
directories:
- node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder

before_install:
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
export PATH="/tmp/git-lfs:$PATH"
fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update && sudo apt-get install -q libxss-dev; fi

before_script:
- git lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export DISPLAY=:99.0 && sh -e /etc/init.d/xvfb start && sleep 3; fi

script:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
docker run --rm \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_') \
-v ${PWD}:/project \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "yarn --link-duplicates --pure-lockfile && yarn dist --linux --win"
else
yarn dist
fi
- npm install -g istanbul
- istanbul cover ./node_modules/mocha/bin/_mocha

before_cache:
- rm -rf $HOME/.cache/electron-builder/wine
notifications:
on_success: change
email:
on_success: never
on_failure: never
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"
after_success:
- bash <(curl -s https://codecov.io/bash)
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug renderer process",
"type": "chrome",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron.cmd",
"runtimeArgs": [
"${workspaceRoot}/",
"--enable-logging",
"--remote-debugging-port=9222"
],
"webRoot": "${workspaceRoot}/",
"sourceMaps": true,
"internalConsoleOptions": "openOnSessionStart"
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place your settings in this file to overwrite default and user settings.
{
}
9 changes: 9 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "echo",
"isShellCommand": true,
"args": ["Hello World"],
"showOutput": "always"
}
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Contributing to *vagrant-manaager*

## Pull Requests
PRs are welcome, but before implementing a feature, please open an Issue first, so we can be sure that no-one else is working on it and that the changes will be accepted.

Other thinks to keep in mind:
- write tests if possible
- add yourself to [README](https://github.com/absalomedia/vagrant-manager#contributors)
- add your changes to [CHANGELOG](https://github.com/absalomedia/vagrant-managerblob/master/CHANGELOG.md)
- do not edit version number
- keep the [code style](http://standardjs.com/)
- edit screenshots in [README](https://github.com/hovancik/stretchly/blob/master/README.md) if needed
- be nice and have fun ;]

Thanks for your interest in making *vagrat-manager* better!
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<h1 align="center">
<img src="/assets/images/logo.gif" alt="Vagrant Manager" width="400px">
<img src="/app//assets/images/logo.gif" alt="Vagrant Manager" width="400px">
<br>
Vagrant Manager
</h1>

Vagrant Manager is an status bar menu app that lets you manage all of your vagrant machines from one central location.
Vagrant Manager is a status bar menu app that lets you manage all of your vagrant machines from one central location. It covers multiple languages and plugin management.

A menubar/taskbar App based on <a href="http://electron.atom.io" target="_blank">Electron</a>.

[![Build Status](https://travis-ci.org/absalomedia/vagrant-manager.svg?branch=master)](https://travis-ci.org/absalomedia/vagrant-manager) [![Build status](https://ci.appveyor.com/api/projects/status/1ju13idwcwthuvpf/branch/master?svg=true)](https://ci.appveyor.com/project/absalomedia/vagrant-manager/branch/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a6e3bb668722444d8a6bf8bf5af44b53)](https://www.codacy.com/app/media/vagrant-manager?utm_source=github.com&utm_medium=referral&utm_content=absalomedia/vagrant-manager&utm_campaign=badger)
<h1 align="center">
<img src="/assets/images/demo.gif" alt="Vagrant Manager Demo">
<img src="/app/assets/images/demo.gif" alt="Vagrant Manager Demo">
</h1>

## Download
Expand Down
10 changes: 6 additions & 4 deletions about.html → app/about.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<script>require('jquery')</script>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<link rel="stylesheet" href="assets/css/style.css">

<title data-i18next="main.aboutVM"></title>
</head>
<body>
<video poster="assets/images/background.jpg" class="fillWidth" id="bgvid" playsinline autoplay muted loop>
<source src="assets/videos/background.mp4" type="video/mp4">
</video>
<div class="col-xs-12 about">
<button type="button" class="close" aria-label="Close" id="close-btn">
<span aria-hidden="true">&times;</span>
</button>
<div class="col-lg-12">
<img src="assets/logo/windowIcon.png" class="img-responsive">
</div>
<div class="col-xs-12 text-center">
<h4>Vagrant Manager</h4>
<small>V 1.2</small>
<h4 data-i18next="about.vm"></h4>
<small data-i18next="main.version"></small>
</div>

<div class="col-xs-12 text-center content">
Expand Down
60 changes: 60 additions & 0 deletions app/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const {shell, ipcRenderer, remote} = require('electron')
const VersionChecker = require('./utils/versionChecker')
const HtmlTranslate = require('./utils/htmlTranslate')

document.addEventListener('DOMContentLoaded', event => {
new HtmlTranslate(document).translate()
})

document.addEventListener('dragover', event => event.preventDefault())
document.addEventListener('drop', event => event.preventDefault())

document.getElementById('close').addEventListener('click', function (e) {
e.preventDefault()
var window = remote.getCurrentWindow();
window.close();
})


document.getElementById('homepage').addEventListener('click', function (e) {
e.preventDefault()
shell.openExternal('https://github.com/absalomedia/vagrant-manager')
})

const updateElement = document.getElementById('update')

updateElement.addEventListener('click', function (e) {
e.preventDefault()
shell.openExternal('https://github.com/absalomedia/vagrant-manager/releases')
})

new VersionChecker()
.latest()
.then(version => {
updateElement.innerHTML = version
})
.catch(exception => {
console.error(exception)
updateElement.innerHTML = 'Error getting latest version'
})

window.addEventListener('keydown', event => {
if (event.key === 'd' && (event.ctrlKey || event.metaKey)) {
ipcRenderer.send('show-debug')
}
})

ipcRenderer.on('debugInfo', (event, reference, timeleft, settingsfile) => {
let visible = document.getElementsByClassName('debug')[0].style.visibility === 'visible'
if (visible) {
document.getElementsByClassName('debug')[0].style.visibility = 'hidden'
} else {
document.getElementsByClassName('debug')[0].style.visibility = 'visible'
let referenceElement = document.getElementById('reference')
referenceElement.innerHTML = reference
let timeleftElement = document.getElementById('timeleft')
timeleftElement.innerHTML = timeleft
let settingsfileElement = document.getElementById('settingsfile')
settingsfileElement.innerHTML = settingsfile
}
})
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions assets/css/style.css → app/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ small{
}
.btn{
border: 0;
}
button {
color: #fff;
border: none;
outline: none;
}
button:hover {
cursor: pointer;
opacity: 0.8;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
42 changes: 42 additions & 0 deletions app/locales/cs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"main": {
"header": "Vagrant Manager",
"version": "V {{version}}",
"downloadLatest": "Stáhnout nejnovější verzi",
"about": "O",
"aboutVM": "O | Vagrant Manager",
"settings": "Nastavení",
"quit": "Přestat",
"startAtLogin": "Automatické spuštění",
"resetToDefaults": "Obnovit výchozí nastavení",
"areYouSure": "Jsi si jistá?",
"yes": "Ano",
"no": "Ne",
"up": "Nahoru",
"refresh": "Obnovit",
"provision": "Ustanovení",
"suspend": "Pozastavit",
"resume": "Životopis",
"halt": "Stůj",
"destroy": "Zničit",
"update": "Aktualizace pluginů",
"repair": "Oprava pluginů",
"box": "Krabice",
"provider": "Poskytovatel",
"status": "Postavení"
},
"about": {
"vm": "Vagrant Manager",
"vmApp": "Spravujte své vaganty",
"latestVersion": "poslední verze:",
"checking": "kontrola ..."
},
"settings": {
"settings": "Nastavení",
"language": "Jazyk",
"resetToDefaults": "Obnovit výchozí nastavení"
},
"process": {
"newVersion": "Nová verze je k dispozici!"
}
}
42 changes: 42 additions & 0 deletions app/locales/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"main": {
"header": "Vagrant Manager",
"version": "V {{version}}",
"downloadLatest":"Lade die letzte Version herunter",
"about": "Über",
"aboutVM": "Über | Vagrant Manager",
"settings": "Die Einstellungen",
"quit": "Verlassen",
"startAtLogin": "Automatischer Start",
"resetToDefaults": "Auf Standardeinstellung zurücksetzen",
"areYouSure": "Bist du sicher?",
"yes": "Ja",
"no": "Nein",
"up": "Oben",
"refresh": "Aktualisierung",
"provision": "Bereitstellung",
"suspend": "Aussetzen",
"resume": "Fortsetzen",
"halt": "Halt",
"destroy": "Zerstören",
"update": "Plugin-Aktualisierung",
"repair": "Plugin Reparatur",
"box": "Kasten",
"provider": "Anbieter",
"status": "Status"
},
"about": {
"vm": "Vagrant Manager",
"vmApp": "Verwalte deine Landstreicher",
"latestVersion": "Die neueste version:",
"checking": "Überprüfung..."
},
"settings": {
"settings": "Die Einstellungen",
"language": "Sprache",
"resetToDefaults": "Auf Standardeinstellung zurücksetzen"
},
"process": {
"newVersion": "Neue Version ist verfügbar!"
}
}
Loading

0 comments on commit fe4919d

Please sign in to comment.