文件操作 - panel_editor_tab.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/panel/panel_editor_tab.ts
编辑文件内容
import angular from 'angular'; const directiveModule = angular.module('grafana.directives'); const directiveCache: any = {}; /** @ngInject */ function panelEditorTab(dynamicDirectiveSrv: any) { return dynamicDirectiveSrv.create({ scope: { ctrl: '=', editorTab: '=', }, directive: (scope: any) => { const pluginId = scope.ctrl.pluginId; const tabName = scope.editorTab.title .toLowerCase() .replace(' ', '-') .replace('&', '') .replace(' ', '') .replace(' ', '-'); if (directiveCache[pluginId]) { if (directiveCache[pluginId][tabName]) { return directiveCache[pluginId][tabName]; } } else { directiveCache[pluginId] = []; } const result = { fn: () => scope.editorTab.directiveFn(), name: `panel-editor-tab-${pluginId}${tabName}`, }; directiveCache[pluginId][tabName] = result; return result; }, }); } directiveModule.directive('panelEditorTab', panelEditorTab);
修改文件时间
将文件时间修改为当前时间的前一年
删除文件