文件操作 - GaugeMigrations.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/plugins/panel/gauge/GaugeMigrations.ts
编辑文件内容
import { sharedSingleStatPanelChangedHandler, sharedSingleStatMigrationHandler } from '@grafana/ui'; import { PanelModel } from '@grafana/data'; import { GaugeOptions } from './types'; // This is called when the panel first loads export const gaugePanelMigrationHandler = (panel: PanelModel<GaugeOptions>): Partial<GaugeOptions> => { return sharedSingleStatMigrationHandler(panel); }; // This is called when the panel changes from another panel export const gaugePanelChangedHandler = ( panel: PanelModel<Partial<GaugeOptions>> | any, prevPluginId: string, prevOptions: any ) => { // This handles most config changes const opts = sharedSingleStatPanelChangedHandler(panel, prevPluginId, prevOptions) as GaugeOptions; // Changing from angular singlestat if (prevPluginId === 'singlestat' && prevOptions.angular) { const gauge = prevOptions.angular.gauge; if (gauge) { opts.showThresholdMarkers = gauge.thresholdMarkers; opts.showThresholdLabels = gauge.thresholdLabels; } } return opts; };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件