From 000b912dcae62f684e07554f859f21a771efa1d2 Mon Sep 17 00:00:00 2001 From: "Jingwei.Zhang" Date: Mon, 29 Aug 2022 14:56:21 +0800 Subject: [PATCH] refactor: remove useless code about backup point Remove useless code about backup point Change-Id: I4ba018cedcf2a8bca9e21807ac6784e7def605c4 --- .../containers/Backup/actions/Restore.jsx | 9 --- src/resources/cinder/backup.jsx | 72 ------------------- 2 files changed, 81 deletions(-) diff --git a/src/pages/storage/containers/Backup/actions/Restore.jsx b/src/pages/storage/containers/Backup/actions/Restore.jsx index b029d45e..7143faa7 100644 --- a/src/pages/storage/containers/Backup/actions/Restore.jsx +++ b/src/pages/storage/containers/Backup/actions/Restore.jsx @@ -73,15 +73,6 @@ export class Restore extends ModalAction { static allowed = () => Promise.resolve(true); - get backupPoints() { - return this.backupPointStore.list.data || []; - } - - async getBackupPoints() { - const { id } = this.item; - await this.backupPointStore.fetchList({ id }); - } - async getVolume() { let enable = false; const { volume_id } = this.item; diff --git a/src/resources/cinder/backup.jsx b/src/resources/cinder/backup.jsx index fecbc681..19a65432 100644 --- a/src/resources/cinder/backup.jsx +++ b/src/resources/cinder/backup.jsx @@ -13,8 +13,6 @@ // limitations under the License. import React from 'react'; -import { getOptions } from 'utils/index'; -import { FolderOutlined, FolderAddOutlined } from '@ant-design/icons'; import globalProjectStore from 'stores/keystone/project'; import globalBackupStore from 'stores/cinder/backup'; @@ -57,76 +55,6 @@ export const modeTip = t( 'Create a full backup, the system will automatically create a new backup chain, the full backup name is the backup chain name; Create an incremental backup, the system will automatically create an incremental backup under the newly created backup chain.' ); -export const backupColumns = []; - -export const backupPointColumns = [ - { - title: t('Name'), - dataIndex: 'name', - ellipsis: true, - }, - { - title: t('Size'), - dataIndex: 'size', - isHideable: true, - render: (value) => `${value} GiB`, - }, - { - title: t('Status'), - dataIndex: 'status', - valueMap: backupStatus, - }, - { - title: t('Backup Mode'), - dataIndex: 'is_incremental', - isHideable: true, - render: (value) => { - if (value) { - return ( - <> - {' '} - - {t('Incremental Backup')} - - ); - } - return ( - <> - {' '} - - {t('Full Backup')} - - ); - }, - stringify: (value) => (value ? t('Incremental Backup') : t('Full Backup')), - }, - { - title: t('description'), - dataIndex: 'description', - ellipsis: true, - isHideable: true, - }, - { - title: t('Created At'), - dataIndex: 'created_at', - isHideable: true, - valueRender: 'sinceTime', - }, -]; - -export const backupPointFilters = [ - { - label: t('Name'), - name: 'name', - ellipsis: true, - }, - { - label: t('Status'), - name: 'status', - options: getOptions(backupStatus), - }, -]; - export const restoreTip = (