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
This commit is contained in:
Jarek Kowalski
2020-02-01 11:58:22 -08:00
committed by GitHub
parent e9ad7b0e14
commit c3ead4bc3e
46 changed files with 17201 additions and 8 deletions

View File

@@ -18,6 +18,8 @@ builds:
- -tags=embedhtml
ldflags:
- -s -w -X "github.com/kopia/kopia/repo.BuildVersion={{.Version}}" -X "github.com/kopia/kopia/repo.BuildInfo={{.Commit}}"
release:
draft: true
archives:
- id: default
replacements:

View File

@@ -1,9 +1,10 @@
dist: xenial
dist: bionic
language: go
go:
- '1.13.x'
os:
- linux
- osx
addons:
apt:
packages:

View File

@@ -63,6 +63,9 @@ travis-setup: travis-install-gpg-key travis-install-test-credentials
website:
$(MAKE) -C site build
kopia-ui: build-electron-all
$(MAKE) -C app build-electron-dir
html-ui:
$(MAKE) -C htmlui build-html
@@ -72,13 +75,37 @@ html-ui-bindata: html-ui $(BINDATA_TOOL)
html-ui-bindata-fallback: $(BINDATA_TOOL)
(cd internal/server && $(BINDATA_TOOL) -fs -tags !embedhtml -o "$(CURDIR)/internal/server/htmlui_fallback.go" -pkg server index.html)
travis-release: test-with-coverage lint vet verify-release integration-tests upload-coverage website stress-test
ifeq ($(TRAVIS_OS_NAME),osx)
verify-release:
curl -sL https://git.io/goreleaser | bash /dev/stdin --skip-publish --skip-sign --rm-dist --snapshot
kopia-ui-osx: goreleaser-nopublish
$(MAKE) -C app build-all-mac
tagged-release:
curl -sL https://git.io/goreleaser | bash /dev/stdin --rm-dist
travis-release-os-specific: kopia-ui-osx
endif
ifeq ($(TRAVIS_OS_NAME),linux)
travis-release-os-specific: kopia-ui-win-linux
kopia-ui-win-linux: goreleaser-nopublish
$(MAKE) -C app build-all-win-linux-docker
endif
ifeq ($(TRAVIS_OS_NAME),)
travis-release-os-specific:
endif
travis-release: test-with-coverage lint vet goreleaser-nopublish integration-tests upload-coverage website stress-test travis-release-os-specific
goreleaser-nopublish: $(GORELEASER_TOOL)
$(GORELEASER_TOOL) --skip-publish --skip-sign --rm-dist --snapshot
tagged-release: $(GORELEASER_TOOL)
$(GORELEASER_TOOL) --rm-dist
# this is a no-op for PRs and non-tagged releses
$(MAKE) travis-create-long-term-repository

23
app/.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

30
app/Makefile Normal file
View File

@@ -0,0 +1,30 @@
dev: node_modules
PATH=$(TOOL_PATH) $(NPM_TOOL) run dev
run: build-html
PATH=$(TOOL_PATH) $(NPM_TOOL) run start-electron-prebuilt
build-html: node_modules
PATH=$(TOOL_PATH) $(NPM_TOOL) run build-html
build-electron-dir: node_modules build-html
PATH=$(TOOL_PATH) $(NPM_TOOL) run build-electron-dir
build-all-mac: node_modules build-html
PATH=$(TOOL_PATH) $(NPM_TOOL) run build-electron-mac
build-all-win-linux-docker:
docker run --rm -ti \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v $(CURDIR):/project \
-v ~/.cache/electron:/root/.cache/electron \
-v $(CURDIR)/../dist:/dist \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
electronuserland/builder:wine \
/bin/bash -c "npm install && npm run build-html && npm run build-electron-win-linux"
include ../tools/tools.mk
node_modules: $(NPM_TOOL)
PATH=$(TOOL_PATH) $(NPM_TOOL) install

68
app/README.md Normal file
View File

