Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
f910e4ef
Commit
f910e4ef
authored
Feb 09, 2022
by
Francesc Guasch
Browse files
wip: lock buttons while changing hardware
parent
09e1c0eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/js/ravada.js
View file @
f910e4ef
...
...
@@ -635,7 +635,7 @@
}
var
file
=
$scope
.
showmachine
.
hardware
.
disk
[
index
].
file
;
if
(
typeof
(
file
)
!=
'
undefined
'
&&
file
)
{
console
.
log
(
file
)
;
$scope
.
showmachine
.
requests
++
;
$http
.
post
(
'
/request/remove_hardware/
'
,
JSON
.
stringify
({
'
id_domain
'
:
$scope
.
showmachine
.
id
...
...
@@ -650,6 +650,7 @@
}
}
$scope
.
showmachine
.
requests
++
;
if
(
typeof
(
item
)
==
'
object
'
)
{
item
.
remove
=
false
;
}
...
...
@@ -899,6 +900,7 @@
};
$scope
.
request
=
function
(
request
,
args
)
{
$scope
.
showmachine
.
requests
++
;
$scope
.
pending_request
=
undefined
;
$http
.
post
(
'
/request/
'
+
request
+
'
/
'
,
JSON
.
stringify
(
args
)
...
...
templates/main/vm_hardware.html.ep
View file @
f910e4ef
...
...
@@ -16,13 +16,13 @@
>
<button title="edit {{name}} {{$index+1}}"
ng-show="(name == 'network' ||name == 'disk') && !item.edit && !item.remove"
ng-disabled="
pending_requests > 0
"
ng-disabled="
showmachine.requests > 0 || showmachine.is_active || showmachine.is_base
"
ng-click="item.edit=!item.edit"
><i class="fa fa-sticky-note"></i>
</button>
<button title="remove {{name}} {{$index+1}}"
ng-hide="item.edit"
ng-disabled="
pending_
requests > 0 || item.is_secondary"
ng-disabled="
showmachine.
requests > 0 || item.is_secondary
|| showmachine.is_active || showmachine.is_base
"
ng-click="confirm_remove='';remove_hardware(name,$index,item)"><i class="fa fa-times"></i>
</button>
<span ng-class='{"h5": item.edit }'>
...
...
Write
Preview
Supports
Markdown
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