Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3334122
PMM-10503 add radio buttons to modal
fabio-silva Aug 19, 2022
8b4bab3
PMM-10503 change view based on form and call API
fabio-silva Aug 19, 2022
4baf662
PMM-10496-fix-Promote-Portal-k8s-cluster-message-on-refresh: fixed ap…
solovevayaroslavna Aug 29, 2022
f441d80
PMM-10517: allow physical backups (#485)
fabio-silva Aug 30, 2022
8760232
PMM-10503 simplify isScheduledBackup
fabio-silva Aug 24, 2022
5977a10
PMM-10503 send text to msg file
fabio-silva Aug 24, 2022
eaaa4c4
PMM-10349 DBaaS easy access to deploy button (#483)
solovevayaroslavna Aug 31, 2022
62ddabc
PMM-10503 fix prettier warning
fabio-silva Sep 21, 2022
5c49601
PMM-10599 Changed backup add modal to page
filipmikes1 Sep 1, 2022
71e59a1
PMM-10599 Added query params., new component
filipmikes1 Sep 2, 2022
e99bcfe
PMM-10599 Changed schleduled check to query params
filipmikes1 Sep 5, 2022
30f11fc
PMM-10599 Make addBackupModal working again
filipmikes1 Sep 5, 2022
fe408a5
PMM-10599 added support for edit backup
filipmikes1 Sep 5, 2022
ccd3415
PMM-10599 working version, redirect edit buttons
filipmikes1 Sep 5, 2022
9560e2b
PMM-10599 code refactor
filipmikes1 Sep 5, 2022
dec7dc5
PMM-10599 improved demand backup design
filipmikes1 Sep 6, 2022
edd5e7f
PMM-10599 Added advance settings
filipmikes1 Sep 7, 2022
84cb40b
PMM-10599 Improve design of time
filipmikes1 Sep 7, 2022
552b9cd
PMM-10599 Improved spacing
filipmikes1 Sep 7, 2022
22150df
PMM-10599 Improved retry mode design
filipmikes1 Sep 7, 2022
5a27cf9
PMM-10599 Changed spacing to grafana's one
filipmikes1 Sep 8, 2022
e3c36e7
PMM-10599 moved types to separate files
filipmikes1 Sep 8, 2022
544579a
PMM-10599 improved design
filipmikes1 Sep 9, 2022
13ca2f8
PMM-10064 inventory list pagination (#481)
matejkubinec Sep 8, 2022
e6f22fe
PMM-10599 changed buttons position, sticky header
filipmikes1 Sep 21, 2022
2ff7b6e
PMM-10599 fixed imports order and eslint errors
filipmikes1 Sep 26, 2022
d4c1a80
PMM-10599 fixed submit error
filipmikes1 Sep 26, 2022
d6263e8
PMM-10599 fixed deletion of values
filipmikes1 Sep 27, 2022
0b326cc
Merge branch 'main' into pmm-10599-change-backup-modals-to-separate-p…
filipmikes1 Sep 30, 2022
b25b863
PMM-10599 Added tests
filipmikes1 Sep 30, 2022
e3ab322
PMM-10599 Fixed issue with datamodel
filipmikes1 Oct 4, 2022
f7a6194
PMM-10599 removed console.log
filipmikes1 Oct 4, 2022
a755670
PMM-10599 fixes after review
filipmikes1 Oct 7, 2022
5c556a4
PMM-10599 removed hardcoded breakpoint
filipmikes1 Oct 7, 2022
0ee10fb
Merge branch 'main' into pmm-10599-change-backup-modals-to-separate-p…
filipmikes1 Oct 7, 2022
456a088
PMM-10599 removed unused import
filipmikes1 Oct 12, 2022
c4fe6a1
PMM-10599 fix of tests
filipmikes1 Oct 12, 2022
1c9fea6
merge main
filipmikes1 Oct 20, 2022
5f596c2
Merge branch 'main' into pmm-10599-change-backup-modals-to-separate-p…
fabio-silva Oct 20, 2022
5547f49
fix: do not wrap labels
fabio-silva Oct 20, 2022
657c3f0
PMM-10599: fix close order of modal
fabio-silva Oct 20, 2022
e36a7cd
PMM-10599 fix labels height
fabio-silva Oct 20, 2022
11a489a
PMM-10599 fix unit tests
fabio-silva Oct 20, 2022
4b81658
PMM-10599 update deps
fabio-silva Oct 20, 2022
ed90eba
fix: bad delete modal text
fabio-silva Oct 21, 2022
bc64621
Merge branch 'main' into pmm-10599-change-backup-modals-to-separate-p…
vyarosh Oct 21, 2022
feb926c
feat: add data-testid to advanced section
fabio-silva Oct 22, 2022
acc9805
Merge branch 'pmm-10599-change-backup-modals-to-separate-pages' of ht…
fabio-silva Oct 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
2 changes: 1 addition & 1 deletion .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Manual changes might be lost!

integrations:
- vim
- vscode
- vim
4 changes: 2 additions & 2 deletions .yarn/sdks/prettier/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/lib/tsserver.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const moduleWrapper = tsserver => {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const moduleWrapper = tsserver => {
if (!process.versions.pnp) {
Expand Down
4 changes: 2 additions & 2 deletions .yarn/sdks/typescript/lib/typescript.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, createRequireFromPath} = require(`module`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = (createRequire || createRequireFromPath)(absPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"@opentelemetry/api": "1.1.0",
"@opentelemetry/exporter-collector": "0.25.0",
"@opentelemetry/semantic-conventions": "1.5.0",
"@percona/platform-core": "1.0.8",
"@percona/platform-core": "^1.0.9",
"@popperjs/core": "2.11.5",
"@react-aria/button": "3.5.1",
"@react-aria/dialog": "3.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface Props {
labelId?: string;
// @Percona
controlled?: boolean;
buttonDataTestId?: string;
}

export const CollapsableSection: FC<Props> = ({
Expand All @@ -32,6 +33,7 @@ export const CollapsableSection: FC<Props> = ({
labelId,
loading = false,
controlled = false,
buttonDataTestId,
}) => {
const [open, toggleOpen] = useState<boolean>(isOpen);
const styles = useStyles2(collapsableSectionStyles);
Expand Down Expand Up @@ -67,6 +69,7 @@ export const CollapsableSection: FC<Props> = ({
aria-expanded={open && !loading}
aria-controls={`collapse-content-${id}`}
aria-labelledby={buttonLabelId}
data-testid={buttonDataTestId}
>
{loading ? (
<Spinner className={styles.spinner} />
Expand Down
3 changes: 3 additions & 0 deletions public/app/percona/backup/Backup.constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const NEW_BACKUP_URL = '/backup/new';
export const BACKUP_SCHEDULED_URL = '/backup/scheduled';
export const BACKUP_INVENTORY_URL = '/backup/inventory';
4 changes: 4 additions & 0 deletions public/app/percona/backup/Backup.messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const Messages = {
createScheduledBackup: 'Create scheduled backup',
backupManagement: 'Backup Management',
backupInventory: {
newBackup: 'New backup',
table: {
noData: 'No backups found',
columns: {
Expand Down Expand Up @@ -43,6 +44,8 @@ export const Messages = {
"For security reasons, we won't delete this backup from the filesystem. Please make sure to manually remove it.",
getLogsTitle: (name: string) => `Backup logs for ${name}`,
getDeleteMessage: (name: string) => `Are you sure you want to delete "${name}"?`,
addSuccess: 'Backup successfully created',
getDeleteSuccess: (name: string) => `Backup "${name}" successfully deleted.`,
},
restoreHistory: {
table: {
Expand Down Expand Up @@ -70,6 +73,7 @@ export const Messages = {
getDeleteSuccess: (name: string) => `Backup location "${name}" successfully deleted.`,
},
scheduledBackups: {
newScheduledBackup: 'New Scheduled Backup',
table: {
noData: 'No scheduled backups found',
columns: {
Expand Down
159 changes: 159 additions & 0 deletions public/app/percona/backup/Backup.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
import { CancelToken } from 'axios';

import { api } from 'app/percona/shared/helpers/api';

import { getCronStringFromValues } from '../shared/helpers/cron/cron';

import { BackupMode, BackupType, DataModel, RetryMode } from './Backup.types';
import { AddBackupFormProps } from './components/AddBackupPage/AddBackupPage.types';

const BASE_URL = '/v1/management/backup/Backups';

export const BackupService = {
backup(values: AddBackupFormProps, token?: CancelToken) {
const {
id,
service,
location,
period,
month,
day,
weekDay,
startHour,
startMinute,
backupName,
description,
retryMode,
retryInterval,
retryTimes,
active,
retention,
mode,
type,
dataModel,
} = values;
const strRetryInterval = `${retryInterval}s`;
const resultRetryTimes = retryMode === RetryMode.MANUAL ? 0 : retryTimes;

if (type === BackupType.DEMAND) {
return this.triggerBackup(
service!.value?.id || '',
location!.value || '',
backupName,
description,
strRetryInterval,
resultRetryTimes!,
dataModel,
token
);
} else {
const cronExpression = getCronStringFromValues(
period!.value!,
month!.map((m) => m.value!),
day!.map((m) => m.value!),
weekDay!.map((m) => m.value!),
startHour!.map((m) => m.value!),
startMinute!.map((m) => m.value!)
);
if (id) {
return this.changeScheduleBackup(
id,
active!,
cronExpression,
backupName,
description,
strRetryInterval,
resultRetryTimes!,
retention!
);
} else {
return this.scheduleBackup(
service!.value?.id!,
location!.value!,
cronExpression,
backupName,
description,
strRetryInterval,
resultRetryTimes!,
retention!,
active!,
mode,
dataModel
);
}
}
},
async triggerBackup(
serviceId: string,
locationId: string,
name: string,
description: string,
retryInterval: string,
retryTimes: number,
dataModel: DataModel,
token?: CancelToken
) {
return api.post(
`${BASE_URL}/Start`,
{
service_id: serviceId,
location_id: locationId,
name,
description,
retry_interval: retryInterval,
retries: retryTimes,
data_model: dataModel,
},
false,
token
);
},
async scheduleBackup(
serviceId: string,
locationId: string,
cronExpression: string,
name: string,
description: string,
retryInterval: string,
retryTimes: number,
retention: number,
enabled: boolean,
mode: BackupMode,
dataModel: DataModel
) {
return api.post(`${BASE_URL}/Schedule`, {
service_id: serviceId,
location_id: locationId,
cron_expression: cronExpression,
name,
description,
retry_interval: retryInterval,
retries: retryTimes,
enabled: !!enabled,
retention,
mode,
data_model: dataModel,
});
},
async changeScheduleBackup(
id: string,
enabled: boolean,
cronExpression: string,
name: string,
description: string,
retryInterval: string,
retryTimes: number,
retention: number
) {
return api.post(`${BASE_URL}/ChangeScheduled`, {
scheduled_backup_id: id,
enabled,
cron_expression: cronExpression,
name,
description,
retry_interval: retryInterval,
retries: retryTimes,
retention,
});
},
};
5 changes: 5 additions & 0 deletions public/app/percona/backup/Backup.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export enum BackupMode {
PITR = 'PITR',
}

export enum BackupType {
DEMAND = 'DEMAND',
SCHEDULED = 'SCHEDULED',
}

export interface RawBackupLog {
chunk_id: number;
data: string;
Expand Down
Loading