文件操作 - UnsavedChangesSrv.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/features/dashboard/services/UnsavedChangesSrv.ts
编辑文件内容
import angular, { ILocationService } from 'angular'; import { ChangeTracker } from './ChangeTracker'; import { ContextSrv } from 'app/core/services/context_srv'; import { DashboardSrv } from './DashboardSrv'; import { GrafanaRootScope } from 'app/routes/GrafanaCtrl'; /** @ngInject */ export function unsavedChangesSrv( this: any, $rootScope: GrafanaRootScope, $location: ILocationService, $timeout: any, contextSrv: ContextSrv, dashboardSrv: DashboardSrv, $window: any ) { this.init = function(dashboard: any, scope: any) { this.tracker = new ChangeTracker(dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope); return this.tracker; }; } angular.module('grafana.services').service('unsavedChangesSrv', unsavedChangesSrv);
修改文件时间
将文件时间修改为当前时间的前一年
删除文件