From e6fe1aa7f31540205ee9eb7535a066076972f9bf Mon Sep 17 00:00:00 2001 From: Jarek Kowalski Date: Thu, 5 Mar 2020 16:35:45 -0800 Subject: [PATCH] kopia-ui: misc - launch server on a randomized port - added support for connecting to remote server - embedded version info in the app and htmlui --- app/public/electron.js | 6 ++-- app/public/index.html | 4 ++- app/public/server.js | 77 +++++++++++++++++++++++++++------------- app/src/App.css | 6 ++++ app/src/App.js | 3 +- app/src/ServerConfig.js | 59 +++++++++++++++++++----------- app/src/ServerStatus.js | 2 +- htmlui/public/index.html | 4 ++- htmlui/src/App.css | 6 ++++ tools/tools.mk | 21 +++++++++++ 10 files changed, 135 insertions(+), 53 deletions(-) diff --git a/app/public/electron.js b/app/public/electron.js index 0df5205fe..ca3f3afc0 100644 --- a/app/public/electron.js +++ b/app/public/electron.js @@ -26,7 +26,7 @@ let tray = null let configWindow = null; let mainWindow = null; -function advancedConfiguration() { +function serverConfiguration() { if (configWindow) { configWindow.focus(); return; @@ -42,7 +42,7 @@ function advancedConfiguration() { }) if (isDev) { - configWindow.loadURL('http://localhost:3000'); + configWindow.loadURL('http://localhost:3000/?ts=' + new Date().valueOf()); } else { configWindow.loadFile('./build/index.html'); } @@ -215,7 +215,7 @@ function updateTrayContextMenu() { console.log('updating tray...'); const contextMenu = Menu.buildFromTemplate([ { label: 'Show Main Window', click: showMainWindow }, - { label: 'Advanced Configuration...', click: advancedConfiguration }, + { label: 'Server Configuration...', click: serverConfiguration }, { label: 'Check For Updates Now', click: checkForUpdates }, { type: 'separator' }, { label: 'Launch At Startup', type: 'checkbox', click: toggleLaunchAtStartup, checked: willLaunchAtStartup() }, diff --git a/app/public/index.html b/app/public/index.html index 94c48c85e..990ccad71 100644 --- a/app/public/index.html +++ b/app/public/index.html @@ -24,11 +24,13 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - Kopia - Advanced Configuration + Kopia v%REACT_APP_SHORT_VERSION_INFO% - Server Configuration
+
+

Version %REACT_APP_FULL_VERSION_INFO%

- Kopia UI + Kopia UI v%REACT_APP_SHORT_VERSION_INFO%
+
+

Version %REACT_APP_FULL_VERSION_INFO%