Пример #1
0
        public Object CreateRegCode(string identify, string machinecode, string regdate)
        {
            //string identify = DateTime.Now.Ticks.ToString();
            regdate = Convert.ToDateTime(regdate).ToString("yyyyMMdd");
            string args    = string.Format("identify={0}&machinecode={1}&regdate={2}", identify, machinecode, regdate);
            string regcode = WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "createregcode", args);

            return(new { identify = identify, regcode = regcode });
        }
 public string SeviceList()
 {
     try
     {
         return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "sevicelist", null));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public string ShowText()
 {
     try
     {
         return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "getmnodetext", null));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public string GetMachineCode()
 {
     try
     {
         string data = WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "getmachinecode", null);
         return(data);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #5
0
        private Object CallRemoteCmd(string identify, string eprocess, string method, Dictionary <string, string> argDic)
        {
            if (argDic == null)
            {
                argDic = new Dictionary <string, string>();
            }
            string arg = JsonConvert.SerializeObject(argDic);

            string args = string.Format("identify={0}&eprocess={1}&method={2}&arg={3}", identify, eprocess, method, arg);

            return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "rootremotecommand", args));
        }
 public Object GetTaskList()
 {
     try
     {
         string            data     = WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "gettasklist", null);
         List <TaskConfig> tasklist = JsonConvert.DeserializeObject <List <TaskConfig> >(data);
         return(tasklist);
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #7
0
        public Object GetMonitorMap()
        {
            string    data     = WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "getmnodetree", null);
            MNodeTree nodetree = JsonConvert.DeserializeObject <MNodeTree>(data);

            List <amazeuitreenode> tree = new List <amazeuitreenode>();
            amazeuitreenode        root = new amazeuitreenode();

            root.title  = nodetree.RootMNode.ServerName + "(" + nodetree.RootMNode.ServerIdentify + ")";
            root.type   = "folder";
            root.childs = new List <amazeuitreenode>();
            root.attr   = new Dictionary <string, string>();
            root.attr.Add("identify", nodetree.RootMNode.ServerIdentify);
            root.attr.Add("icon", "am-icon-home");
            tree.Add(root);

            //在线并排除根节点
            List <MNodeObject> onmnodelist = nodetree.AllMNodeList.FindAll(x => x.IsConnect == true && x.ServerIdentify != nodetree.RootMNode.ServerIdentify);

            loadMonitorMap(nodetree.RootMNode.ServerIdentify, root, onmnodelist);

            amazeuitreenode offroot = new amazeuitreenode();

            offroot.title  = "离线中间件节点";
            offroot.type   = "folder";
            offroot.childs = new List <amazeuitreenode>();
            offroot.attr   = new Dictionary <string, string>();
            offroot.attr.Add("icon", "am-icon-power-off");
            tree.Add(offroot);
            List <MNodeObject> offmnodelist = nodetree.AllMNodeList.FindAll(x => x.IsConnect == false);

            foreach (var o in offmnodelist)
            {
                amazeuitreenode node = new amazeuitreenode();
                node.title = o.ServerName + "(" + o.ServerIdentify + ")";
                node.type  = "item";
                node.attr  = new Dictionary <string, string>();
                //node.attr.Add("identify", o.ServerIdentify);
                node.attr.Add("icon", "am-icon-desktop");
                offroot.childs.Add(node);
            }
            return(tree);
        }
 public string DebugLog(string logtype, string date)
 {
     try
     {
         if (string.IsNullOrEmpty(logtype))
         {
             return("");
         }
         else
         {
             date = string.IsNullOrEmpty(date) ? DateTime.Now.ToString("yyyy-MM") : date;
             string args = "logtype=" + logtype + "&date=" + date.Replace("-", "");
             return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "debuglog", args));
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public bool ActivateRegCode(string regcode)
 {
     try
     {
         string args = "regcode=" + regcode;
         string data = WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "activateregcode", args);
         if (data == "true")
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception e)
     {
         throw e;
     }
 }
