Ejemplo n.º 1
0
        public override string Execute(int consoleWidth)
        {
            output += _js.GetNodesStats();
            output += "<color><yellow>" + ConsoleTable.GetSplitline(consoleWidth);

            string[] _tableRow = _tableRow = new string[] { "Node-ID", "Node-Name", "Node-State", "MAC-Address", "IP-Address", "Jobs Init." };
            output += ConsoleTable.FormatStringArray(consoleWidth, _tableRow);
            output += ConsoleTable.GetSplitline(consoleWidth);
            output += "<color><white>";

            lock (_js.jsLock)
            {
                List <JobNode> _nodes = _js.LGetNodes();
                foreach (JobNode _temp in _nodes)
                {
                    _tableRow[0] = _temp.id.ToString();
                    _tableRow[1] = _temp.name;
                    _tableRow[2] = _js.NodeState(_temp.state);
                    _tableRow[3] = _temp.mac.ToString();
                    _tableRow[4] = _temp.ip.ToString();
                    _tableRow[5] = _temp.jobs.Count.ToString();
                    output      += ConsoleTable.FormatStringArray(consoleWidth, _tableRow);
                }
            }

            return(output);
        }
Ejemplo n.º 2
0
        private void listBoxNodes_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.listBoxInfoJobs.Items.Clear();

            labelInfoJobsGUID.Text     = "";
            labelInfoJobsID.Text       = "";
            labelInfoJobsOutstate.Text = "";
            labelInfoJobsType.Text     = "";

            labelInfoMAC.Text         = _nodes[listBoxNodes.SelectedIndex].mac;
            labelInfoID.Text          = _nodes[listBoxNodes.SelectedIndex].id.ToString();
            labelInfoGUID.Text        = _nodes[listBoxNodes.SelectedIndex].guid.ToString();
            labelInfoIP.Text          = _nodes[listBoxNodes.SelectedIndex].ip.ToString();
            labelInfoName.Text        = _nodes[listBoxNodes.SelectedIndex].name;
            labelInfoState.Text       = _js.NodeState(_nodes[listBoxNodes.SelectedIndex].state);
            textBoxInfoJobsMemo1.Text = _nodes[listBoxNodes.SelectedIndex].memo1;
            textBoxInfoJobsMemo2.Text = _nodes[listBoxNodes.SelectedIndex].memo2;



            if (_js.NodeState(_nodes[listBoxNodes.SelectedIndex].state) == "Active")
            {
                this.pictureBoxLightGreenOn.Visible  = true;
                this.pictureBoxLightGreenOff.Visible = false;
                this.pictureBoxLightRedOn.Visible    = false;
                this.pictureBoxLightRedoff.Visible   = true;
            }

            else
            {
                this.pictureBoxLightGreenOn.Visible  = false;
                this.pictureBoxLightGreenOff.Visible = true;
                this.pictureBoxLightRedOn.Visible    = true;
                this.pictureBoxLightRedoff.Visible   = false;
            }

            _countJob = 0;
            foreach (JobInfo jf in _nodes[listBoxNodes.SelectedIndex].jobs)
            {
                _countJob++;
                this.listBoxInfoJobs.Items.Add(_countJob.ToString() + ".) " + jf.name);
            }
        }