文件操作 - application.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/core/middlewares/application.ts
编辑文件内容
import { AnyAction, Dispatch, Middleware, MiddlewareAPI } from 'redux'; import { StoreState } from 'app/types/store'; import { toggleLogActions } from '../reducers/application'; export const toggleLogActionsMiddleware: Middleware<{}, StoreState> = (store: MiddlewareAPI<Dispatch, StoreState>) => ( next: Dispatch ) => (action: AnyAction) => { const isLogActionsAction = action.type === toggleLogActions.type; if (isLogActionsAction) { return next(action); } const logActionsTrue = window && window.location && window.location.search && window.location.search.indexOf('logActions=true') !== -1; const logActionsFalse = window && window.location && window.location.search && window.location.search.indexOf('logActions=false') !== -1; const logActions = store.getState().application.logActions; if (logActionsTrue && !logActions) { store.dispatch(toggleLogActions()); } if (logActionsFalse && logActions) { store.dispatch(toggleLogActions()); } return next(action); };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件