Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
user-client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d38abdf8
authored
Jun 12, 2017
by
Belákovics Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VMinfo grid modifications
parent
9309055b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
200 additions
and
131 deletions
+200
-131
computedata.h
+2
-0
controller.cpp
+1
-0
mainwindow.cpp
+2
-0
mainwindow.ui
+195
-131
No files found.
computedata.h
View file @
d38abdf8
...
...
@@ -3,6 +3,8 @@
struct
ComputeData
{
std
::
string
name
;
double
memory
;
int
cpu
;
int
cores
;
...
...
controller.cpp
View file @
d38abdf8
...
...
@@ -83,6 +83,7 @@ std::string Controller::getState(std::string id){
*/
ComputeData
Controller
::
getDataByID
(
std
::
string
id
){
ComputeData
data
;
data
.
name
=
allCompute
.
at
(
std
::
stoi
(
id
))
->
getHostname
();
data
.
memory
=
allCompute
.
at
(
std
::
stoi
(
id
))
->
getMemory
();
data
.
cpu
=
allCompute
.
at
(
std
::
stoi
(
id
))
->
getCpuShare
();
data
.
cores
=
allCompute
.
at
(
std
::
stoi
(
id
))
->
getCores
();
...
...
mainwindow.cpp
View file @
d38abdf8
...
...
@@ -72,6 +72,7 @@ void MainWindow::loadVMData(std::string id){
ui
->
lStatus
->
setText
(
myController
.
getState
(
id
).
c_str
());
ComputeData
data
=
myController
.
getDataByID
(
id
.
c_str
());
currentSelectedVM
=
data
;
ui
->
lVMName
->
setText
(
data
.
name
.
c_str
());
ui
->
lCPU
->
setText
(
std
::
to_string
(
data
.
cpu
).
c_str
());
ui
->
lMemory
->
setText
(
std
::
to_string
(
data
.
memory
).
c_str
());
ui
->
lCores
->
setText
(
std
::
to_string
(
data
.
cores
).
c_str
());
...
...
@@ -178,6 +179,7 @@ void MainWindow::on_bRefresh_clicked()
void
MainWindow
::
on_bNewVM_clicked
()
{
VMChooserDialog
*
v
=
new
VMChooserDialog
(
this
);
v
->
setWindowTitle
(
"New Virtual Machine"
);
v
->
set_templates
(
getTemplates
(
myController
.
session
));
connect
(
v
,
SIGNAL
(
send_chosen_template
(
Template
)),
this
,
SLOT
(
receive_chosen_template
(
Template
)));
v
->
exec
();
...
...
mainwindow.ui
View file @
d38abdf8
...
...
@@ -418,23 +418,33 @@
<string>
Virtual Machines
</string>
</attribute>
<layout
class=
"QGridLayout"
name=
"gridLayout_2"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QListWidget"
name=
"listWidget"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"MinimumExpanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"bNewVM"
>
<property
name=
"text"
>
<string>
New VM
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QPushButton"
name=
"bRefresh"
>
<property
name=
"text"
>
<string>
Refresh
</string>
</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"
>
<palette>
<active>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
108
</red>
<green>
112
</green>
<blue>
11
5
</blue>
<red>
255
</red>
<green>
255
</green>
<blue>
25
5
</blue>
</color>
</brush>
</colorrole>
...
...
@@ -443,9 +453,9 @@
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
108
</red>
<green>
112
</green>
<blue>
11
5
</blue>
<red>
255
</red>
<green>
255
</green>
<blue>
25
5
</blue>
</color>
</brush>
</colorrole>
...
...
@@ -463,179 +473,268 @@
</disabled>
</palette>
</property>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_3"
>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lStatus"
>
<property
name=
"text"
>
<item
row=
"0"
column=
"3"
>
<widget
class=
"QGroupBox"
name=
"groupBox_2"
>
<property
name=
"title"
>
<string/>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lMemoryTag"
>
<layout
class=
"QGridLayout"
name=
"gridLayout_5"
>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lStatus"
>
<property
name=
"font"
>
<font>
<pointsize>
15
</pointsize>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"text"
>
<string>
Memory:
</string
>
<string/
>
</property>
</widget>
</item>
<item
row=
"0"
column=
"2"
>
<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"
>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"lStatusTag"
>
<property
name=
"font"
>
<font>
<pointsize>
15
</pointsize>
<weight>
50
</weight>
<bold>
false
</bold>
</font>
</property>
<property
name=
"text"
>
<string>
Status:
</string>
</property>
</widget>
</item>
<item
row=
"10"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"bRefresh"
>
<property
name=
"text"
>
<string>
Refresh
</string>
</layout>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QGroupBox"
name=
"groupBox_4"
>
<property
name=
"title"
>
<string>
Lease
</string>
</property>
</widget>
</item>
<item
row=
"11"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"bNewVM"
>
<property
name=
"text"
>
<string>
New VM
</string>
<item
row=
"2"
column=
"1"
colspan=
"3"
>
<widget
class=
"QGroupBox"
name=
"groupBox_3"
>
<property
name=
"title"
>
<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>
</widget>
</item>
<item
row=
"1"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lResourcesTag
"
>
<item
row=
"0"
column=
"1
"
>
<widget
class=
"QLabel"
name=
"lHostname
"
>
<property
name=
"text"
>
<string>
Resources:
</string
>
<string/
>
</property>
</widget>
</item>
<item
row=
"6"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lNetworkTag
"
>
<item
row=
"2"
column=
"2
"
>
<widget
class=
"QPushButton"
name=
"bShowPassword
"
>
<property
name=
"text"
>
<string>
Network:
</string>
<string>
Show
</string>
</property>
</widget>
</item>
<item
row=
"8"
column=
"1
"
>
<item
row=
"1"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lUsernameTag"
>
<property
name=
"text"
>
<string>
Username:
</string>
</property>
</widget>
</item>
<item
row=
"5
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lCoresTag
"
>
<item
row=
"1
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lUsernameVM
"
>
<property
name=
"text"
>
<string>
Cores:
</string
>
<string/
>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2
"
>
<widget
class=
"QLabel"
name=
"lMemory
"
>
<item
row=
"0"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lHastnameTag
"
>
<property
name=
"text"
>
<string/
>
<string>
Hostname:
</string
>
</property>
</widget>
</item>
<item
row=
"4"
column=
"2
"
>
<widget
class=
"QLabel"
name=
"lCPU
"
>
<item
row=
"2"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lPasswordTag
"
>
<property
name=
"text"
>
<string/
>
<string>
Password:
</string
>
</property>
</widget>
</item>
<item
row=
"5"
column=
"2
"
>
<widget
class=
"QLabel"
name=
"lCores
"
>
<item
row=
"2"
column=
"3
"
>
<widget
class=
"QPushButton"
name=
"bConnect
"
>
<property
name=
"text"
>
<string/
>
<string>
Connect
</string
>
</property>
</widget>
</item>
<item
row=
"9"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lPasswordTag"
>
</layout>
</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"
>
<string>
Password
:
</string>
<string>
Cores
:
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1
"
>
<item
row=
"2"
column=
"0
"
>
<widget
class=
"QLabel"
name=
"lCPUTag"
>
<property
name=
"text"
>
<string>
CPU:
</string>
</property>
</widget>
</item>
<item
row=
"7"
column=
"2"
>
<widget
class=
"QLabel"
name=
"lHostname"
>
<item
row=
"0"
column=
"0"
>
<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"
>
<string/>
</property>
</widget>
</item>
<item
row=
"8"
column=
"2
"
>
<widget
class=
"QLabel"
name=
"lUsernameVM
"
>
<item
row=
"0"
column=
"1
"
>
<widget
class=
"QLabel"
name=
"lMemory
"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
<item
row=
"7
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lHastnameTag
"
>
<item
row=
"4
"
column=
"1"
>
<widget
class=
"QLabel"
name=
"lCores
"
>
<property
name=
"text"
>
<string>
Hostname:
</string
>
<string/
>
</property>
</widget>
</item>
<item
row=
"7"
column=
"0"
rowspan=
"3"
>
<spacer
name=
"verticalSpacer_3"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
</layout>
</widget>
</item>
<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
name=
"
sizeHint"
stdset=
"0
"
>
<property
name=
"
maximumSize
"
>
<size>
<width>
20
</width>
<height>
40
</height>
<width>
16777215
</width>
<height>
72
</height>
</size>
</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
row=
"3"
column=
"0"
rowspan=
"3
"
>
<spacer
name=
"verticalSpacer_6
"
>
<item
row=
"2"
column=
"2
"
>
<spacer
name=
"horizontalSpacer_3
"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertic
al
</enum>
<enum>
Qt::Horizont
al
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
2
0
</width>
<height>
4
0
</height>
<width>
4
0
</width>
<height>
2
0
</height>
</size>
</property>
</spacer>
</item>
<item
row=
"9"
column=
"2"
>
<widget
class=
"QLineEdit"
name=
"lPasswordVM"
>
<item
row=
"0"
column=
"0"
rowspan=
"4"
>
<widget
class=
"QListWidget"
name=
"listWidget"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Fixed"
vsizetype=
"MinimumExpanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"palette"
>
<palette>
<active>
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
25
5
</blue>
<red>
108
</red>
<green>
112
</green>
<blue>
11
5
</blue>
</color>
</brush>
</colorrole>
...
...
@@ -644,9 +743,9 @@
<colorrole
role=
"Base"
>
<brush
brushstyle=
"SolidPattern"
>
<color
alpha=
"255"
>
<red>
255
</red>
<green>
255
</green>
<blue>
25
5
</blue>
<red>
108
</red>
<green>
112
</green>
<blue>
11
5
</blue>
</color>
</brush>
</colorrole>
...
...
@@ -664,43 +763,8 @@
</disabled>
</palette>
</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>
</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>
</widget>
<widget
class=
"QWidget"
name=
"tTemplate"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment