public async Task <ModuleAction> GetAction_RemoveAllAsync() { if (!IsAuthorized("RemoveLog")) { return(null); } using (LogRecordDataProvider dataProvider = LogRecordDataProvider.GetLogRecordDataProvider()) { if (!await dataProvider.IsInstalledAsync()) { return(null); } if (!dataProvider.CanRemove) { return(null); } }; return(new ModuleAction(this) { Url = Utility.UrlFor(typeof(BrowseLogModuleController), nameof(BrowseLogModuleController.RemoveAll)), NeedsModuleContext = true, Image = await CustomIconAsync("RemoveAll.png"), Style = ModuleAction.ActionStyleEnum.Post, LinkText = this.__ResStr("removeAllLink", "Remove All"), MenuText = this.__ResStr("removeAllMenu", "Remove All"), Legend = this.__ResStr("removeAllLegend", "Remove all log record for all sites"), Tooltip = this.__ResStr("removeAllTT", "Removes all log records for all sites"), Category = ModuleAction.ActionCategoryEnum.Delete, Mode = ModuleAction.ActionModeEnum.Any, Location = ModuleAction.ActionLocationEnum.NoAuto, ConfirmationText = this.__ResStr("removeConfirm", "Are you sure you want to remove ALL log records?"), }); }
public async Task <ModuleAction> GetAction_DownloadZippedLogAsync() { if (!IsAuthorized("Downloads")) { return(null); } using (LogRecordDataProvider dataProvider = LogRecordDataProvider.GetLogRecordDataProvider()) { if (!await dataProvider.IsInstalledAsync()) { return(null); } if (!dataProvider.CanDownload) { return(null); } }; return(new ModuleAction(this) { Url = Utility.UrlFor(typeof(BrowseLogModuleController), nameof(BrowseLogModuleController.DownloadZippedLog)), NeedsModuleContext = true, CookieAsDoneSignal = true, Image = await CustomIconAsync("Download.png"), LinkText = this.__ResStr("dlZipLink", "Download Log (Zipped)"), MenuText = this.__ResStr("dlZipMenu", "Download Log (Zipped)"), Tooltip = this.__ResStr("dlZipTT", "Download the log file as a ZIP file"), Legend = this.__ResStr("dlZipLegend", "Downloads the log file as a ZIP file"), Style = ModuleAction.ActionStyleEnum.Normal, Category = ModuleAction.ActionCategoryEnum.Read, Mode = ModuleAction.ActionModeEnum.Any, Location = ModuleAction.ActionLocationEnum.NoAuto, }); }
public async Task <ActionResult> BrowseLog() { FlushLog(); using (LogRecordDataProvider dataProvider = LogRecordDataProvider.GetLogRecordDataProvider()) { await dataProvider.FlushAsync();// get the latest records BrowseModel model = new BrowseModel { LogAvailable = await dataProvider.IsInstalledAsync(), BrowsingSupported = dataProvider.CanBrowse, LoggerName = dataProvider.LoggerName, }; if (dataProvider.CanBrowse) { model.GridDef = GetGridModel(); } return(View(model)); } }