示例#1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            //string url = "http://172.17.30.109:44444/reload.php";
            string     url         = "http://" + targetip + ":44444/reload.php";
            HttpModuel httpm       = new HttpModuel();
            string     finalresult = httpm.getresult(url);

            MessageBox.Show(finalresult);
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            List <mongodata> results = new List <mongodata>();

            foreach (TreeListNode node in this.treeview.Nodes)
            {
                if (node.IsChecked == true)
                {
                    mongodata checkdata = node.Content as mongodata;
                    results.Add(checkdata);
                }
            }

            if (results.Count != 0)
            {
                JObject jsonlist = new JObject();     //作为传入PHP的Json串
                for (int i = 0; i < results.Count; i++)
                {
                    JObject resultjson = new JObject();
                    resultjson.Add(new JProperty("GridFS名称", results[i].GridFS名称));
                    resultjson.Add(new JProperty("数据库名", results[i].数据库名));
                    jsonlist.Add(new JProperty(i.ToString(), resultjson));
                }

                //string url = "http://172.17.30.109:44444/Mongo/makeconf.php";
                string     url         = "http://" + targetip + ":44444/Mongo/makeconf.php";
                HttpModuel httpm       = new HttpModuel();
                string     finalresult = httpm.postjson(url, jsonlist.ToString());
                if (finalresult == "OK")
                {
                    MessageBox.Show("配置文件已重新生成,点击重启服务应用新数据集");
                }
                else
                {
                    MessageBox.Show("服务器故障");
                }
            }
            else
            {
                MessageBox.Show("请至少选择一个数据集");
            }
        }
示例#3
0
        private void button5_Click(object sender, RoutedEventArgs e)
        {
            if (this.serverlist.SelectedItem != null)
            {
                int count = info.Count;
                for (int i = 0; i < count; i++)
                {
                    if (info[i].servername == this.serverlist.SelectedItem.ToString())
                    {
                        HttpModuel http   = new HttpModuel();
                        string     url    = "http://" + info[i].ip + ":44444/Mongo/fsstat.php";
                        JArray     result = http.getjson(url);
                        if (result != null)
                        {
                            List <List <string> > allnames  = new List <List <string> >();
                            List <List <string> > allvalues = new List <List <string> >();
                            for (int j = 0; j < result.Count; j++)
                            {
                                List <string> name   = new List <string>();
                                List <string> value  = new List <string>();
                                JToken        values = result[j];


                                foreach (JProperty jp in values)
                                {
                                    name.Add(jp.Name);
                                    value.Add(jp.Value.ToString());
                                }
                                allnames.Add(name);
                                allvalues.Add(value);
                            }

                            MainWindow mainwindow = new MainWindow(allnames, allvalues, info[i].ip);
                            mainwindow.Show();
                            this.Close();
                        }
                    }
                }
            }
        }
示例#4
0
        private void button5_Click(object sender, RoutedEventArgs e)
        {
            if(this.serverlist.SelectedItem!=null)
            {
                int count = info.Count;
                for(int i=0;i<count;i++)
                {
                    if(info[i].servername==this.serverlist.SelectedItem.ToString())
                    {
                        HttpModuel http = new HttpModuel();
                        string url = "http://"+info[i].ip+":44444/Mongo/fsstat.php" ;
                        JArray result= http.getjson(url);
                        if(result!=null)
                        {
                            List<List<string>> allnames = new List<List<string>>();
                            List<List<string>> allvalues = new List<List<string>>();
                            for(int j=0;j<result.Count;j++)
                            {
                                List<string> name = new List<string>();
                                List<string> value = new List<string>();
                                JToken values = result[j];
                                
                                
                                foreach (JProperty jp in values)
                                {
                                    name.Add(jp.Name);
                                    value.Add(jp.Value.ToString());
                                }
                                allnames.Add(name);
                                allvalues.Add(value);
                                
                            }

                            MainWindow mainwindow = new MainWindow(allnames,allvalues, info[i].ip);
                            mainwindow.Show();
                            this.Close();
                        }
                    }
                }
            }
        }
示例#5
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            List<mongodata> results = new List<mongodata>();
            foreach(TreeListNode node in this.treeview.Nodes)
            {
                if(node.IsChecked==true)
                {
                    mongodata checkdata = node.Content as mongodata;
                    results.Add(checkdata);
                }
            }

            if(results.Count!=0)
            {
                JObject jsonlist = new JObject();     //作为传入PHP的Json串
                for(int i=0;i<results.Count;i++)
                {                    
                    JObject resultjson = new JObject();
                    resultjson.Add(new JProperty("GridFS名称",results[i].GridFS名称));
                    resultjson.Add(new JProperty("数据库名", results[i].数据库名));
                    jsonlist.Add(new JProperty(i.ToString(), resultjson));

                    
                }

                //string url = "http://172.17.30.109:44444/Mongo/makeconf.php";
                string url = "http://"+targetip+":44444/Mongo/makeconf.php";
                HttpModuel httpm = new HttpModuel();
                string finalresult = httpm.postjson(url, jsonlist.ToString());
                if(finalresult=="OK")
                {
                    MessageBox.Show("配置文件已重新生成,点击重启服务应用新数据集");
                }
                else
                {
                    MessageBox.Show("服务器故障");
                }
            }
            else
            { MessageBox.Show("请至少选择一个数据集"); }
        }
示例#6
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     //string url = "http://172.17.30.109:44444/reload.php";
     string url = "http://" + targetip + ":44444/reload.php";
     HttpModuel httpm = new HttpModuel();
     string finalresult = httpm.getresult(url);
     MessageBox.Show(finalresult);
 }