Skip to content

Commit

Permalink
upgrade to v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
willswire committed Mar 4, 2019
1 parent 9fe7d47 commit 9bd23ef
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 28 deletions.
22 changes: 15 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

All entries are made manually. This project adheres to [Semantic Versioning](http://semver.org/).

## 2.0.1 - 2019-3-3

- Rename containers [Will Walker]
- Clean up electron scripts [Will Walker]

## 2.0.0 - 2019-2-24
- Introduces support for devices other than amd64 by replacing FROM
arch line with %%BALENA_MACHINE_NAME%% [Will Walker]

- Introduces support for devices other than amd64 by replacing FROM
arch line with %%BALENA_MACHINE_NAME%% [Will Walker]

## 1.0.1 - 2019-1-28
- Extended stability for x11vnc using -find flag [Will Walker]
- Create function for infinite looping [CJ Lambert & Will Walker]

- Extended stability for x11vnc using -find flag [Will Walker]
- Create function for infinite looping [CJ Lambert & Will Walker]

## 1.0.0 - 2019-1-10
- Initial commit for all code. Basing off of multi-container image used for
timestations. Starting with Debian Buster due to expected release date by
end of semester. [Will Walker]

- Initial commit for all code. Basing off of multi-container image used for
timestations. Starting with Debian Buster due to expected release date by
end of semester. [Will Walker]
File renamed without changes.
31 changes: 16 additions & 15 deletions electron/app/main.js → dashboard/app/main.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
// Declare constants required for ElectronJS to run properly
console.log('Starting Dashboard...');
const electron = require('electron');
const {
app,
BrowserWindow
BrowserWindow,
globalShortcut
} = electron;

let mainWindow;
const TIMEOUT = process.env.TIMEOUT.split(',');
console.log("After storing the env variable: " + TIMEOUT);
const SLIDE_URLS = process.env.SLIDE_URLS.split(' ');
var currentSlide = 0;
var currentTime = 0;
var currentTimeout = 0;
var screenDimensions;

// Slide changing Function
var slideChanger = function () {
// Slide Function
function slideChanger() {
mainWindow.loadURL(SLIDE_URLS[currentSlide % SLIDE_URLS.length]);
mainWindow.webContents.on('did-finish-load', function () {
mainWindow.webContents.insertCSS('html,body{ height: 100vh !important; }')
});
currentTimeout = parseInt(TIMEOUT[currentTime % TIMEOUT.length]) * 1000;
currentSlide++;
currentTime++;
setTimeout(slideChanger, currentTimeout);
}

function prepareScreen() {
var screenElectron = electron.screen;
var mainScreen = screenElectron.getPrimaryDisplay();
screenDimensions = mainScreen.size;
}

// Main Function
app.on('ready', () => {

var screenElectron = electron.screen;
var mainScreen = screenElectron.getPrimaryDisplay();
var dimensions = mainScreen.size;
console.log("The screen dimensions are: " + dimensions.width + "x" + dimensions.height);
prepareScreen();

mainWindow = new BrowserWindow({
width: dimensions.width,
height: dimensions.height,
width: screenDimensions.width,
height: screenDimensions.height,
frame: false,
kiosk: true,
webPreferences: {
Expand All @@ -50,6 +51,6 @@ app.on('ready', () => {
console.log(err);
});

setTimeout(slideChanger, currentTimeout);
slideChanger();

});
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '2'
services:
electron:
build: electron
dashboard:
build: dashboard
ports:
- "5900"
network_mode: host
privileged: true
restart: always
vnc:
build: vnc
remote:
build: remote
ports:
- "80"
network_mode: host
Expand Down
4 changes: 2 additions & 2 deletions vnc/Dockerfile.template → remote/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ FROM balenalib/%%BALENA_MACHINE_NAME%%-alpine-python

# Update software packages
RUN install_packages \
git \
iptables \
procps
procps \
git

# Pull down noVNC
RUN git clone https://github.com/novnc/noVNC
Expand Down
File renamed without changes.

0 comments on commit 9bd23ef

Please sign in to comment.