Skip to content

Commit

Permalink
release: v1.2.0
Browse files Browse the repository at this point in the history
initial release
  • Loading branch information
vervallsweg authored May 30, 2019
2 parents 59705a1 + f497fd4 commit c116e2e
Show file tree
Hide file tree
Showing 34 changed files with 3,693 additions and 5,935 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ typings/
.next

.idea
.iml
.iml

dist
49 changes: 49 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
env:
global:
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

matrix:
include:
- os: osx
osx_image: xcode9.4
language: node_js
node_js: "10"
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

- os: linux
services: docker
language: generic
env:
- ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true

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

script:
- |
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
docker run --rm \
--env-file <(env | grep -vE '\r|\n' | 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 "ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true yarn --link-duplicates --pure-lockfile && \
ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true yarn release --linux --ia32 --x64 --armv7l && \
ELECTRON_BUILDER_ALLOW_UNRESOLVED_DEPENDENCIES=true yarn release --win"
else
yarn release
fi
before_cache:
- rm -rf $HOME/.cache/electron-builder/wine

branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# cast-web-api-desktop
![GitHub release](https://img.shields.io/github/release/vervallsweg/cast-web-api-desktop.svg)
![GitHub release beta](https://img.shields.io/github/release-pre/vervallsweg/cast-web-api-desktop.svg?label=beta)
![Travis (.org)](https://img.shields.io/travis/vervallsweg/cast-web-api-desktop.svg)
![GitHub](https://img.shields.io/github/license/vervallsweg/cast-web-api-desktop.svg)

Desktop application for [cast-web-api](https://github.com/vervallsweg/cast-web-api).

## Installation
Download the latest version for your operating system [here](https://github.com/vervallsweg/cast-web-api-desktop/releases) and follow the install instructions on screen.

![screenshot](img/screenshot-on.png)
12 changes: 12 additions & 0 deletions background/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Background</title>
</head>
<body>
<script>
require('./renderer.js');
</script>
</body>
</html>
60 changes: 60 additions & 0 deletions background/renderer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
const { ipcRenderer } = require('electron');
const fs = require('fs');
const path = require('path');
const { Console } = require('console');

let api;
let logger;

console.log('let-api');

window.onerror = (error, url, line) => {
console.error(error);
setTimeout(()=>{ipcRenderer.send('api-error', error)}, 1000)
};

// window. TODO: investigate window api, maybe to reroute stdout/err more reliably

ipcRenderer.on('did-finish-load', (event, init) => {
hookConsole(init.logsDir);
try {
api = require('cast-web-api/api');

ipcRenderer.send('api-logPath', {
logPath: logger.logPath
});
} catch (e) {
ipcRenderer.send('api-error', e);
}
});

function hookConsole(logsDir) {
let logPath = path.join(logsDir, Date.now()+".log" ).normalize();
let logStream = fs.createWriteStream(logPath);
let readStream = fs.createReadStream(logPath);

logger = new Console(logStream, logStream);
logger.readStream = readStream;
logger.logPath = logPath;

console.log = logger.log;
console.error = logger.error;

logger.readStream.on('data', checkForAddress);

module.exports = {console};
}

function checkForAddress(data) {
if (data.includes('running at http://')) {
let address = 'http://'+(data.toString().split('http://'))[1].trim();
console.info('address: ' + address);
ipcRenderer.send('api-address', {
address: address,
logPath: logger.logPath
});
logger.readStream.removeListener('data', checkForAddress);
logger.readStream.destroy();
delete logger.readStream;
}
}
Binary file added build/icon.icns
Binary file not shown.
Binary file added build/icon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog
## v1.2.0
- Release
12 changes: 12 additions & 0 deletions css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,16 @@
top: 3.9em;
left: 3.8em;
opacity: 0.9;
}

#bottom-menu-right {
position: fixed;
bottom: 2em;
right: 2em;
}

#bottom-menu-left {
position: fixed;
bottom: 2em;
left: 2em;
}
47 changes: 30 additions & 17 deletions home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
<head>
<script>
const pkg = require('../package.json');
window.nodeRequire = require;
delete window.require;
delete window.exports;
Expand Down Expand Up @@ -31,9 +32,19 @@
<img class="status-img" src="https://github.com/vervallsweg/smartthings/raw/master/icn/ic-cast-web-api-gray-1200.png">
</div>
<div class="ten wide column">
<h2>cast-web-api <span id="version">v1.2.0</span></h2>
<h3 id="status">status</h3>
<h3 id="address">address</h3>
<h2>cast-web-api <span id="version"><script>document.write(pkg.version);</script></span></h2>
<h3 id="status">offline</h3>
<h3 id="address">-</h3>
<div class="ui popup">
<button class="ui right basic icon button" id="address-copy">
<i class="copy outline icon"></i>
Copy
</button>
<button class="ui right basic icon button" id="address-open">
<i class="external alternate icon"></i>
Open
</button>
</div>
</div>
</div>
</div>
Expand All @@ -45,12 +56,8 @@ <h3 id="address">address</h3>
<div class="eight wide column">
<div id="start" class="fluid ui button">start</div>
<!--autostart-->
<div class="ui fluid floating right labeled icon dropdown button">
autostart <i class="dropdown icon"></i>
<div class="menu">
<div id="autostart" class="item fluid ui button">enable</div>
<div id="unautostart" class="item fluid ui button">disable</div>
</div>
<div id="autostart" class="ui fluid floating right labeled icon button">
autostart <i class="close icon"></i>
</div>
</div>
<div class="eight wide column">
Expand All @@ -59,8 +66,9 @@ <h3 id="address">address</h3>
<div class="ui fluid floating right labeled icon dropdown button">
debugging <i class="dropdown icon"></i>
<div class="menu">
<div id="fix-perm" class="item fluid ui button">fix permissions</div>
<div id="open-logs" class="item fluid ui button">open logs</div>
<div id="config-dir" class="item fluid ui button">open config folder</div>
<div id="open-logs" class="item fluid ui button">open current logs</div>
<div id="logs-dir" class="item fluid ui button">open logs folder</div>
<div id="swagger" class="item fluid ui button">swagger ui</div>
</div>
</div>
Expand All @@ -69,7 +77,11 @@ <h3 id="address">address</h3>
</div>
</div>
</div>
<div id="bottom-menu" style="position: fixed; bottom: 2em; right: 2em;">
<div id="bottom-menu-left">
<div id="help" class="circular ui icon button"><i class="question icon"></i></div>
<div id="donate" class="circular ui icon button"><i class="icon paypal"></i></div>
</div>
<div id="bottom-menu-right" style="position: fixed; bottom: 2em; right: 2em;">
<div id="refresh" class="circular ui icon button"><i class="redo alternate icon"></i></div>
<div id="settings" class="circular ui icon button"><i class="icon cog"></i></div>
</div>
Expand All @@ -84,8 +96,9 @@ <h3 id="address">address</h3>
<p id="modal-content"></p>
</div>
<div class="actions">
<div class="ui icon basic cancel inverted button">
<i class="help icon"></i>
<div class="ui inverted basic button" id="error-openLogs">
<i class="file alternate icon"></i>
Logs
</div>
<div class="ui red ok inverted button">
<i class="remove icon"></i>
Expand All @@ -94,10 +107,10 @@ <h3 id="address">address</h3>
</div>
</div>
</body>
<script>
nodeRequire('./renderer.js');
</script>
<script src="../js/jquery-3.4.0.min.js"></script>
<script src="../js/semantic.min.js"></script>
<script src="../js/app.js"></script>
<script>
nodeRequire('./renderer.js');
</script>
</html>
Loading

0 comments on commit c116e2e

Please sign in to comment.