Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
d68ff10e
Commit
d68ff10e
authored
Jun 19, 2017
by
fv3rdugo
Browse files
[#260] fixed missing rows when upgrading
Keep selected tab on page refresh
parent
c0beecd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
d68ff10e
...
...
@@ -259,6 +259,169 @@ sub _update_domain_drivers_types($self) {
$self
->
_update_table
('
domain_drivers_types
','
id
',
$data
);
}
sub
_update_domain_drivers_options
($self) {
my
$data
=
{
qxl
=>
{
id
=>
1
,
,
id_driver_type
=>
1
,
,
name
=>
'
QXL
'
,
value
=>
'
type="qxl" ram="65536" vram="65536" vgamem="16384" heads="1" primary="yes"
'
},
vmvga
=>
{
id
=>
2
,
,
id_driver_type
=>
1
,
,
name
=>
'
VMVGA
'
,
value
=>
'
type="vmvga" vram="16384" heads="1" primary="yes"
'
},
cirrus
=>
{
id
=>
3
,
,
id_driver_type
=>
1
,
,
name
=>
'
Cirrus
'
,
value
=>
'
type="cirrus" vram="16384" heads="1" primary="yes"
'
},
vga
=>
{
id
=>
4
,
,
id_driver_type
=>
1
,
,
name
=>
'
VGA
'
,
value
=>
'
type="vga" vram="16384" heads="1" primary="yes"
'
},
ich6
=>
{
id
=>
6
,
,
id_driver_type
=>
2
,
,
name
=>
'
ich6
'
,
value
=>
'
model="ich6"
'
},
ac97
=>
{
id
=>
7
,
,
id_driver_type
=>
2
,
,
name
=>
'
ac97
'
,
value
=>
'
model="ac97"
'
},
virtio
=>
{
id
=>
8
,
,
id_driver_type
=>
3
,
,
name
=>
'
virtio
'
,
value
=>
'
type="virtio"
'
},
e1000
=>
{
id
=>
9
,
,
id_driver_type
=>
3
,
,
name
=>
'
e1000
'
,
value
=>
'
type="e1000"
'
},
rtl8139
=>
{
id
=>
10
,
,
id_driver_type
=>
3
,
,
name
=>
'
rtl8139
'
,
value
=>
'
type="rtl8139"
'
},
auto_glz
=>
{
id
=>
11
,
,
id_driver_type
=>
4
,
,
name
=>
'
auto_glz
'
,
value
=>
'
compression="auto_glz"
'
},
auto_lz
=>
{
id
=>
12
,
,
id_driver_type
=>
4
,
,
name
=>
'
auto_lz
'
,
value
=>
'
compression="auto_lz"
'
},
quic
=>
{
id
=>
13
,
,
id_driver_type
=>
4
,
,
name
=>
'
quic
'
,
value
=>
'
compression="quic"
'
},
glz
=>
{
id
=>
14
,
,
id_driver_type
=>
4
,
,
name
=>
'
glz
'
,
value
=>
'
compression="glz"
'
},
lz
=>
{
id
=>
15
,
,
id_driver_type
=>
4
,
,
name
=>
'
lz
'
,
value
=>
'
compression="lz"
'
},
off
=>
{
id
=>
16
,
,
id_driver_type
=>
4
,
,
name
=>
'
off
'
,
value
=>
'
compression="off"
'
},
auto
=>
{
id
=>
17
,
,
id_driver_type
=>
5
,
,
name
=>
'
auto
'
,
value
=>
'
compression="auto"
'
},
never
=>
{
id
=>
18
,
,
id_driver_type
=>
5
,
,
name
=>
'
never
'
,
value
=>
'
compression="never"
'
},
always
=>
{
id
=>
19
,
,
id_driver_type
=>
5
,
,
name
=>
'
always
'
,
value
=>
'
compression="always"
'
},
auto1
=>
{
id
=>
20
,
,
id_driver_type
=>
6
,
,
name
=>
'
auto
'
,
value
=>
'
compression="auto"
'
},
never1
=>
{
id
=>
21
,
,
id_driver_type
=>
6
,
,
name
=>
'
never
'
,
value
=>
'
compression="never"
'
},
always1
=>
{
id
=>
22
,
,
id_driver_type
=>
6
,
,
name
=>
'
always
'
,
value
=>
'
compression="always"
'
},
on
=>
{
id
=>
23
,
,
id_driver_type
=>
7
,
,
name
=>
'
on
'
,
value
=>
'
compression="on"
'
},
off1
=>
{
id
=>
24
,
,
id_driver_type
=>
7
,
,
name
=>
'
off
'
,
value
=>
'
compression="off"
'
},
filter
=>
{
id
=>
25
,
,
id_driver_type
=>
8
,
,
name
=>
'
filter
'
,
value
=>
'
mode="filter"
'
},
all
=>
{
id
=>
26
,
,
id_driver_type
=>
8
,
,
name
=>
'
all
'
,
value
=>
'
mode="all"
'
},
off2
=>
{
id
=>
27
,
,
id_driver_type
=>
8
,
,
name
=>
'
off
'
,
value
=>
'
mode="off"
'
}
};
$self
->
_update_table
('
domain_drivers_options
','
id
',
$data
);
}
sub
_update_table
($self, $table, $field, $data) {
my
$sth_search
=
$CONNECTOR
->
dbh
->
prepare
("
SELECT id FROM
$table
WHERE
$field
= ?
");
...
...
@@ -290,6 +453,7 @@ sub _update_data {
$self
->
_update_isos
();
$self
->
_update_user_grants
();
$self
->
_update_domain_drivers_types
();
$self
->
_update_domain_drivers_options
();
}
sub
_upgrade_table
{
...
...
templates/main/settings_machine.html.ep
View file @
d68ff10e
...
...
@@ -52,5 +52,34 @@
</div>
<!-- del wrapper -->
%= include 'bootstrap/scripts'
%= include 'bootstrap/messages'
<script
type=
"text/javascript"
>
if
(
location
.
hash
)
{
$
(
'
a[href=
\'
'
+
location
.
hash
+
'
\'
]
'
).
tab
(
'
show
'
);
}
var
activeTab
=
localStorage
.
getItem
(
'
activeTab
'
);
if
(
activeTab
)
{
$
(
'
a[href="
'
+
activeTab
+
'
"]
'
).
tab
(
'
show
'
);
}
$
(
'
body
'
).
on
(
'
click
'
,
'
a[data-toggle=
\'
tab
\'
]
'
,
function
(
e
)
{
e
.
preventDefault
()
var
tab_name
=
this
.
getAttribute
(
'
href
'
)
if
(
history
.
pushState
)
{
history
.
pushState
(
null
,
null
,
tab_name
)
}
else
{
location
.
hash
=
tab_name
}
localStorage
.
setItem
(
'
activeTab
'
,
tab_name
)
$
(
this
).
tab
(
'
show
'
);
return
false
;
});
$
(
window
).
on
(
'
popstate
'
,
function
()
{
var
anchor
=
location
.
hash
||
$
(
'
a[data-toggle=
\'
tab
\'
]
'
).
first
().
attr
(
'
href
'
);
$
(
'
a[href=
\'
'
+
anchor
+
'
\'
]
'
).
tab
(
'
show
'
);
});
</script>
</body>
</html>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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