@tasenor/common-plugins 1.10.28 → 1.10.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-ci.log +2 -2
- package/.turbo/turbo-nightly.log +3 -3
- package/.turbo/turbo-nightly3.log +60 -0
- package/dist/GitBackup/backend/index.js +1 -1
- package/dist/GitBackup/ui/index.d.ts +1 -1
- package/dist/GitBackup/ui/index.js +20 -9
- package/dist/GitBackup/ui/index.js.map +1 -1
- package/package.json +5 -5
- package/src/GitBackup/backend/index.ts +1 -1
- package/src/GitBackup/ui/index.tsx +38 -10
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-ci.log
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @tasenor/common-plugins@1.10.
|
|
2
|
+
> @tasenor/common-plugins@1.10.29 ci /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
3
3
|
> pnpm run lint
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @tasenor/common-plugins@1.10.
|
|
6
|
+
> @tasenor/common-plugins@1.10.29 lint /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
7
7
|
> eslint 'src/**/*.{ts,tsx}' 'data/**/*.mjs'
|
|
8
8
|
|
package/.turbo/turbo-nightly.log
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
> @tasenor/common-plugins@1.10.
|
|
2
|
+
> @tasenor/common-plugins@1.10.28 nightly /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
3
3
|
> pnpm run ci
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @tasenor/common-plugins@1.10.
|
|
6
|
+
> @tasenor/common-plugins@1.10.28 ci /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
7
7
|
> pnpm run lint
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> @tasenor/common-plugins@1.10.
|
|
10
|
+
> @tasenor/common-plugins@1.10.28 lint /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
11
11
|
> eslint 'src/**/*.{ts,tsx}' 'data/**/*.mjs'
|
|
12
12
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
> @tasenor/common-plugins@1.10.28 nightly3 /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
3
|
+
> pnpm run data
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @tasenor/common-plugins@1.10.28 data /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins
|
|
7
|
+
> data/bin/build_all
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishBalanceSheetReportLite.mjs
|
|
11
|
+
|
|
12
|
+
2024-02-07T09:42:46.464Z Saved text data to src/FinnishBalanceSheetReportLite/backend/balance-sheet-lite-fi.tsv
|
|
13
|
+
2024-02-07T09:42:46.465Z Saved text data to src/FinnishBalanceSheetReportLite/backend/balance-sheet-lite-en.tsv
|
|
14
|
+
|
|
15
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishBalanceSheetReport.mjs
|
|
16
|
+
|
|
17
|
+
2024-02-07T09:42:47.667Z Saved text data to src/FinnishBalanceSheetReport/backend/balance-sheet-fi.tsv
|
|
18
|
+
2024-02-07T09:42:47.668Z Saved text data to src/FinnishBalanceSheetReport/backend/balance-sheet-detailed-fi.tsv
|
|
19
|
+
|
|
20
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishIncomeStatementReportLite.mjs
|
|
21
|
+
|
|
22
|
+
2024-02-07T09:42:48.851Z Saved text data to src/FinnishIncomeStatementReportLite/backend/income-statement-lite-fi.tsv
|
|
23
|
+
2024-02-07T09:42:48.851Z Saved text data to src/FinnishIncomeStatementReportLite/backend/income-statement-lite-en.tsv
|
|
24
|
+
|
|
25
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishIncomeStatementReport.mjs
|
|
26
|
+
|
|
27
|
+
2024-02-07T09:42:50.043Z Saved text data to src/FinnishIncomeStatementReport/backend/income-statement-fi.tsv
|
|
28
|
+
2024-02-07T09:42:50.044Z Saved text data to src/FinnishIncomeStatementReport/backend/income-statement-detailed-fi.tsv
|
|
29
|
+
|
|
30
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishLimitedCompanyComplete.mjs
|
|
31
|
+
|
|
32
|
+
2024-02-07T09:42:51.270Z Saved data to src/FinnishLimitedCompanyComplete/backend/fi-EUR.tsv
|
|
33
|
+
|
|
34
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/FinnishLimitedCompanyLite.mjs
|
|
35
|
+
|
|
36
|
+
2024-02-07T09:42:52.512Z Saved data to src/FinnishLimitedCompanyLite/backend/fi-EUR.tsv
|
|
37
|
+
2024-02-07T09:42:52.513Z Saved data to src/FinnishLimitedCompanyLite/backend/en-EUR.tsv
|
|
38
|
+
|
|
39
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/IncomeAndExpenses.mjs
|
|
40
|
+
|
|
41
|
+
2024-02-07T09:42:53.720Z Saved JSON data to src/IncomeAndExpenses/backend/income.json
|
|
42
|
+
2024-02-07T09:42:53.721Z Saved JSON data to src/IncomeAndExpenses/backend/expense.json
|
|
43
|
+
2024-02-07T09:42:53.721Z Saved JSON data to src/IncomeAndExpenses/backend/assetCodes.json
|
|
44
|
+
2024-02-07T09:42:53.722Z Saved JSON data to src/IncomeAndExpenses/backend/taxTypes.json
|
|
45
|
+
2024-02-07T09:42:53.722Z Refreshed translation data in src/IncomeAndExpenses/backend/index.ts
|
|
46
|
+
2024-02-07T09:42:53.722Z Saved data to ../tasenor-common/src/types/income.ts
|
|
47
|
+
2024-02-07T09:42:53.723Z Saved data to ../tasenor-common/src/types/expense.ts
|
|
48
|
+
2024-02-07T09:42:53.723Z Saved data to ../tasenor-common/src/types/assetCodes.ts
|
|
49
|
+
|
|
50
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/PluginIndex.mjs
|
|
51
|
+
|
|
52
|
+
2024-02-07T09:42:54.293Z Saved plugin index to /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/src/index.ts
|
|
53
|
+
|
|
54
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/TickerData.mjs
|
|
55
|
+
|
|
56
|
+
2024-02-07T09:42:55.478Z Saved JSON data to src/TickerData/backend/currencies.json
|
|
57
|
+
|
|
58
|
+
Running /home/ci/tasenor-qa/tasenor-bookkeeper/packages/tasenor-common-plugins/data/VATFinland.mjs
|
|
59
|
+
|
|
60
|
+
2024-02-07T09:42:56.687Z Saved JSON data to src/VATFinland/backend/vat.json
|
|
@@ -7,7 +7,7 @@ class GitBackup extends ToolPlugin {
|
|
|
7
7
|
super();
|
|
8
8
|
this.code = 'GitBackup';
|
|
9
9
|
this.title = 'Backup for Git';
|
|
10
|
-
this.version = '1.0.
|
|
10
|
+
this.version = '1.0.3';
|
|
11
11
|
this.icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path></svg>';
|
|
12
12
|
this.releaseDate = '2022-12-12';
|
|
13
13
|
this.use = 'both';
|
|
@@ -16,7 +16,7 @@ declare class GitBackup extends ToolPlugin {
|
|
|
16
16
|
disabled: boolean;
|
|
17
17
|
}[];
|
|
18
18
|
toolTitle(): string;
|
|
19
|
-
onMakeBackup(): Promise<void>;
|
|
19
|
+
onMakeBackup(message: string): Promise<void>;
|
|
20
20
|
toolTopPanel(): JSX.Element;
|
|
21
21
|
toolMainPanel(): JSX.Element;
|
|
22
22
|
getSettings(): {
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Note, IconButton, SubPanel, ToolPlugin } from '@tasenor/common-ui';
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import { Note, IconButton, SubPanel, ToolPlugin, Dialog } from '@tasenor/common-ui';
|
|
3
3
|
import { makeObservable, observable, runInAction } from 'mobx';
|
|
4
|
-
import { Trans } from 'react-i18next';
|
|
4
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
5
|
+
import { TextField } from '@mui/material';
|
|
6
|
+
function MakeBackupIcon(props) {
|
|
7
|
+
const { disabled, onMakeBackup } = props;
|
|
8
|
+
const [askMessage, setAskMessage] = useState(false);
|
|
9
|
+
const [message, setMessage] = useState('');
|
|
10
|
+
const { t } = useTranslation();
|
|
11
|
+
const val = useRef(message); // For some reason the message is not up to date when enter pressed on dialog.
|
|
12
|
+
return React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement(Dialog, { wider: true, isVisible: askMessage, title: t('Comment for Git Commit'), onClose: () => setAskMessage(false), onConfirm: () => onMakeBackup(val.current.trim()) },
|
|
14
|
+
React.createElement(TextField, { fullWidth: true, autoFocus: true, value: val.current, onChange: (e) => { setMessage(e.target.value); val.current = e.target.value; } })),
|
|
15
|
+
React.createElement(IconButton, { id: "Make Backup", disabled: disabled, onClick: () => setAskMessage(true), title: "summarize-make-backup", icon: "save" }));
|
|
16
|
+
}
|
|
5
17
|
class GitBackup extends ToolPlugin {
|
|
6
18
|
busy = false;
|
|
7
19
|
static code = 'GitBackup';
|
|
8
20
|
static title = 'Backup for Git';
|
|
9
|
-
static version = '1.0.
|
|
21
|
+
static version = '1.0.3';
|
|
10
22
|
static icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path></svg>';
|
|
11
23
|
static releaseDate = '2022-12-12';
|
|
12
24
|
static use = 'both';
|
|
@@ -23,12 +35,12 @@ class GitBackup extends ToolPlugin {
|
|
|
23
35
|
'label-repository': 'Repository URL',
|
|
24
36
|
'label-subDirectory': 'Subdirectory inside the repository',
|
|
25
37
|
'label-sshPrivateKey': 'SSH private key',
|
|
26
|
-
'label-sshPublicKey': 'SSH public key',
|
|
27
38
|
'icon-summarize-make-backup': 'Make a backup'
|
|
28
39
|
},
|
|
29
40
|
fi: {
|
|
30
41
|
'label-repository': 'Git-säilön URL',
|
|
31
42
|
'label-subDirectory': 'Alihakemiston nimi säilön sisällä',
|
|
43
|
+
'label-sshPrivateKey': 'SSH yksityinen avain',
|
|
32
44
|
'icon-summarize-make-backup': 'Tee varmuuskopio',
|
|
33
45
|
'Backup for Git': 'Git-pohjainen Varmuuskopiointi',
|
|
34
46
|
'Manual backup by GitBackup {version}': 'Ylimääräinen varmuuskopio GitBackup {version}',
|
|
@@ -43,9 +55,9 @@ class GitBackup extends ToolPlugin {
|
|
|
43
55
|
toolTitle() {
|
|
44
56
|
return 'Backup for Git';
|
|
45
57
|
}
|
|
46
|
-
async onMakeBackup() {
|
|
58
|
+
async onMakeBackup(message) {
|
|
47
59
|
runInAction(() => (this.busy = true));
|
|
48
|
-
const { success } = await this.POST({ makeBackup: this.t('Manual backup by GitBackup {version}').replace('{version}', GitBackup.version) });
|
|
60
|
+
const { success } = await this.POST({ makeBackup: message || this.t('Manual backup by GitBackup {version}').replace('{version}', GitBackup.version) });
|
|
49
61
|
runInAction(() => {
|
|
50
62
|
this.busy = false;
|
|
51
63
|
if (success) {
|
|
@@ -58,8 +70,7 @@ class GitBackup extends ToolPlugin {
|
|
|
58
70
|
}
|
|
59
71
|
toolTopPanel() {
|
|
60
72
|
const repo = this.getSetting('repository');
|
|
61
|
-
return React.createElement(
|
|
62
|
-
React.createElement(IconButton, { id: "Make Backup", disabled: this.busy || !repo, onClick: () => this.onMakeBackup(), title: "summarize-make-backup", icon: "save" }));
|
|
73
|
+
return React.createElement(MakeBackupIcon, { disabled: !repo || this.busy, onMakeBackup: (msg) => this.onMakeBackup(msg) });
|
|
63
74
|
}
|
|
64
75
|
toolMainPanel() {
|
|
65
76
|
const repo = this.getSetting('repository');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/GitBackup/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/GitBackup/ui/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAOzC,SAAS,cAAc,CAAC,KAA0B;IAChD,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,KAAK,CAAA;IACxC,MAAM,CAAC,UAAU,EAAE,a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;oBACZ,IAAI,EAAE,YAAY;oBAClB,OAAO,EAAE,EAAE;iBACZ;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,cAAc;oBACpB,OAAO,EAAE,EAAE;iBACZ;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,eAAe;oBACrB,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,EAAE;iBACZ;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,MAAM;oBACb,OAAO,EAAE;wBACP,OAAO,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE;qBACvD;iBACF;aACF;SACF,CAAA;IACH,CAAC;;AAGH,eAAe,SAAS,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tasenor/common-plugins",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.30",
|
|
4
4
|
"description": "Shared common plugins of Tasenor project",
|
|
5
5
|
"repository": "git@github.com:dataplugoy/tasenor-bookkeeper.git",
|
|
6
6
|
"author": "Tommi Ronkainen <tommi.ronkainen@gmail.com>",
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"dayjs": "1.10.8",
|
|
14
14
|
"sprintf-js": "^1.1.2",
|
|
15
15
|
"tsx": "^4.7.0",
|
|
16
|
-
"@tasenor/common": "1.10.
|
|
17
|
-
"@tasenor/common-
|
|
18
|
-
"@tasenor/common-
|
|
16
|
+
"@tasenor/common": "1.10.30",
|
|
17
|
+
"@tasenor/common-node": "1.10.30",
|
|
18
|
+
"@tasenor/common-ui": "1.10.30"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@mui/icons-material": "^5.14.1",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"react-i18next": "^13.0.2",
|
|
32
32
|
"react-router-dom": "^6.14.1",
|
|
33
33
|
"typescript": "^5.1.6",
|
|
34
|
-
"@tasenor/config": "1.10.
|
|
34
|
+
"@tasenor/config": "1.10.30",
|
|
35
35
|
"eslint-config-tasenor": "0.0.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -9,7 +9,7 @@ class GitBackup extends ToolPlugin {
|
|
|
9
9
|
|
|
10
10
|
this.code = 'GitBackup'as PluginCode
|
|
11
11
|
this.title = 'Backup for Git'
|
|
12
|
-
this.version = '1.0.
|
|
12
|
+
this.version = '1.0.3' as Version
|
|
13
13
|
this.icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path></svg>'
|
|
14
14
|
this.releaseDate = '2022-12-12'
|
|
15
15
|
this.use = 'both'
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { Note, IconButton, SubPanel, ToolPlugin } from '@tasenor/common-ui'
|
|
1
|
+
import React, { useState, useRef } from 'react'
|
|
2
|
+
import { Note, IconButton, SubPanel, ToolPlugin, Dialog } from '@tasenor/common-ui'
|
|
3
3
|
import { makeObservable, observable, runInAction } from 'mobx'
|
|
4
|
-
import { Trans } from 'react-i18next'
|
|
4
|
+
import { Trans, useTranslation } from 'react-i18next'
|
|
5
|
+
import { TextField } from '@mui/material'
|
|
6
|
+
|
|
7
|
+
interface MakeBackupIconProps {
|
|
8
|
+
disabled: boolean
|
|
9
|
+
onMakeBackup: (string) => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function MakeBackupIcon(props: MakeBackupIconProps) {
|
|
13
|
+
const { disabled, onMakeBackup } = props
|
|
14
|
+
const [askMessage, setAskMessage] = useState(false)
|
|
15
|
+
const [message, setMessage] = useState('')
|
|
16
|
+
const { t } = useTranslation()
|
|
17
|
+
const val = useRef(message) // For some reason the message is not up to date when enter pressed on dialog.
|
|
18
|
+
|
|
19
|
+
return <>
|
|
20
|
+
{
|
|
21
|
+
<Dialog
|
|
22
|
+
wider
|
|
23
|
+
isVisible={askMessage}
|
|
24
|
+
title={t('Comment for Git Commit')} onClose={() =>
|
|
25
|
+
setAskMessage(false)}
|
|
26
|
+
onConfirm={() => onMakeBackup(val.current.trim())}
|
|
27
|
+
>
|
|
28
|
+
<TextField fullWidth autoFocus value={val.current} onChange={(e) => { setMessage(e.target.value); val.current = e.target.value }}/>
|
|
29
|
+
</Dialog>
|
|
30
|
+
}
|
|
31
|
+
<IconButton id="Make Backup" disabled={disabled} onClick={() => setAskMessage(true)} title="summarize-make-backup" icon="save" />
|
|
32
|
+
</>
|
|
33
|
+
|
|
34
|
+
}
|
|
5
35
|
|
|
6
36
|
class GitBackup extends ToolPlugin {
|
|
7
37
|
|
|
@@ -9,7 +39,7 @@ class GitBackup extends ToolPlugin {
|
|
|
9
39
|
|
|
10
40
|
static code = 'GitBackup'
|
|
11
41
|
static title = 'Backup for Git'
|
|
12
|
-
static version = '1.0.
|
|
42
|
+
static version = '1.0.3'
|
|
13
43
|
static icon = '<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"></path></svg>'
|
|
14
44
|
static releaseDate = '2022-12-12'
|
|
15
45
|
static use = 'both'
|
|
@@ -29,12 +59,12 @@ class GitBackup extends ToolPlugin {
|
|
|
29
59
|
'label-repository': 'Repository URL',
|
|
30
60
|
'label-subDirectory': 'Subdirectory inside the repository',
|
|
31
61
|
'label-sshPrivateKey': 'SSH private key',
|
|
32
|
-
'label-sshPublicKey': 'SSH public key',
|
|
33
62
|
'icon-summarize-make-backup': 'Make a backup'
|
|
34
63
|
},
|
|
35
64
|
fi: {
|
|
36
65
|
'label-repository': 'Git-säilön URL',
|
|
37
66
|
'label-subDirectory': 'Alihakemiston nimi säilön sisällä',
|
|
67
|
+
'label-sshPrivateKey': 'SSH yksityinen avain',
|
|
38
68
|
'icon-summarize-make-backup': 'Tee varmuuskopio',
|
|
39
69
|
|
|
40
70
|
'Backup for Git': 'Git-pohjainen Varmuuskopiointi',
|
|
@@ -54,9 +84,9 @@ class GitBackup extends ToolPlugin {
|
|
|
54
84
|
return 'Backup for Git'
|
|
55
85
|
}
|
|
56
86
|
|
|
57
|
-
async onMakeBackup() {
|
|
87
|
+
async onMakeBackup(message: string) {
|
|
58
88
|
runInAction(() => (this.busy = true))
|
|
59
|
-
const { success } = await this.POST({ makeBackup: this.t('Manual backup by GitBackup {version}').replace('{version}', GitBackup.version) }) as { success: boolean }
|
|
89
|
+
const { success } = await this.POST({ makeBackup: message || this.t('Manual backup by GitBackup {version}').replace('{version}', GitBackup.version) }) as { success: boolean }
|
|
60
90
|
runInAction(() => {
|
|
61
91
|
this.busy = false
|
|
62
92
|
if (success) {
|
|
@@ -69,9 +99,7 @@ class GitBackup extends ToolPlugin {
|
|
|
69
99
|
|
|
70
100
|
toolTopPanel() {
|
|
71
101
|
const repo = this.getSetting('repository')
|
|
72
|
-
return
|
|
73
|
-
<IconButton id="Make Backup" disabled={this.busy || !repo} onClick={() => this.onMakeBackup()} title="summarize-make-backup" icon="save" />
|
|
74
|
-
</>
|
|
102
|
+
return <MakeBackupIcon disabled={!repo || this.busy} onMakeBackup={(msg) => this.onMakeBackup(msg)} />
|
|
75
103
|
}
|
|
76
104
|
|
|
77
105
|
toolMainPanel() {
|