@@ -0,0 +1,68 @@
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
## Available Scripts
In the project directory, you can run:
### `npm start`
Runs the app in the development mode.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br />
You will also see any lint errors in the console.
### `npm test`
Launches the test runner in the interactive watch mode.<br />
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
### `npm run build`
Builds the app for production to the `build` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />
Your app is ready to be deployed!
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
### `npm run eject`
**Note: this is a one-way operation. Once you `eject`, you cant go back!**
If you arent satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point youre on your own.
You dont have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldnt feel obligated to use this feature. However we understand that this tool wouldnt be useful if you couldnt customize it when you are ready for it.
## Learn More
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
To learn React, check out the [React documentation](https://reactjs.org/).
### Code Splitting
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
### Analyzing the Bundle Size
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
### Making a Progressive Web App
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
### Advanced Configuration
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
### Deployment
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
### `npm run build` fails to minify
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

BIN
app/assets/icon.icns Normal file
View File

Binary file not shown.

BIN
app/assets/icon.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

1
app/env.sh Normal file
View File

@@ -0,0 +1 @@
PATH=$(pwd)/../tools/.tools/nodejs/node/bin:$PATH

15735
app/package-lock.json generated Normal file
View File

File diff suppressed because it is too large Load Diff

110
app/package.json Normal file
View File

@@ -0,0 +1,110 @@
{
"name": "kopia-ui",
"version": "0.5.0-test1",
"private": true,
"repository": "github:kopia/kopia",
"dependencies": {
"auto-launch": "^5.0.5",
"bootstrap": "^4.3.1",
"electron-is-dev": "^1.1.0",
"electron-json-config": "^1.5.3",
"react": "^16.12.0",
"react-bootstrap": "^1.0.0-beta.14",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.3.0"
},
"build": {
"productName": "KopiaUI",
"publish": [{"provider":"github"}],
"files": [
"build/**/*",
"node_modules/**/*"
],
"extraResources": [
{
"from": "resources/${os}",
"to": ".",
"filter": [
"**/*"
]
}
],
"directories": {
"buildResources": "assets",
"output": "../dist/kopia-ui"
},
"win": {
"extraResources": [
{
"from": "../dist/kopia_windows_amd64",
"to": "server",
"filter": [
"kopia.exe"
]
}
]
},
"mac": {
"extraResources": [
{
"from": "../dist/kopia_darwin_amd64",
"to": "server",
"filter": [
"kopia"
]
}
]
},
"linux": {
"extraResources": [
{
"from": "../dist/kopia_linux_amd64",
"to": "server",
"filter": [
"kopia"
]
}
]
}
},
"devDependencies": {
"asar": "^2.0.3",
"concurrently": "^5.0.0",
"electron": "^7.1.2",
"electron-builder": "^21.2.0"
},
"homepage": "./",
"main": "public/electron.js",
"scripts": {
"start": "react-scripts start",
"build-html": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"start-electron": "electron .",
"build-electron": "electron-builder -mwl",
"build-electron-all": "electron-builder -wlm",
"build-electron-win": "electron-builder -w --dir",
"build-electron-linux": "electron-builder -l",
"build-electron-win-linux": "electron-builder -wl",
"build-electron-mac": "electron-builder -m",
"build-electron-dir": "electron-builder --dir -wlm",
"start-electron-prebuilt": "ELECTRON_IS_DEV=0 electron .",
"dev": "concurrently \"react-scripts start\" \"sleep 3s; electron .\""
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

41
app/public/auto-launch.js Normal file
View File

@@ -0,0 +1,41 @@
const { ipcMain } = require('electron');
const AutoLaunch = require('auto-launch');
const autoLauncher = new AutoLaunch({
name: 'Kopia',
mac: {
useLaunchAgent: true,
},
});
let enabled = false;
module.exports = {
willLaunchAtStartup() {
return enabled;
},
toggleLaunchAtStartup() {
if (enabled) {
console.log('disabling autorun');
autoLauncher.disable()
.then(() => { enabled = false; ipcMain.emit('launch-at-startup-updated'); })
.catch((err) => console.log(err));
} else {
console.log('enabling autorun');
autoLauncher.enable()
.then(() => { enabled = true; ipcMain.emit('launch-at-startup-updated'); })
.catch((err) => console.log(err));
}
},
refreshWillLaunchAtStartup() {
autoLauncher.isEnabled()
.then((isEnabled) => {
enabled = isEnabled;
ipcMain.emit('launch-at-startup-updated');
})
.catch(function (err) {
console.log('unable to get autoLauncher state', err);
});
},
}

118
app/public/electron.js Normal file
View File

@@ -0,0 +1,118 @@
const { app, BrowserWindow, Menu, Tray, ipcMain } = require('electron')
const path = require('path');
const isDev = require('electron-is-dev');
const config = require('electron-json-config');
const { resourcesPath, selectByOS } = require('./utils');
const { toggleLaunchAtStartup, willLaunchAtStartup, refreshWillLaunchAtStartup } = require('./auto-launch');
const { stopServer, actuateServer } = require('./server');
ipcMain.on('fetch-config', (event, arg) => {
event.sender.send('config-updated', config.all());
})
ipcMain.on('save-config', (event, arg) => {
console.log('saving config', arg);
config.setBulk(arg);
actuateServer();
event.returnValue = true;
})
let tray = null
let configWindow = null;
let mainWindow = null;
function advancedConfiguration() {
if (configWindow) {
return;
}
configWindow = new BrowserWindow({
width: 1000,
height: 700,
autoHideMenuBar: true,
webPreferences: {
nodeIntegration: true
},
})
if (isDev) {
configWindow.loadURL('http://localhost:3000');
} else {
configWindow.loadFile('./build/index.html');
}
configWindow.on('closed', function () {
ipcMain.removeAllListeners('status-updated-event');
ipcMain.removeAllListeners('logs-updated-event');
// forget the reference.
configWindow = null;
});
}
function showMainWindow() {
if (mainWindow) {
return;
}
mainWindow = new BrowserWindow({
width: 1000,
height: 700,
autoHideMenuBar: true,
})
mainWindow.loadURL('http://localhost:51515/?ts=' + new Date().valueOf());
mainWindow.on('closed', function () {
// forget the reference.
mainWindow = null;
});
}
if (!app.requestSingleInstanceLock()) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.focus()
}
})
}
app.on('will-quit', function () {
stopServer();
});
// Ignore
app.on('window-all-closed', function () {})
ipcMain.on('server-status-updated', updateTrayContextMenu);
ipcMain.on('launch-at-startup-updated', updateTrayContextMenu);
app.on('ready', () => {
tray = new Tray(
path.join(
resourcesPath(), 'icons',
selectByOS({ mac: 'kopia-tray.png', win: 'kopia-tray.ico', linux: 'kopia-tray.png' })));
tray.setToolTip('Kopia');
updateTrayContextMenu();
refreshWillLaunchAtStartup();
actuateServer();
})
function updateTrayContextMenu() {
console.log('updating tray...');
const contextMenu = Menu.buildFromTemplate([
{ label: 'Show Main Window', click: showMainWindow },
{ label: 'Advanced Configuration...', click: advancedConfiguration },
{ type: 'separator' },
{ label: 'Launch At Startup', type: 'checkbox', click: toggleLaunchAtStartup, checked: willLaunchAtStartup() },
{ label: 'Quit', role: 'quit' },
])
tray.setContextMenu(contextMenu);
}

