Files
kopia/app/src/ServerStatus.js
Jarek Kowalski c3ead4bc3e Kopia UI: added desktop app shell based on Electron that runs in the tray (#183)
* app: added desktop app shell based on Electron that runs in the tray, starts a background kopia server and allows access to the UI

* icons: updated icons for the app

* htmlui: flexible containers
2020-02-01 11:58:22 -08:00

25 lines
607 B
JavaScript

import React, { Component } from 'react';
export default class ServerStatus extends Component {
constructor() {
super();
this.state = {
running: false,
};
if (window.require) {
const { ipcRenderer } = window.require('electron');
ipcRenderer.on('status-updated', (event, args) => {
this.setState(args);
})
ipcRenderer.send('subscribe-to-status');
}
}
render() {
return <div>Server: <b>{this.state.status}</b> on <code>{this.state.serverAddress}</code></div>;
}
}