文件操作 - RowOptionsButton.tsx
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/dashboard/components/RowOptions/RowOptionsButton.tsx
编辑文件内容
import React, { FC } from 'react'; import { Icon, ModalsController } from '@grafana/ui'; import { RowOptionsModal } from './RowOptionsModal'; import { OnRowOptionsUpdate } from './RowOptionsForm'; export interface RowOptionsButtonProps { title: string | null; repeat: string | null; onUpdate: OnRowOptionsUpdate; } export const RowOptionsButton: FC<RowOptionsButtonProps> = ({ repeat, title, onUpdate }) => { const onUpdateChange = (hideModal: () => void) => (title: string | null, repeat: string | null) => { onUpdate(title, repeat); hideModal(); }; return ( <ModalsController> {({ showModal, hideModal }) => { return ( <a className="pointer" onClick={() => { showModal(RowOptionsModal, { title, repeat, onDismiss: hideModal, onUpdate: onUpdateChange(hideModal) }); }} > <Icon name="cog" /> </a> ); }} </ModalsController> ); }; RowOptionsButton.displayName = 'RowOptionsButton';
修改文件时间
将文件时间修改为当前时间的前一年
删除文件