Пример #10
0
 public string ShowConfig()
 {
     return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "getmnodetext", null));
 }
Пример #11
0
        //下载插件包
        public static void DownLoadPlugin(ClientLink _clientLink)
        {
            try
            {
                if (EFWCoreLib.CoreFrame.Init.HostSettingConfig.GetValue("autoupdater") == "1")//是否启动自动升级程序
                {
                    //1.节点新增了本地插件
                    //2.节点本地插件更新了版本
                    //3.节点本地插件卸载
                    MNodePlugin mnplugin = RemotePluginManage.GetLocalPlugin();
                    if (mnplugin == null || mnplugin.LocalPinfoList == null)
                    {
                        return;
                    }
                    List <string> addplugin    = new List <string>(); //新增插件
                    List <string> updateplugin = new List <string>(); //更新插件
                    List <string> deleteplugin = new List <string>(); //删除插件

                    //本地插件新增
                    foreach (string p in mnplugin.LocalPlugin)
                    {
                        if (AppPluginManage.PluginDic.Keys.ToList().FindIndex(x => x == p) == -1)
                        {
                            //新增插件
                            addplugin.Add(p);
                        }
                    }
                    //本地插件更新
                    foreach (string p in mnplugin.LocalPlugin)
                    {
                        if (AppPluginManage.PluginDic.ContainsKey(p))
                        {
                            //版本比较,是对比中心与本地插件的版本号
                            Version local  = new Version(AppPluginManage.PluginDic[p].plugin.version);
                            Version remote = new Version(mnplugin.LocalPinfoList.Find(x => x.pluginname == p).versions);
                            int     tm     = local.CompareTo(remote);
                            if (tm < 0)//本地版本小
                            {
                                updateplugin.Add(p);
                                //downloadRemotePlugin(pluginupgrade + p + ".zip", _clientLink);
                                //下载之后触发安装,重启基础服务
                            }
                        }
                    }
                    //本地插件卸载
                    foreach (var p in AppPluginManage.PluginDic)
                    {
                        if (mnplugin.LocalPlugin.FindIndex(x => x == p.Key) == -1)
                        {
                            //已移除插件
                            deleteplugin.Add(p.Key);
                        }
                    }

                    //下载插件包
                    foreach (string p in addplugin)
                    {
                        downloadRemotePlugin(pluginupgrade + p + ".zip", _clientLink);
                    }

                    foreach (string p in updateplugin)
                    {
                        downloadRemotePlugin(pluginupgrade + p + ".zip", _clientLink);
                    }

                    //重启服务
                    if (addplugin.Count > 0 || updateplugin.Count > 0 || deleteplugin.Count > 0)
                    {
                        using (StreamWriter sw = new StreamWriter(AppGlobal.AppRootPath + WcfGlobal.pluginUpgradeFile, false))
                        {
                            sw.WriteLine("addplugin:" + string.Join(",", addplugin));
                            sw.WriteLine("updateplugin:" + string.Join(",", updateplugin));
                            sw.WriteLine("deleteplugin:" + string.Join(",", deleteplugin));
                        }
                        WcfGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusServer), "upgradeplugin", null);
                    }
                }
            }
            catch (Exception err)
            {
                CoreFrame.Common.MiddlewareLogHelper.WriterLog(err.Message + err.StackTrace);
            }
        }
Пример #12
0
 private void FrmInfo_Load(object sender, EventArgs e)
 {
     txtInfo.Text = Program.serverIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "getmnodetext", null);
 }
Пример #13
0
 public string InitMonitor()
 {
     //WcfFrame.Utility.MonitorPlatform.MonitorPlatformManage.Init();
     return(WebApiGlobal.normalIPC.CallCmd(IPCName.GetProcessName(IPCType.efwplusBase), "initmonitor", null));;
 }