BIN
app/public/favicon.ico Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

43
app/public/index.html Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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`.
-->
<title>Kopia - Advanced Configuration</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>

28
app/public/logging.js Normal file
View File

@@ -0,0 +1,28 @@
const { ipcMain } = require('electron');
const maxLogLines = 100;
let serverLog = [];
function sendLogsUpdate(sender) {
sender.send('logs-updated', serverLog.join(''));
}
ipcMain.on('subscribe-to-logs', (event, arg) => {
sendLogsUpdate(event.sender);
ipcMain.addListener('logs-updated-event', () => {
sendLogsUpdate(event.sender);
})
});
module.exports = {
appendToLog(data) {
const l = serverLog.push(data);
if (l > maxLogLines) {
serverLog.splice(0, 1);
}
ipcMain.emit('logs-updated-event');
console.log(`${data}`);
}
}

BIN
app/public/logo192.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
app/public/logo512.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

25
app/public/manifest.json Normal file
View File

@@ -0,0 +1,25 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

2
app/public/robots.txt Normal file
View File

@@ -0,0 +1,2 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *

85
app/public/server.js Normal file
View File

@@ -0,0 +1,85 @@
const { ipcMain } = require('electron');
const config = require('electron-json-config');
const { appendToLog } = require('./logging');
const { defaultServerBinary } = require('./utils');
const { spawn } = require('child_process');
let serverProcess = null;
function startServer() {
let kopiaPath = config.get('kopiaPath');
if (!kopiaPath) {
kopiaPath = defaultServerBinary();
}
let args = [];
let configFile = config.get('configFile');
if (configFile) {
args.push("--config", configFile);
}
args.push('server', '--ui');
console.log(`spawning ${kopiaPath} ${args.join(' ')}`);
serverProcess = spawn(kopiaPath, args);
ipcMain.emit('server-status-updated');
serverProcess.stdout.on('data', appendToLog);
serverProcess.stderr.on('data', appendToLog);
serverProcess.on('close', (code, signal) => {
appendToLog(`child process exited with code ${code} and signal ${signal}`);
serverProcess = null;
ipcMain.emit('server-status-updated');
});
}
function stopServer() {
if (!serverProcess) {
console.log('stopServer: server not started');
return;
}
serverProcess.kill();
serverProcess = null;
}
ipcMain.on('subscribe-to-status', (event, arg) => {
sendStatusUpdate(event.sender);
ipcMain.addListener('status-updated-event', () => {
sendStatusUpdate(event.sender);
})
});
function getServerStatus() {
if (!serverProcess) {
return "Stopped";
}
return "Running";
};
function getServerAddress() {
return "localhost:51515";
};
function sendStatusUpdate(sender) {
sender.send('status-updated', {
status: getServerStatus(),
serverAddress: getServerAddress(),
});
}
module.exports = {
actuateServer() {
stopServer();
if (!config.get('remoteServer')) {
startServer();
}
},
stopServer: stopServer,
}

42
app/public/utils.js Normal file
View File

@@ -0,0 +1,42 @@
const path = require('path');
const isDev = require('electron-is-dev');
const osShortName = function() {
switch (process.platform) {
case "win32":
return "win"
case "darwin":
return "mac"
case "linux":
return "linux"
default:
return null
}
}();
module.exports = {
resourcesPath: function () {
if (isDev) {
return path.join(__dirname, "..", "resources", osShortName);
}
return process.resourcesPath;
},
defaultServerBinary: function () {
if (isDev) {
return {
"mac": path.join(__dirname, "..", "..", "dist", "kopia_darwin_amd64", "kopia"),
"win": path.join(__dirname, "..", "..", "dist", "kopia_windows_amd64", "kopia.exe"),
"linux": path.join(__dirname, "..", "..", "dist", "kopia_linux_amd64", "kopia"),
}[osShortName]
}
return {
"mac": path.join(process.resourcesPath, "server", "kopia"),
"win": path.join(process.resourcesPath, "server", "kopia.exe"),
"linux": path.join(process.resourcesPath, "server", "kopia"),
}[osShortName]
},
selectByOS: function (x) {
return x[osShortName]
},
}

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

37
app/src/App.css Normal file
View File

@@ -0,0 +1,37 @@
header {
padding: 10px;
}
.App {
text-align: center;
}
.App-logo {
height: 32px;
margin-bottom: 10px;
}
div.indented {
padding-left: 30px;
}
span.title {
font-size: 30px;
vertical-align: baseline;
padding-left: 10px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
div.tab-body {
padding: 10px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
#logs {
font-size: 11px;
font-weight: bold;
color: #000080;
font-family: Consolas, 'Courier New', Courier, monospace;
}

39
app/src/App.js Normal file
View File

@@ -0,0 +1,39 @@
import React from 'react';
import './App.css';
import Container from 'react-bootstrap/Container';
import Tabs from 'react-bootstrap/Tabs';
import Tab from 'react-bootstrap/Tab';
import logo from './kopia-flat.svg';
import ServerConfig from './ServerConfig.js';
import ServerLogs from './ServerLogs';
import ServerStatus from './ServerStatus';
import 'bootstrap/dist/css/bootstrap.min.css';
function App() {
return (
<Container fluid>
<header>
<img src={logo} className="App-logo" alt="logo" />
<span className="title">Kopia</span>
</header>
<ServerStatus />
<hr/>
<Tabs defaultActiveKey="config" transition={false}>
<Tab eventKey="config" title="Server Configuration">
<div className="tab-body">
<ServerConfig />
</div>
</Tab>
<Tab eventKey="logs" title="Logs">
<div className="tab-body">
<ServerLogs />
</div>
</Tab>
</Tabs>
</Container>
);
}
export default App;

9
app/src/App.test.js Normal file
View File

@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});

112
app/src/ServerConfig.js Normal file
View File

@@ -0,0 +1,112 @@
import React, { Component } from 'react';
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
export default class ServerConfig extends Component {
constructor() {
super();
this.state = {
"remoteServer": false,
"kopiaPath": "",
"configFile": "",
"repositoryPassword": "",
'serverUsername': 'kopia',
"serverAddress": "https://localhost:51515",
"serverPassword": "",
};
this.updateState = this.updateState.bind(this);
this.saveConfiguration = this.saveConfiguration.bind(this);
if (window.require) {
const { ipcRenderer } = window.require('electron');
ipcRenderer.on('config-updated', (event, args) => {
this.setState(args);
})
ipcRenderer.send('fetch-config');
}
}
componentDidMount() {
}
onChangeServerType(e) {
}
updateState(e) {
let d = {}
d[e.target.id] = e.target.value;
this.setState(d);
}
saveConfiguration() {
if (window.require) {
const { ipcRenderer } = window.require('electron');
ipcRenderer.sendSync('save-config', this.state);
}
window.close();
}
render() {
return <>
<Form>
<Form.Group controlId="useBuiltInServer">
<Form.Check type="radio" name="serverType" label="Internal Kopia Server" checked={!this.state.remoteServer} onChange={() => this.setState({ 'remoteServer': false })} />
</Form.Group>
{!this.state.remoteServer &&
<div className="indented">
<React.Fragment>
<Form.Group controlId="kopiaPath">
<Form.Label>Override Path To <code>kopia</code> executable</Form.Label>
<Form.Control type="text" placeholder="Enter path" value={this.state.kopiaPath} onChange={this.updateState} />
<Form.Text className="text-muted">Uses embedded executable if not set.</Form.Text>
</Form.Group>
<Form.Group controlId="configFile">
<Form.Label>Override Configuration File</Form.Label>
<Form.Control type="text" placeholder="Configuration file" value={this.state.configFile} onChange={this.updateState} />
<Form.Text className="text-muted">Uses default configuration path, if not set.</Form.Text>
</Form.Group>
<Form.Group controlId="repositoryPassword">
<Form.Label>Repository Password</Form.Label>
<Form.Control type="password" placeholder="Password" value={this.state.repositoryPassword} onChange={this.updateState} />
<Form.Text className="text-muted">Uses saved password if not set.</Form.Text>
</Form.Group>
</React.Fragment>
</div>}
<Form.Group controlId="connectToServer">
<Form.Check type="radio" name="serverType" label="Connect To Server" checked={this.state.remoteServer} onChange={() => this.setState({ 'remoteServer': true })} />
</Form.Group>
{this.state.remoteServer &&
<div className="indented">
<React.Fragment>
<Form.Group controlId="serverAddress">
<Form.Label>Server Address</Form.Label>
<Form.Control type="text" placeholder="Enter address" value={this.state.serverAddress} onChange={this.updateState} />
<Form.Text className="text-muted">To connect to local server, use localhost:51515</Form.Text>
</Form.Group>
<Form.Group controlId="serverUsername">
<Form.Label>Server Username</Form.Label>
<Form.Control type="text" placeholder="Enter username" value={this.state.serverUsername} onChange={this.updateState} />
</Form.Group>
<Form.Group controlId="serverPassword">
<Form.Label>Server Password</Form.Label>
<Form.Control type="password" placeholder="Password" value={this.state.serverPassword} onChange={this.updateState} />
</Form.Group>
</React.Fragment>
</div>
}
</Form>
<hr />
<Button variant="success" type="submit" onClick={this.saveConfiguration}>Save Configuration</Button>
&nbsp;
<Button variant="secondary" type="submit" onClick={window.close}>Cancel</Button>
</>;
}
}

28
app/src/ServerLogs.js Normal file
View File

@@ -0,0 +1,28 @@
import React, { Component } from 'react';
import Form from 'react-bootstrap/Form';
export default class ServerLogs extends Component {
constructor() {
super();
this.state = {
logs: "",
};
if (window.require) {
const { ipcRenderer } = window.require('electron');
ipcRenderer.on('logs-updated', (event, args) => {
this.setState({logs:args});
})
ipcRenderer.send('subscribe-to-logs');
}
}
render() {
return <Form.Group controlId="logs">
<Form.Control as="textarea" rows="30" value={this.state.logs} />
</Form.Group>;
}
}

24
app/src/ServerStatus.js Normal file
View File

@@ -0,0 +1,24 @@
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>;
}
}

13
app/src/index.css Normal file
View File

@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}

12
app/src/index.js Normal file
View File

@@ -0,0 +1,12 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();

139
app/src/kopia-flat.svg Normal file
View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="31"
viewBox="0 0 12.700008 8.2020885"
version="1.1"
id="svg4919"
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
sodipodi:docname="kopia-flat.svg"
inkscape:export-filename="/Users/jarek/Projects/kopia-ui/resources/icon.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs4913">
<linearGradient
osb:paint="gradient"
id="linearGradient4578">
<stop
id="stop4574"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop4576"
offset="1"
style="stop-color:#0066ff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2345"
osb:paint="gradient">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop2341" />
<stop
style="stop-color:#0066ff;stop-opacity:0;"
offset="1"
id="stop2343" />
</linearGradient>
</defs>
<sodipodi:namedview
inkscape:pagecheckerboard="false"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6571604"
inkscape:cx="53.451757"
inkscape:cy="30.205905"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1440"
inkscape:window-height="795"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
units="px"
width="64px"
showguides="false"
inkscape:snap-text-baseline="true"
inkscape:document-rotation="0" />
<metadata
id="metadata4916">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-280.06662)">
<g
id="g849"
transform="matrix(0.04649709,0,0,0.04649709,-0.02134367,277.52719)"
inkscape:export-xdpi="65.472687"
inkscape:export-ydpi="65.472687">
<g
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
style="fill:#2a7fff;fill-opacity:1;stroke:none;stroke-width:0.57724;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0"
transform="matrix(19.66121,0,0,20.144513,53.912845,-5697.4527)"
id="g886">
<path
style="fill:#2a7fff;fill-opacity:1;stroke:none;stroke-width:0.365129;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 3.68292,285.81098 a 3.7143042,3.9255907 0 0 1 3.2394206,2.00885 2.978621,3.1480586 0 0 1 0.9055101,-0.15021 2.978621,3.1480586 0 0 1 2.9786373,3.14795 2.978621,3.1480586 0 0 1 -2.6197318,3.12262 v 0.0254 H 7.8278507 0.29155891 v -8.5e-4 a 2.3864853,2.5222394 0 0 1 -0.31315577,0.0246 2.3864853,2.5222394 0 0 1 -2.38640124,-2.52228 2.3864853,2.5222394 0 0 1 2.38640124,-2.52228 2.3864853,2.5222394 0 0 1 0.07019771,0.002 3.7143042,3.9255907 0 0 1 3.63432355,-3.136 z"
id="rect4799-3"
inkscape:connector-curvature="0"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</g>
<g
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
style="fill:#e4e4e4;fill-opacity:1;stroke:none;stroke-width:0.280131;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g10"
transform="matrix(2.1802385,2.8772027,-1.7541947,3.575994,104.54534,-155.29438)">
<g
style="fill:#e4e4e4;fill-opacity:1;stroke:none;stroke-width:0.280131;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g883">
<path
inkscape:connector-curvature="0"
d="m 52.475497,57.904193 2.118969,-4.700554 c 0.258337,-0.573742 0.794452,-1.452559 1.188918,-1.952342 l 2.189741,-5.099694 c 0.171725,-0.02042 0.344927,-0.09102 0.466732,-0.194079 l 0.630265,-0.546749 c 0.243632,-0.206882 0.608139,-0.67108 0.736916,-0.95794 l 0.31965,-0.665782 c 0.05776,-0.130508 0.08615,-0.298735 0.08241,-0.463714 l 4.176599,-5.28537 c 0.206096,0.05958 0.452753,0.01539 0.625077,-0.131566 l 0.268535,-0.229977 c 0.242872,-0.207632 0.555873,-0.62096 0.686215,-0.907865 l 0.122894,-0.272803 c 0.08361,-0.186032 0.07645,-0.420341 0.0074,-0.621993 L 81.942439,16.980848 c 0.394443,-0.499011 -3.499736,2.827825 -4.003591,3.221242 L 63.158733,32.961034 c 0,0 -0.470077,-0.09048 -0.672002,2.42e-4 l -0.315191,0.142618 c -0.289847,0.131081 -0.692958,0.446742 -0.889398,0.696224 l -0.197198,0.248733 c -0.137168,0.173703 -0.173217,0.41621 -0.114352,0.619702 l -5.260067,4.10647 c -0.211006,-0.0255 -0.444855,0.0083 -0.614306,0.0842 l -0.765391,0.385589 c -0.289846,0.131081 -0.709835,0.462661 -0.906298,0.712915 l -0.479332,0.595593 c -0.106358,0.135778 -0.173913,0.333686 -0.180977,0.520579 l -4.899926,2.25652 c -0.503833,0.392646 -1.390045,0.927547 -1.970452,1.187416 l -5.715688,2.569121 c -0.579625,0.259846 -0.824906,1.000611 -0.618168,1.569324 0,0 0.927303,2.582054 3.611972,5.535017 l -2.71371,2.679373 c -0.644457,-0.484249 -0.865773,-0.265673 -1.130524,-0.0049 l -0.05151,0.05087 c -0.264752,0.260725 -0.48609,0.480073 0.0055,1.114567 l -3.777657,3.730903 c -0.643676,-0.484272 -0.865751,-0.266445 -1.129765,-0.0042 l -0.05148,0.0501 c -0.264751,0.260725 -0.485307,0.480051 0.0055,1.11534 L 22.80456,74.18879 c -0.113497,0.112842 1.950106,1.40756 1.950106,1.40756 l 11.27516,-10.990626 c 0.645262,0.483455 0.865773,0.265673 1.129742,0.005 l 0.05148,-0.0501 c 0.264774,-0.261497 0.486089,-0.480073 -0.0054,-1.116112 l 3.777612,-3.729358 c 0.643676,0.484272 0.865796,0.264901 1.129765,0.0042 l 0.05148,-0.0501 c 0.264797,-0.262269 0.48609,-0.480074 -0.0055,-1.11534 l 2.723413,-2.690456 c 3.01624,2.625495 6.011328,2.658358 6.011328,2.658358 0.577766,0.201527 1.322586,-0.04231 1.581751,-0.617623 z"
id="path8"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
style="fill:#e4e4e4;fill-opacity:1;stroke:none;stroke-width:0.386847;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
<ellipse
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
ry="1.5360007"
rx="1.6261826"
cy="192.16341"
cx="190.19328"
id="path876"
style="fill:#b3b3b3;fill-opacity:1;stroke:#00ff00;stroke-width:0.179274;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

135
app/src/serviceWorker.js Normal file
View File

@@ -0,0 +1,135 @@
// This optional code is used to register a service worker.
// register() is not called by default.
// This lets the app load faster on subsequent visits in production, and gives
// it offline capabilities. However, it also means that developers (and users)
// will only see deployed updates on subsequent visits to a page, after all the
// existing tabs open on the page have been closed, since previously cached
// resources are updated in the background.
// To learn more about the benefits of this model and instructions on how to
// opt-in, read https://bit.ly/CRA-PWA
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
window.location.hostname.match(
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
)
);
export function register(config) {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
if (publicUrl.origin !== window.location.origin) {
// Our service worker won't work if PUBLIC_URL is on a different origin
// from what our page is served on. This might happen if a CDN is used to
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
return;
}
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
if (isLocalhost) {
// This is running on localhost. Let's check if a service worker still exists or not.
checkValidServiceWorker(swUrl, config);
// Add some additional logging to localhost, pointing developers to the
// service worker/PWA documentation.
navigator.serviceWorker.ready.then(() => {
console.log(
'This web app is being served cache-first by a service ' +
'worker. To learn more, visit https://bit.ly/CRA-PWA'
);
});
} else {
// Is not localhost. Just register service worker
registerValidSW(swUrl, config);
}
});
}
}
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
return;
}
installingWorker.onstatechange = () => {
if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the updated precached content has been fetched,
// but the previous service worker will still serve the older
// content until all client tabs are closed.
console.log(
'New content is available and will be used when all ' +
'tabs for this page are closed. See https://bit.ly/CRA-PWA.'
);
// Execute callback
if (config && config.onUpdate) {
config.onUpdate(registration);
}
} else {
// At this point, everything has been precached.
// It's the perfect time to display a
// "Content is cached for offline use." message.
console.log('Content is cached for offline use.');
// Execute callback
if (config && config.onSuccess) {
config.onSuccess(registration);
}
}
}
};
};
})
.catch(error => {
console.error('Error during service worker registration:', error);
});
}
function checkValidServiceWorker(swUrl, config) {
// Check if the service worker can be found. If it can't reload the page.
fetch(swUrl)
.then(response => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
response.status === 404 ||
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
navigator.serviceWorker.ready.then(registration => {
registration.unregister().then(() => {
window.location.reload();
});
});
} else {
// Service worker found. Proceed as normal.
registerValidSW(swUrl, config);
}
})
.catch(() => {
console.log(
'No internet connection found. App is running in offline mode.'
);
});
}
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then(registration => {
registration.unregister();
});
}
}

View File

@@ -22,7 +22,7 @@ import {
function App() {
return (
<Router>
<Navbar bg="light" expand="lg">
<Navbar bg="light" expand="sm">
<Navbar.Brand href="/"><img src={logo} className="App-logo" alt="logo" /></Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
@@ -34,7 +34,7 @@ function App() {
</Navbar.Collapse>
</Navbar>
<Container>
<Container fluid>
<Switch>
<Route path="/snapshots/single-source/" component={SnapshotsTable} />
<Route path="/snapshots/dir/:oid" component={DirectoryObject} />

BIN
icons/kopia-flat-512.icns Normal file
View File

Binary file not shown.

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="41"
viewBox="0 0 12.700008 10.847925"
version="1.1"
id="svg4919"
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
sodipodi:docname="kopia-flat-outline-win.svg"
inkscape:export-filename="/Users/jarek/Projects/Kopia/icons/kopia-flat-outline-512.png"
inkscape:export-xdpi="1044.7189"
inkscape:export-ydpi="1044.7189">
<defs
id="defs4913">
<linearGradient
osb:paint="gradient"
id="linearGradient4578">
<stop
id="stop4574"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop4576"
offset="1"
style="stop-color:#0066ff;stop-opacity:0;" />
</linearGradient>
<linearGradient
id="linearGradient2345"
osb:paint="gradient">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop2341" />
<stop
style="stop-color:#0066ff;stop-opacity:0;"
offset="1"
id="stop2343" />
</linearGradient>
</defs>
<sodipodi:namedview
inkscape:pagecheckerboard="false"
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.954549"
inkscape:cx="41.563439"
inkscape:cy="26.229304"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1440"
inkscape:window-height="802"
inkscape:window-x="0"
inkscape:window-y="23"
inkscape:window-maximized="0"
units="px"
width="64px"
showguides="false"
inkscape:snap-text-baseline="true"
inkscape:document-rotation="0" />
<metadata
id="metadata4916">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-280.06662)">
<g
id="g886"
transform="matrix(0.91418905,0,0,1.0238481,2.4854467,-12.30669)"
style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.57724;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;stop-opacity:1"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
inkscape:export-xdpi="9.5134048"
inkscape:export-ydpi="9.5134048">
<path
inkscape:export-ydpi="96"
inkscape:export-xdpi="96"
inkscape:connector-curvature="0"
id="rect4799-3"
d="m 3.68292,285.81102 a 3.7143042,4.7607871 0 0 1 3.2394206,2.43625 2.978621,3.8178297 0 0 1 0.9055101,-0.18217 2.978621,3.8178297 0 0 1 2.9786373,3.8177 2.978621,3.8178297 0 0 1 -2.6197318,3.78698 v 0.0308 H 7.8278507 0.29155891 v -10e-4 a 2.3864853,3.0588632 0 0 1 -0.31315577,0.0298 2.3864853,3.0588632 0 0 1 -2.38640124,-3.05891 2.3864853,3.0588632 0 0 1 2.38640124,-3.05891 2.3864853,3.0588632 0 0 1 0.07019771,0.002 3.7143042,4.7607871 0 0 1 3.63432355,-3.80321 z"
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.402099;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</g>
<g
transform="matrix(0.10137475,0.13378155,-0.08156495,0.16627331,4.8397104,271.89396)"
id="g10"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.68248179;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;stop-opacity:1"
inkscape:export-xdpi="9.5134048"
inkscape:export-ydpi="9.5134048"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png">
<g
id="g883"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.68248179;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:2.68248179;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
id="path8"
d="m 52.475497,57.904193 2.118969,-4.700554 c 0.258337,-0.573742 0.794452,-1.452559 1.188918,-1.952342 l 2.189741,-5.099694 c 0.171725,-0.02042 0.344927,-0.09102 0.466732,-0.194079 l 0.630265,-0.546749 c 0.243632,-0.206882 0.608139,-0.67108 0.736916,-0.95794 l 0.31965,-0.665782 c 0.05776,-0.130508 0.08615,-0.298735 0.08241,-0.463714 l 4.176599,-5.28537 c 0.206096,0.05958 0.452753,0.01539 0.625077,-0.131566 l 0.268535,-0.229977 c 0.242872,-0.207632 0.555873,-0.62096 0.686215,-0.907865 l 0.122894,-0.272803 c 0.08361,-0.186032 0.07645,-0.420341 0.0074,-0.621993 L 81.942439,16.980848 c 0.394443,-0.499011 -3.499736,2.827825 -4.003591,3.221242 L 63.158733,32.961034 c 0,0 -0.470077,-0.09048 -0.672002,2.42e-4 l -0.315191,0.142618 c -0.289847,0.131081 -0.692958,0.446742 -0.889398,0.696224 l -0.197198,0.248733 c -0.137168,0.173703 -0.173217,0.41621 -0.114352,0.619702 l -5.260067,4.10647 c -0.211006,-0.0255 -0.444855,0.0083 -0.614306,0.0842 l -0.765391,0.385589 c -0.289846,0.131081 -0.709835,0.462661 -0.906298,0.712915 l -0.479332,0.595593 c -0.106358,0.135778 -0.173913,0.333686 -0.180977,0.520579 l -4.899926,2.25652 c -0.503833,0.392646 -1.390045,0.927547 -1.970452,1.187416 l -5.715688,2.569121 c -0.579625,0.259846 -0.824906,1.000611 -0.618168,1.569324 0,0 0.927303,2.582054 3.611972,5.535017 l -2.71371,2.679373 c -0.644457,-0.484249 -0.865773,-0.265673 -1.130524,-0.0049 l -0.05151,0.05087 c -0.264752,0.260725 -0.48609,0.480073 0.0055,1.114567 l -3.777657,3.730903 c -0.643676,-0.484272 -0.865751,-0.266445 -1.129765,-0.0042 l -0.05148,0.0501 c -0.264751,0.260725 -0.485307,0.480051 0.0055,1.11534 L 22.80456,74.18879 c -0.113497,0.112842 1.950106,1.40756 1.950106,1.40756 l 11.27516,-10.990626 c 0.645262,0.483455 0.865773,0.265673 1.129742,0.005 l 0.05148,-0.0501 c 0.264774,-0.261497 0.486089,-0.480073 -0.0054,-1.116112 l 3.777612,-3.729358 c 0.643676,0.484272 0.865796,0.264901 1.129765,0.0042 l 0.05148,-0.0501 c 0.264797,-0.262269 0.48609,-0.480074 -0.0055,-1.11534 l 2.723413,-2.690456 c 3.01624,2.625495 6.011328,2.658358 6.011328,2.658358 0.577766,0.201527 1.322586,-0.04231 1.581751,-0.617623 z"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="114.26369"
inkscape:export-xdpi="114.26369"
inkscape:export-filename="/Users/jarek/Projects/Kopia/icons/kopia-mac-tray@2x.png"
sodipodi:docname="kopia-flat-mono.svg"
inkscape:version="1.0beta1 (32d4812, 2019-09-19)"
id="svg4919"
version="1.1"
viewBox="0 0 12.700008 8.2020885"
height="31"
width="48">
<defs
id="defs4913">
<linearGradient
id="linearGradient4578"
osb:paint="gradient">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop4574" />
<stop
style="stop-color:#0066ff;stop-opacity:0;"
offset="1"
id="stop4576" />
</linearGradient>
<linearGradient
osb:paint="gradient"
id="linearGradient2345">
<stop
id="stop2341"
offset="0"
style="stop-color:#000000;stop-opacity:1;" />
<stop
id="stop2343"
offset="1"
style="stop-color:#0066ff;stop-opacity:0;" />
</linearGradient>
</defs>
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:snap-text-baseline="true"
showguides="false"
width="64px"
units="px"
inkscape:window-maximized="0"
inkscape:window-y="23"
inkscape:window-x="0"
inkscape:window-height="800"
inkscape:window-width="1440"
showgrid="false"
inkscape:current-layer="layer1"
inkscape:document-units="mm"
inkscape:cy="18.072776"
inkscape:cx="27.83667"
inkscape:zoom="13.058315"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:pagecheckerboard="false" />
<metadata
id="metadata4916">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(0,-280.06662)"
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Layer 1">
<g
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
style="opacity:1;fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.57724;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0;stop-opacity:1"
transform="matrix(0.91418905,0,0,0.93666123,2.4854467,12.612219)"
id="g886">
<path
style="fill:#f9f9f9;fill-opacity:1;stroke:#000000;stroke-width:0.365129;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 3.68292,285.81098 a 3.7143042,3.9255907 0 0 1 3.2394206,2.00885 2.978621,3.1480586 0 0 1 0.9055101,-0.15021 2.978621,3.1480586 0 0 1 2.9786373,3.14795 2.978621,3.1480586 0 0 1 -2.6197318,3.12262 v 0.0254 H 7.8278507 0.29155891 v -8.5e-4 a 2.3864853,2.5222394 0 0 1 -0.31315577,0.0246 2.3864853,2.5222394 0 0 1 -2.38640124,-2.52228 2.3864853,2.5222394 0 0 1 2.38640124,-2.52228 2.3864853,2.5222394 0 0 1 0.07019771,0.002 3.7143042,3.9255907 0 0 1 3.63432355,-3.136 z"
id="rect4799-3"
inkscape:connector-curvature="0"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96" />
</g>
<g
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.280131;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;stop-opacity:1"
id="g10"
transform="matrix(0.10137475,0.13378155,-0.08156495,0.16627331,4.8397104,270.30645)">
<g
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.280131;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="g883">
<path
inkscape:connector-curvature="0"
d="m 52.475497,57.904193 2.118969,-4.700554 c 0.258337,-0.573742 0.794452,-1.452559 1.188918,-1.952342 l 2.189741,-5.099694 c 0.171725,-0.02042 0.344927,-0.09102 0.466732,-0.194079 l 0.630265,-0.546749 c 0.243632,-0.206882 0.608139,-0.67108 0.736916,-0.95794 l 0.31965,-0.665782 c 0.05776,-0.130508 0.08615,-0.298735 0.08241,-0.463714 l 4.176599,-5.28537 c 0.206096,0.05958 0.452753,0.01539 0.625077,-0.131566 l 0.268535,-0.229977 c 0.242872,-0.207632 0.555873,-0.62096 0.686215,-0.907865 l 0.122894,-0.272803 c 0.08361,-0.186032 0.07645,-0.420341 0.0074,-0.621993 L 81.942439,16.980848 c 0.394443,-0.499011 -3.499736,2.827825 -4.003591,3.221242 L 63.158733,32.961034 c 0,0 -0.470077,-0.09048 -0.672002,2.42e-4 l -0.315191,0.142618 c -0.289847,0.131081 -0.692958,0.446742 -0.889398,0.696224 l -0.197198,0.248733 c -0.137168,0.173703 -0.173217,0.41621 -0.114352,0.619702 l -5.260067,4.10647 c -0.211006,-0.0255 -0.444855,0.0083 -0.614306,0.0842 l -0.765391,0.385589 c -0.289846,0.131081 -0.709835,0.462661 -0.906298,0.712915 l -0.479332,0.595593 c -0.106358,0.135778 -0.173913,0.333686 -0.180977,0.520579 l -4.899926,2.25652 c -0.503833,0.392646 -1.390045,0.927547 -1.970452,1.187416 l -5.715688,2.569121 c -0.579625,0.259846 -0.824906,1.000611 -0.618168,1.569324 0,0 0.927303,2.582054 3.611972,5.535017 l -2.71371,2.679373 c -0.644457,-0.484249 -0.865773,-0.265673 -1.130524,-0.0049 l -0.05151,0.05087 c -0.264752,0.260725 -0.48609,0.480073 0.0055,1.114567 l -3.777657,3.730903 c -0.643676,-0.484272 -0.865751,-0.266445 -1.129765,-0.0042 l -0.05148,0.0501 c -0.264751,0.260725 -0.485307,0.480051 0.0055,1.11534 L 22.80456,74.18879 c -0.113497,0.112842 1.950106,1.40756 1.950106,1.40756 l 11.27516,-10.990626 c 0.645262,0.483455 0.865773,0.265673 1.129742,0.005 l 0.05148,-0.0501 c 0.264774,-0.261497 0.486089,-0.480073 -0.0054,-1.116112 l 3.777612,-3.729358 c 0.643676,0.484272 0.865796,0.264901 1.129765,0.0042 l 0.05148,-0.0501 c 0.264797,-0.262269 0.48609,-0.480074 -0.0055,-1.11534 l 2.723413,-2.690456 c 3.01624,2.625495 6.011328,2.658358 6.011328,2.658358 0.577766,0.201527 1.322586,-0.04231 1.581751,-0.617623 z"
id="path8"
sodipodi:nodetypes="ccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.386847;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
</g>
</g>
<ellipse
inkscape:export-ydpi="9.5134048"
inkscape:export-xdpi="9.5134048"
inkscape:export-filename="/Users/jarek/Projects/kopia-app/icons/converted/g886.png"
ry="0.071419567"
rx="0.075612754"
cy="286.46222"
cx="8.8220901"
id="path876"
style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:#00ff00;stroke-width:0.00833572;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;stop-opacity:1" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

0
icons/kopia-flat.icns Normal file
View File

BIN
icons/kopia-mac-tray.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

BIN
icons/kopia-mac-tray@2x.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -6,6 +6,7 @@ uname := $(shell uname -s)
GOLANGCI_LINT_VERSION=v1.22.2
NODE_VERSION=12.13.0
HUGO_VERSION=0.59.1
GORELEASER_VERSION=v0.125.0
# goveralls
GOVERALLS_TOOL=$(TOOLS_DIR)/bin/goveralls
@@ -54,5 +55,12 @@ else
curl -LsS https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_extended_$(HUGO_VERSION)_macOS-64bit.tar.gz | tar zxv -C $(TOOLS_DIR)/hugo
endif
# linter
GORELEASER_TOOL=$(TOOLS_DIR)/goreleaser-$(GORELEASER_VERSION)/goreleaser
$(GORELEASER_TOOL):
mkdir -p $(TOOLS_DIR)/goreleaser-$(GORELEASER_VERSION)
curl -LsS https://github.com/goreleaser/goreleaser/releases/download/$(GORELEASER_VERSION)/goreleaser_$$(uname -s)_$$(uname -m).tar.gz | tar zx -C $(TOOLS_DIR)/goreleaser-$(GORELEASER_VERSION)
clean-tools:
rm -rf $(TOOLS_DIR)