mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
adds getVersionInfo api (#91)
* adds getVersionInfo api * fix mixed up names
This commit is contained in:
@@ -57,7 +57,13 @@
|
|||||||
<p>Get Media Sources:</p>
|
<p>Get Media Sources:</p>
|
||||||
<button id='get-sources'>get entire desktop</button>
|
<button id='get-sources'>get entire desktop</button>
|
||||||
<br>
|
<br>
|
||||||
<video id='video'/>
|
<video id='video'></video>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<p>Get Version Info:</p>
|
||||||
|
<button id='get-version'>get version info</button>
|
||||||
|
<br>
|
||||||
|
Version Info:<span id='info'></span>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
var notfEl = document.getElementById('notf');
|
var notfEl = document.getElementById('notf');
|
||||||
@@ -187,6 +193,15 @@
|
|||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var getSources = document.getElementById('get-version');
|
||||||
|
getSources.addEventListener('click', function() {
|
||||||
|
ssf.getVersionInfo().then(function(verInfo) {
|
||||||
|
var verEl = document.getElementById('info');
|
||||||
|
verEl.innerText = '\napi ver=' + verInfo.apiVer +
|
||||||
|
'\ncontainer identifier=' + verInfo.containerIdentifier +
|
||||||
|
'\ncontainer ver=' + verInfo.containerVer
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -58,8 +58,19 @@ function createAPI() {
|
|||||||
// API exposed to renderer process.
|
// API exposed to renderer process.
|
||||||
//
|
//
|
||||||
window.ssf = {
|
window.ssf = {
|
||||||
// api version
|
getVersionInfo: function() {
|
||||||
version: '1.0.0',
|
return new Promise(function(resolve) {
|
||||||
|
var appName = remote.app.getName();
|
||||||
|
var appVer = remote.app.getVersion();
|
||||||
|
|
||||||
|
const verInfo = {
|
||||||
|
containerIdentifier: appName,
|
||||||
|
containerVer: appVer,
|
||||||
|
apiVer: '1.0.0'
|
||||||
|
}
|
||||||
|
resolve(verInfo);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets the count on the tray icon to the given number.
|
* sets the count on the tray icon to the given number.
|
||||||
|
|||||||
Reference in New Issue
Block a user