Commit d38abdf8 by Belákovics Ádám

VMinfo grid modifications

parent 9309055b
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
struct ComputeData{ struct ComputeData{
std::string name;
double memory; double memory;
int cpu; int cpu;
int cores; int cores;
......
...@@ -83,6 +83,7 @@ std::string Controller::getState(std::string id){ ...@@ -83,6 +83,7 @@ std::string Controller::getState(std::string id){
*/ */
ComputeData Controller::getDataByID(std::string id){ ComputeData Controller::getDataByID(std::string id){
ComputeData data; ComputeData data;
data.name = allCompute.at(std::stoi(id))->getHostname();
data.memory = allCompute.at(std::stoi(id))->getMemory(); data.memory = allCompute.at(std::stoi(id))->getMemory();
data.cpu = allCompute.at(std::stoi(id))->getCpuShare(); data.cpu = allCompute.at(std::stoi(id))->getCpuShare();
data.cores = allCompute.at(std::stoi(id))->getCores(); data.cores = allCompute.at(std::stoi(id))->getCores();
......
...@@ -72,6 +72,7 @@ void MainWindow::loadVMData(std::string id){ ...@@ -72,6 +72,7 @@ void MainWindow::loadVMData(std::string id){
ui->lStatus->setText(myController.getState(id).c_str()); ui->lStatus->setText(myController.getState(id).c_str());
ComputeData data = myController.getDataByID(id.c_str()); ComputeData data = myController.getDataByID(id.c_str());
currentSelectedVM = data; currentSelectedVM = data;
ui->lVMName->setText(data.name.c_str());
ui->lCPU->setText(std::to_string(data.cpu).c_str()); ui->lCPU->setText(std::to_string(data.cpu).c_str());
ui->lMemory->setText(std::to_string(data.memory).c_str()); ui->lMemory->setText(std::to_string(data.memory).c_str());
ui->lCores->setText(std::to_string(data.cores).c_str()); ui->lCores->setText(std::to_string(data.cores).c_str());
...@@ -178,6 +179,7 @@ void MainWindow::on_bRefresh_clicked() ...@@ -178,6 +179,7 @@ void MainWindow::on_bRefresh_clicked()
void MainWindow::on_bNewVM_clicked() void MainWindow::on_bNewVM_clicked()
{ {
VMChooserDialog* v = new VMChooserDialog(this); VMChooserDialog* v = new VMChooserDialog(this);
v->setWindowTitle("New Virtual Machine");
v->set_templates(getTemplates(myController.session)); v->set_templates(getTemplates(myController.session));
connect(v, SIGNAL(send_chosen_template(Template)), this, SLOT(receive_chosen_template(Template))); connect(v, SIGNAL(send_chosen_template(Template)), this, SLOT(receive_chosen_template(Template)));
v->exec(); v->exec();
......
...@@ -418,23 +418,33 @@ ...@@ -418,23 +418,33 @@
<string>Virtual Machines</string> <string>Virtual Machines</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="3" column="1">
<widget class="QListWidget" name="listWidget"> <widget class="QPushButton" name="bNewVM">
<property name="sizePolicy"> <property name="text">
<sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding"> <string>New VM</string>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> </widget>
</sizepolicy> </item>
<item row="2" column="1">
<widget class="QPushButton" name="bRefresh">
<property name="text">
<string>Refresh</string>
</property> </property>
</widget>
</item>
<item row="0" column="2" rowspan="2">
<layout class="QGridLayout" name="glVMinfo">
<item row="1" column="1" colspan="2">
<widget class="Line" name="line">
<property name="palette"> <property name="palette">
<palette> <palette>
<active> <active>
<colorrole role="Base"> <colorrole role="Base">
<brush brushstyle="SolidPattern"> <brush brushstyle="SolidPattern">
<color alpha="255"> <color alpha="255">
<red>108</red> <red>255</red>
<green>112</green> <green>255</green>
<blue>115</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
...@@ -443,9 +453,9 @@ ...@@ -443,9 +453,9 @@
<colorrole role="Base"> <colorrole role="Base">
<brush brushstyle="SolidPattern"> <brush brushstyle="SolidPattern">
<color alpha="255"> <color alpha="255">
<red>108</red> <red>255</red>
<green>112</green> <green>255</green>
<blue>115</blue> <blue>255</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
...@@ -463,179 +473,268 @@ ...@@ -463,179 +473,268 @@
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="3">
<layout class="QGridLayout" name="gridLayout_3"> <widget class="QGroupBox" name="groupBox_2">
<item row="0" column="1"> <property name="title">
<widget class="QLabel" name="lStatus">
<property name="text">
<string/> <string/>
</property> </property>
</widget> <layout class="QGridLayout" name="gridLayout_5">
</item> <item row="1" column="1">
<item row="3" column="1"> <widget class="QLabel" name="lStatus">
<widget class="QLabel" name="lMemoryTag"> <property name="font">
<font>
<pointsize>15</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text"> <property name="text">
<string>Memory:</string> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="1" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lStatusTag"> <widget class="QLabel" name="lStatusTag">
<property name="font">
<font>
<pointsize>15</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text"> <property name="text">
<string>Status:</string> <string>Status:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0"> </layout>
<widget class="QPushButton" name="bRefresh"> </widget>
<property name="text"> </item>
<string>Refresh</string> <item row="4" column="1">
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string>Lease</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0"> <item row="2" column="1" colspan="3">
<widget class="QPushButton" name="bNewVM"> <widget class="QGroupBox" name="groupBox_3">
<property name="text"> <property name="title">
<string>New VM</string> <string>Credentials</string>
</property>
<layout class="QGridLayout" name="gridLayout_8">
<item row="2" column="1">
<widget class="QLineEdit" name="lPasswordVM">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>240</red>
<green>240</green>
<blue>240</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="0" column="1">
<widget class="QLabel" name="lResourcesTag"> <widget class="QLabel" name="lHostname">
<property name="text"> <property name="text">
<string>Resources:</string> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0"> <item row="2" column="2">
<widget class="QLabel" name="lNetworkTag"> <widget class="QPushButton" name="bShowPassword">
<property name="text"> <property name="text">
<string>Network:</string> <string>Show</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="1"> <item row="1" column="0">
<widget class="QLabel" name="lUsernameTag"> <widget class="QLabel" name="lUsernameTag">
<property name="text"> <property name="text">
<string>Username:</string> <string>Username:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item row="1" column="1">
<widget class="QLabel" name="lCoresTag"> <widget class="QLabel" name="lUsernameVM">
<property name="text"> <property name="text">
<string>Cores:</string> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="2"> <item row="0" column="0">
<widget class="QLabel" name="lMemory"> <widget class="QLabel" name="lHastnameTag">
<property name="text"> <property name="text">
<string/> <string>Hostname:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="2"> <item row="2" column="0">
<widget class="QLabel" name="lCPU"> <widget class="QLabel" name="lPasswordTag">
<property name="text"> <property name="text">
<string/> <string>Password:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2"> <item row="2" column="3">
<widget class="QLabel" name="lCores"> <widget class="QPushButton" name="bConnect">
<property name="text"> <property name="text">
<string/> <string>Connect</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1"> </layout>
<widget class="QLabel" name="lPasswordTag"> </widget>
</item>
<item row="4" column="2" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Hardware</string>
</property>
<layout class="QGridLayout" name="gridLayout_7">
<item row="4" column="0">
<widget class="QLabel" name="lCoresTag">
<property name="text"> <property name="text">
<string>Password:</string> <string>Cores:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="2" column="0">
<widget class="QLabel" name="lCPUTag"> <widget class="QLabel" name="lCPUTag">
<property name="text"> <property name="text">
<string>CPU:</string> <string>CPU:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="2"> <item row="0" column="0">
<widget class="QLabel" name="lHostname"> <widget class="QLabel" name="lMemoryTag">
<property name="text">
<string>Memory:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="lCPU">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="2"> <item row="0" column="1">
<widget class="QLabel" name="lUsernameVM"> <widget class="QLabel" name="lMemory">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="4" column="1">
<widget class="QLabel" name="lHastnameTag"> <widget class="QLabel" name="lCores">
<property name="text"> <property name="text">
<string>Hostname:</string> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" rowspan="3"> </layout>
<spacer name="verticalSpacer_3"> </widget>
<property name="orientation"> </item>
<enum>Qt::Vertical</enum> <item row="0" column="1" colspan="2">
<widget class="QLabel" name="lVMName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="maximumSize">
<size> <size>
<width>20</width> <width>16777215</width>
<height>40</height> <height>72</height>
</size> </size>
</property> </property>
</spacer> <property name="font">
<font>
<family>Sans Serif</family>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="3" column="0" rowspan="3"> <item row="2" column="2">
<spacer name="verticalSpacer_6"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>40</width>
<height>40</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="9" column="2"> <item row="0" column="0" rowspan="4">
<widget class="QLineEdit" name="lPasswordVM"> <widget class="QListWidget" name="listWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette"> <property name="palette">
<palette> <palette>
<active> <active>
<colorrole role="Base"> <colorrole role="Base">
<brush brushstyle="SolidPattern"> <brush brushstyle="SolidPattern">
<color alpha="255"> <color alpha="255">
<red>255</red> <red>108</red>
<green>255</green> <green>112</green>
<blue>255</blue> <blue>115</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
...@@ -644,9 +743,9 @@ ...@@ -644,9 +743,9 @@
<colorrole role="Base"> <colorrole role="Base">
<brush brushstyle="SolidPattern"> <brush brushstyle="SolidPattern">
<color alpha="255"> <color alpha="255">
<red>255</red> <red>108</red>
<green>255</green> <green>112</green>
<blue>255</blue> <blue>115</blue>
</color> </color>
</brush> </brush>
</colorrole> </colorrole>
...@@ -664,43 +763,8 @@ ...@@ -664,43 +763,8 @@
</disabled> </disabled>
</palette> </palette>
</property> </property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="3">
<widget class="QPushButton" name="bShowPassword">
<property name="text">
<string>Show</string>
</property>
</widget> </widget>
</item> </item>
<item row="10" column="3">
<widget class="QPushButton" name="bConnect">
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tTemplate"> <widget class="QWidget" name="tTemplate">
......
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 sign in to comment