Commit c2bb96cf by liulongfei

日志记录

parent d7beaaee
......@@ -50,6 +50,137 @@ namespace VIZ.Package.Domain
public const string OPERATE_SHUTDOWN = "关闭系统";
// =============================================================================
// 设置
// =============================================================================
/// <summary>
/// 打开设置页面
/// </summary>
public const string OPERATE_SETTING_OPEN = "打开设置页面";
/// <summary>
/// 重置布局
/// </summary>
public const string OPERATE_SETTING_RESET_LAYOUT = "重置布局";
// =============================================================================
// 项目
// =============================================================================
/// <summary>
/// 创建项目
/// </summary>
public const string OPERATE_PROJECT_CREATE = "创建项目";
/// <summary>
/// 打开项目
/// </summary>
public const string OPERATE_PROJECT_OPEN = "打开项目";
/// <summary>
/// 保存项目
/// </summary>
public const string OPERATE_PROJECT_SAVE = "保存项目";
/// <summary>
/// 关闭项目
/// </summary>
public const string OPERATE_PROJECT_CLOSE = "关闭项目";
// =============================================================================
// 模板
// =============================================================================
/// <summary>
/// 添加模板
/// </summary>
public const string OPERATE_TEMPLATE_ADD = "添加模板";
/// <summary>
/// 打开模板
/// </summary>
public const string OPERATE_TEMPLATE_OPEN = "打开模板";
/// <summary>
/// 更新模板
/// </summary>
public const string OPERATE_TEMPLATE_UPDATE = "更新模板";
/// <summary>
/// 删除模板
/// </summary>
public const string OPERATE_TEMPLATE_DELETE = "删除模板";
// =============================================================================
// 播出单
// =============================================================================
/// <summary>
/// 播出单添加分组
/// </summary>
public const string OPERATE_PAGE_GROUP_ADD = "播出单添加分组";
/// <summary>
/// 播出单重名了
/// </summary>
public const string OPERATE_PAGE_GROUP_RENAME = "播出单重命名";
/// <summary>
/// 播出单删除分组
/// </summary>
public const string OPERATE_PAGE_GROUP_DELETE = "播出单删除分组";
/// <summary>
/// 播出单删除页
/// </summary>
public const string OPERATE_PAGE_DELETE = "播出单删除页";
/// <summary>
/// 打开播出单页
/// </summary>
public const string OPERATE_PAGE_OPEN = "打开播出单页";
/// <summary>
/// 更新播出单页
/// </summary>
public const string OPERATE_PAGE_UPDATE = "更新播出单页";
/// <summary>
/// 清理页
/// </summary>
public const string OPERATE_PAGE_CLEAR = "清理页";
/// <summary>
/// 初始化页
/// </summary>
public const string OPERATE_PAGE_INIT = "初始化页";
/// <summary>
/// 拷贝播出单分组
/// </summary>
public const string OPERATE_PAGE_GROUP_COPY = "拷贝播出单分组";
/// <summary>
/// 复制页
/// </summary>
public const string OPERATE_PAGE_BEGIN_COPY = "复制页";
/// <summary>
/// 粘贴页
/// </summary>
public const string OPERATE_PAGE_PASTE = "粘贴页";
/// <summary>
/// 添加页
/// </summary>
public const string OPERATE_PAGE_ADD = "添加页";
/// <summary>
/// 修改页号
/// </summary>
public const string OPERATE_PAGE_CHANGE_PAGE_NUM = "修改页号";
// =============================================================================
// Viz预览
// =============================================================================
......@@ -61,52 +192,52 @@ namespace VIZ.Package.Domain
/// <summary>
/// 点击预览播放
/// </summary>
public const string OPERATE_PREVIEW_PLAY = "点击预览播放";
public const string OPERATE_PREVIEW_PLAY = "预览:点击播放";
/// <summary>
/// 点击预览继续
/// </summary>
public const string OPERATE_PREVIEW_CONTINUE = "点击预览继续";
public const string OPERATE_PREVIEW_CONTINUE = "预览:点击继续";
/// <summary>
/// 点击预览停止
/// </summary>
public const string OPERATE_PREVIEW_STOP = "点击预览停止";
public const string OPERATE_PREVIEW_STOP = "预览:点击停止";
/// <summary>
/// 点击预览更新
/// </summary>
public const string OPERATE_PREVIEW_UPDATE = "点击预览更新";
public const string OPERATE_PREVIEW_UPDATE = "预览:点击更新";
/// <summary>
/// 点击预览RGB
/// </summary>
public const string OPERATE_PREVIEW_RGB = "点击预览RGB";
public const string OPERATE_PREVIEW_RGB = "预览:点击RGB";
/// <summary>
/// 点击预览Key
/// </summary>
public const string OPERATE_PREVIEW_KEY = "点击预览Key";
public const string OPERATE_PREVIEW_KEY = "预览:点击Key";
/// <summary>
/// 点击预览KeyPreview
/// </summary>
public const string OPERATE_PREVIEW_KEY_PREVIEW = "点击预览KeyPreview";
public const string OPERATE_PREVIEW_KEY_PREVIEW = "预览:点击KeyPreview";
/// <summary>
/// 点击预览TS
/// </summary>
public const string OPERATE_PREVIEW_TS = "点击预览TS";
public const string OPERATE_PREVIEW_TS = "预览:点击TS";
/// <summary>
/// 点击预览SA
/// </summary>
public const string OPERATE_PREVIEW_SA = "点击预览SA";
public const string OPERATE_PREVIEW_SA = "预览:点击SA";
/// <summary>
/// 点击预览BB
/// </summary>
public const string OPERATE_PREVIEW_BB = "点击预览BB";
public const string OPERATE_PREVIEW_BB = "预览:点击BB";
// =============================================================================
// Take
......@@ -131,5 +262,19 @@ namespace VIZ.Package.Domain
/// 点击更新
/// </summary>
public const string OPERATE_TAKE_UPDATE = "播控:点击Update";
// =============================================================================
// 控制对象字段编辑
// =============================================================================
/// <summary>
/// 保存控制字段
/// </summary>
public const string OPERATE_CONTROL_FIELD_SAVE = "保存控制字段";
/// <summary>
/// 另存为页
/// </summary>
public const string OPERATE_CONTROL_FIELD_SAVE_AS = "另存为页";
}
}
......@@ -65,6 +65,11 @@ namespace VIZ.Package.Module
/// </summary>
private ControlObjectService controlObjectService = new ControlObjectService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// =============================================================
// Property
// =============================================================
......@@ -163,6 +168,10 @@ namespace VIZ.Package.Module
return;
}
// 记录操作日志
string remark = $"{ApplicationDomainEx.CurrentPage.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE, remark);
// 更新列表值
service.TryUpdateControlFieldListValue();
// 保存
......@@ -221,6 +230,10 @@ namespace VIZ.Package.Module
PageModel page = pageGroupService.AddPage(srcTemplate);
this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes);
pageGroupService.OpenPage(page);
// 记录操作日志
string remark = $"模板:{srcTemplate.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE_AS, remark);
}
// 另存页
else if (ApplicationDomainEx.CurrentPage is PageModel srcPage)
......@@ -228,6 +241,10 @@ namespace VIZ.Package.Module
PageModel page = pageGroupService.CopyPage();
this.controlObjectService.SaveControlFields(page.PageID, controlObject.AllFiledNodes);
pageGroupService.OpenPage(page);
// 记录操作日志
string remark = $"页:{page.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_CONTROL_FIELD_SAVE_AS, remark);
}
}
......@@ -304,6 +321,9 @@ namespace VIZ.Package.Module
// 保存
if (string.Equals(msg.Key, ApplicationDomainEx.HotKeyConfig.SaveOpendPageOrTemplateAndProject))
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, msg.Key);
this.Save();
return;
}
......
......@@ -90,7 +90,7 @@ namespace VIZ.Package.Module
private void OnVizCommandLogMessage(VizCommandLogMessage msg)
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SEND_VIZ_COMMAND, msg.Log);
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.VizCommand, RecordLogTrigger.System, RecordLogConstants.SYSTEM_SEND_VIZ_COMMAND, msg.Log);
// 更新界面
WPFHelper.BeginInvoke(() =>
......
......@@ -396,7 +396,7 @@ namespace VIZ.Package.Module
// 记录操作日志
StringBuilder remark = new StringBuilder();
remark.Append($"GH库: {vizConfig.GH_IP}:{vizConfig.GH_Port} 服务名: {vizConfig.GH_ServerName} ");
remark.Append($"账号: {vizConfig.GH_UserName} 密码: {vizConfig.VIZ_Password} ");
remark.Append($"账号: {vizConfig.GH_UserName} ");
remark.Append($"节目: {vizConfig.PluginGroup ?? string.Empty} ");
remark.Append($"引擎类型: {vizConfig.EngineFullType.GetDescription()} ");
remark.Append($"预览模式: {vizConfig.EnginePreviewMode.GetDescription()} ");
......
......@@ -13,6 +13,7 @@ using System.Windows.Forms;
using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Domain.Model;
using VIZ.Package.Service;
using VIZ.Package.Storage;
namespace VIZ.Package.Module
......@@ -74,6 +75,11 @@ namespace VIZ.Package.Module
/// </summary>
private bool isNeedOpenLastProject = true;
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// =====================================================================
// Property
// =====================================================================
......@@ -222,6 +228,9 @@ namespace VIZ.Package.Module
ApplicationDomainEx.MessageManager.Send(msg);
this.UpdateCommandStatus();
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_CREATE, path);
}
#endregion
......@@ -269,6 +278,9 @@ namespace VIZ.Package.Module
/// <param name="path">项目路径</param>
private void OpenProject(string path)
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_OPEN, path);
this.ProjectName = System.IO.Path.GetFileNameWithoutExtension(path);
ApplicationDomainEx.ProjectDbContext = new ProjectDbContext(path);
......@@ -305,6 +317,9 @@ namespace VIZ.Package.Module
/// </summary>
private void SaveProject()
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_SAVE, this.ProjectName);
ProjectSaveMessage msg = new ProjectSaveMessage();
ApplicationDomainEx.MessageManager.Send(msg);
}
......@@ -344,6 +359,9 @@ namespace VIZ.Package.Module
ApplicationDomainEx.ProjectDbContext.Dispose();
}
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_PROJECT_CLOSE, this.ProjectName);
this.ProjectName = null;
ApplicationDomainEx.ProjectDbContext = null;
......@@ -371,6 +389,9 @@ namespace VIZ.Package.Module
/// </summary>
private void Setting()
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_SETTING_OPEN);
SettingWindow window = new SettingWindow();
window.Owner = ApplicationDomainEx.MainWindow;
window.ShowDialog();
......@@ -394,6 +415,9 @@ namespace VIZ.Package.Module
if (service == null)
return;
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_SETTING_RESET_LAYOUT);
service.LoadLayout();
}
......
using DevExpress.Xpf.Core;
using DevExpress.Xpf.Core.HandleDecorator.Helpers;
using log4net;
using System;
using System.Collections;
......@@ -17,6 +18,7 @@ using VIZ.Framework.Core;
using VIZ.Package.Domain;
using VIZ.Package.Service;
using VIZ.Package.Storage;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace VIZ.Package.Module
{
......@@ -103,6 +105,11 @@ namespace VIZ.Package.Module
/// </summary>
private VizControlObjectDownloadService vizControlObjectDownloadService = new VizControlObjectDownloadService();
/// <summary>
/// 操作日志服务
/// </summary>
private RecordLogService recordLogService = new RecordLogService();
// ======================================================================================
// Property
// ======================================================================================
......@@ -222,6 +229,7 @@ namespace VIZ.Package.Module
if (this.SelectedSceneTemplateModel == null)
return;
// 打开模板页
this.OpenScenePage(this.SelectedSceneTemplateModel);
}
......@@ -231,6 +239,10 @@ namespace VIZ.Package.Module
/// <param name="page">页</param>
private void OpenScenePage(PageModelBase page)
{
// 记录操作日志
string remark = $"{page.ScenePath}";
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_OPEN, remark);
if (ApplicationDomainEx.CurrentPage != null)
{
ApplicationDomainEx.CurrentPage.IsOpen = false;
......@@ -263,6 +275,10 @@ namespace VIZ.Package.Module
List<PageModelBase> templates = this.SelectedSceneTemplateModels.ToList<PageModelBase>();
// 记录操作日志
string remark = string.Join(",", templates.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_UPDATE, remark);
// 开始下载图片
this.pageModelController.BeginDownLoadIamge(templates);
......@@ -299,6 +315,10 @@ namespace VIZ.Package.Module
if (DXMessageBox.Show($"是否删除模板 [{scenes}] ?", "提示", MessageBoxButton.YesNo) != MessageBoxResult.Yes)
return;
// 记录操作日志
string remark = string.Join(",", this.SelectedSceneTemplateModels.Select(p => p.Scene));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_DELETE, remark);
List<PageTemplateModel> templates = this.SelectedSceneTemplateModels.ToList();
foreach (PageTemplateModel template in templates)
{
......@@ -332,6 +352,9 @@ namespace VIZ.Package.Module
// 删除模板
if (string.Equals(key, HotKeyConfigEntity.DELETE))
{
// 记录操作日志
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.System, RecordLogTrigger.Human, RecordLogConstants.SYSTEM_HOT_KEY, key);
this.Delete();
return;
}
......@@ -406,6 +429,10 @@ namespace VIZ.Package.Module
/// <param name="fileModels">文件模型集合</param>
public void AddSceneTemplate(List<GHResourceFileModel> fileModels)
{
// 记录操作日志
string remark = string.Join(",", fileModels.Select(p => p.Name));
this.recordLogService.AppendLog(ApplicationConstants.APPLICATION_GROUP_NAME, RecordLogOperate.Operate, RecordLogTrigger.Human, RecordLogConstants.OPERATE_TEMPLATE_ADD, remark);
List<PageModelBase> list = new List<PageModelBase>();
foreach (GHResourceFileModel fileModel in fileModels)
......
......@@ -34,12 +34,6 @@ namespace VIZ.Package.Storage
/// Http请求
/// </summary>
[Description("Http请求")]
Http,
/// <summary>
/// 数据仓储
/// </summary>
[Description("数据仓储")]
Storage
Http
}
}
......@@ -15,7 +15,7 @@ namespace VIZ.Package.Storage
/// <summary>
/// 手动操作触发
/// </summary>
[Description("手动")]
[Description("手动操作")]
Human,
/// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment