Skip to content

Commit 7aa4d85

Browse files
committed
add UI version to UI about page
1 parent 4f42473 commit 7aa4d85

File tree

6 files changed

+18
-14
lines changed

6 files changed

+18
-14
lines changed

Diff for: UI/package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: UI/src/app/_components/about/about.component.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ <h1>About</h1>
33
<div class="row mt-3">
44
<div class="col-xs-12 col-md-6 mt-3">
55
<div class="card p-3">
6-
<h4>Version</h4>
6+
<h4>Server Version</h4>
77
<b>{{socketService.version}}</b>
8+
<h4>UI Version</h4>
9+
<b>{{socketService.uiVersion}}</b>
810
</div>
911
</div>
1012
<div class="col-xs-12 col-md-6 my-3">

Diff for: UI/src/app/_services/socket.service.ts

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export class SocketService {
4646
public remoteErrorOpt: boolean = true;
4747
public initialDataLoaded = false;
4848
public version?: string;
49+
public uiVersion?: string;
4950
public externalAddress?: string;
5051
public interfaces: any[] = [];
5152
public logs: LogItem[] = [];
@@ -156,6 +157,9 @@ export class SocketService {
156157
this.socket.on("version", (version: string) => {
157158
this.version = version;
158159
});
160+
this.socket.on('uiVersion', (uiVersion: string) => {
161+
this.uiVersion = uiVersion;
162+
});
159163

160164
this.socket.on("externalAddress", (externalAddress: string) => {
161165
this.externalAddress = externalAddress;
@@ -359,6 +363,7 @@ export class SocketService {
359363
this.socket.emit('get_error_reports');
360364

361365
this.socket.emit('version');
366+
this.socket.emit('uiVersion');
362367
this.socket.emit('externalAddress');
363368
this.socket.emit('interfaces');
364369
this.socket.emit('get_error_reports');

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you want to make changes to the UI, you need to do the following:
2828

2929
When you make changes to the source code, the page in your browser will automatically reload.
3030

31-
The socket&#46;io / REST API requests the UI makes are automatically proxied to `http://localhost:4455`. That's the reason why the main server (see above) needs to be running.
31+
The socket&#46;io requests the UI makes are automatically proxied to `http://localhost:4455`. That's the reason why the main server (see above) needs to be running.
3232

3333
Running `npm install` in the project's root folder (not in the UI directory) the UI is built automatically. As the UI's bundled dist files are excluded from the git repository in the `.gitignore` file, this is needed to ensure users which install TallyArbiter from source also have bundled UI dist. This dist is also served by the main server using `express.static()`.
3434

Diff for: src/index.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import { Config } from './_models/Config';
6767
import { bonjour } from './_helpers/mdns';
6868

6969
const version = findPackageJson(__dirname).next()?.value?.version || "unknown";
70+
const uiVersion = findPackageJson(path.join(__dirname, '..', 'ui')).next()?.value?.version || "unknown";
7071
const devmode = process.argv.includes('--dev') || process.env.NODE_ENV === 'development';
7172

7273
if(devmode) logger('TallyArbiter running in Development Mode.', 'info');
@@ -285,6 +286,10 @@ function initialSetup() {
285286
socket.emit('version', version);
286287
});
287288

289+
socket.on('uiVersion', () => {
290+
socket.emit('uiVersion', uiVersion);
291+
});
292+
288293
socket.on('externalAddress', () => {
289294
socket.emit('externalAddress', currentConfig.externalAddress);
290295
});
@@ -1383,25 +1388,17 @@ function initializeSource(source: Source): TallyInput {
13831388

13841389
function processSourceTallyData(sourceId: string, tallyData: SourceTallyData)
13851390
{
1386-
//console.log('got source tally data', tallyData);
1387-
13881391
writeTallyDataFile(tallyData);
13891392

13901393
for (const [address, busses] of Object.entries(tallyData)) {
13911394
//console.log('tally_data', sourceId, address, busses);
13921395
io.to('settings').emit('tally_data', sourceId, address, busses);
13931396
}
13941397

1395-
//console.log('currentSourceTallyData', currentSourceTallyData);
1396-
1397-
13981398
currentSourceTallyData = {
13991399
...currentSourceTallyData,
14001400
...tallyData,
14011401
};
1402-
1403-
1404-
console.log('currentSourceTallyData2', currentSourceTallyData);
14051402

14061403
for (const device of devices) {
14071404
UpdateDeviceState(device.id);

0 commit comments

Comments
 (0)