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
c106222c
Commit
c106222c
authored
Feb 22, 2021
by
Roberto P. Rubio
Browse files
Removed starting many machines dialog on admin pages
parent
b9123de7
Changes
5
Hide whitespace changes
Inline
Side-by-side
public/js/admin.js
View file @
c106222c
...
...
@@ -311,37 +311,8 @@ ravadaApp.directive("solShowMachine", swMach)
});
};
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
$scope
.
confirmingMachineStopOnNewMachineStartDataCancelled
=
function
()
{
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
};
$scope
.
confirmingMachineStopOnNewMachineStartDataDone
=
function
()
{
$scope
.
action
(
$scope
.
confirmingMachineStopOnNewMachineStartData
.
target
,
$scope
.
confirmingMachineStopOnNewMachineStartData
.
action
,
$scope
.
confirmingMachineStopOnNewMachineStartData
.
machine
,
true
);
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
};
$scope
.
checkExecutionMachineLimits
=
function
(
target
,
action
,
machineId
)
{
$http
.
get
(
'
/execution_machines_limit
'
)
.
then
(
function
(
data
)
{
if
((
data
.
data
.
can_start_many
)
||
(
data
.
data
.
running_domains
.
indexOf
(
machineId
)
>=
0
)
||
(
data
.
data
.
start_limit
>
data
.
data
.
running_domains
.
length
))
{
$scope
.
action
(
target
,
action
,
machineId
,
true
);
}
else
{
$scope
.
confirmingMachineStopOnNewMachineStartData
=
{
target
:
target
,
action
:
action
,
machine
:
machineId
};
}
},
function
(
data
,
status
)
{
console
.
error
(
'
Repos error
'
,
status
,
data
);
window
.
location
.
reload
();
});
};
$scope
.
action
=
function
(
target
,
action
,
machineId
,
confirmed
){
if
(((
action
===
'
start
'
)
||
(
action
===
'
view
'
))
&&
(
!
confirmed
))
{
$scope
.
checkExecutionMachineLimits
(
target
,
action
,
machineId
);
}
else
if
(
action
===
'
view
'
)
{
$scope
.
action
=
function
(
target
,
action
,
machineId
){
if
(
action
===
'
view
'
)
{
window
.
location
.
assign
(
'
/machine/view/
'
+
machineId
+
'
.html
'
);
}
else
{
...
...
public/js/ravada.js
View file @
c106222c
...
...
@@ -97,25 +97,25 @@
);
};
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
=
null
;
$scope
.
confirming
_stop_d
ata
=
null
;
$scope
.
confirming
MachineStopOnNewMachineStartData
Cancelled
=
function
()
{
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
=
null
;
$scope
.
confirming
Stop
Cancelled
=
function
()
{
$scope
.
confirming
_stop_d
ata
=
null
;
};
$scope
.
confirming
MachineStopOnNewMachineStartData
Done
=
function
()
{
$scope
.
action
(
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
.
machine
,
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
.
action
,
true
);
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
=
null
;
$scope
.
confirming
Stop
Done
=
function
()
{
$scope
.
action
(
$scope
.
confirming
_stop_d
ata
.
machine
,
$scope
.
confirming
_stop_d
ata
.
action
,
true
);
$scope
.
confirming
_stop_d
ata
=
null
;
};
$scope
.
check
Execution
Machine
Limit
s
=
function
(
action
,
machine
)
{
$scope
.
check
Max
Machines
=
function
(
action
,
machine
)
{
$http
.
get
(
'
/execution_machines_limit
'
)
.
then
(
function
(
data
)
{
if
((
data
.
data
.
can_start_many
)
||
(
data
.
data
.
running_domains
.
indexOf
(
machine
.
id
)
>=
0
)
||
(
data
.
data
.
start_limit
>
data
.
data
.
running_domains
.
length
))
{
$scope
.
action
(
machine
,
action
,
true
);
}
else
{
$scope
.
confirming
MachineStopOnNewMachineStartD
ata
=
{
action
:
action
,
machine
:
machine
};
$scope
.
confirming
_stop_d
ata
=
{
action
:
action
,
machine
:
machine
};
}
},
function
(
data
,
status
)
{
console
.
error
(
'
Repos error
'
,
status
,
data
);
...
...
@@ -127,7 +127,7 @@
machine
.
action
=
false
;
if
(
action
==
'
start
'
)
{
if
(
!
confirmed
)
{
$scope
.
check
Execution
Machine
Limit
s
(
action
,
machine
);
$scope
.
check
Max
Machines
(
action
,
machine
);
}
else
{
window
.
location
.
assign
(
'
/machine/clone/
'
+
machine
.
id
+
'
.html
'
);
}
...
...
@@ -253,37 +253,8 @@
return
string
;
};
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
$scope
.
confirmingMachineStopOnNewMachineStartDataCancelled
=
function
()
{
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
};
$scope
.
confirmingMachineStopOnNewMachineStartDataDone
=
function
()
{
$scope
.
action
(
$scope
.
confirmingMachineStopOnNewMachineStartData
.
target
,
$scope
.
confirmingMachineStopOnNewMachineStartData
.
action
,
$scope
.
confirmingMachineStopOnNewMachineStartData
.
machine
,
$scope
.
confirmingMachineStopOnNewMachineStartData
.
params
,
true
);
$scope
.
confirmingMachineStopOnNewMachineStartData
=
null
;
};
$scope
.
checkExecutionMachineLimits
=
function
(
target
,
action
,
machineId
,
params
)
{
$http
.
get
(
'
/execution_machines_limit
'
)
.
then
(
function
(
data
)
{
if
((
data
.
data
.
can_start_many
)
||
(
data
.
data
.
running_domains
.
indexOf
(
machineId
)
>=
0
)
||
(
data
.
data
.
start_limit
>
data
.
data
.
running_domains
.
length
))
{
$scope
.
action
(
target
,
action
,
machineId
,
params
,
true
);
}
else
{
$scope
.
confirmingMachineStopOnNewMachineStartData
=
{
target
:
target
,
action
:
action
,
machine
:
machineId
,
params
:
params
};
}
},
function
(
data
,
status
)
{
console
.
error
(
'
Repos error
'
,
status
,
data
);
window
.
location
.
reload
();
});
};
$scope
.
action
=
function
(
target
,
action
,
machineId
,
params
,
confirmed
){
if
(((
action
===
'
start
'
)
||
(
action
===
'
view
'
))
&&
(
!
confirmed
))
{
$scope
.
checkExecutionMachineLimits
(
target
,
action
,
machineId
,
params
);
}
else
if
(
action
===
'
view
'
)
{
$scope
.
action
=
function
(
target
,
action
,
machineId
,
params
){
if
(
action
===
'
view
'
)
{
window
.
location
.
assign
(
'
/machine/view/
'
+
machineId
+
'
.html
'
);
}
else
{
...
...
script/rvd_front
View file @
c106222c
...
...
@@ -2714,10 +2714,8 @@ sub get_execution_machines_limit_per_current_user {
my $c = shift;
return login($c) if !_logged_in($c);
my $settings = $RAVADA->settings_global();
my %grants = $USER->grants();
my $start_limit = ((exists($grants{'start_limit'}))
&&
($grants{'start_limit'} > 0)) ? $grants{'start_limit'} : $settings->{'backend'}->{'start_limit'}->{'value'};
my $start_limit = ((exists($grants{'start_limit'}))
&&
($grants{'start_limit'} > 0)) ? $grants{'start_limit'} : $RAVADA->settings_global()->{'backend'}->{'start_limit'}->{'value'};
my $can_start_many = $USER->can_start_many;
my @running_domains;
...
...
templates/main/list_bases_ng.html.ep
View file @
c106222c
...
...
@@ -38,7 +38,7 @@
</div>
</div>
<div
class=
"card-body"
id=
"step2"
>
<div
ng-show=
"(confirming
MachineStopOnNewMachineStartData) && (confirmingMachineStopOnNewMachineStartD
ata.ac
tion
===
'start'
)"
class=
"row alert alert-warning"
role=
"alert"
>
<div
ng-show=
"(confirming
_stop_data) && (confirming_stop_d
ata.
m
ac
hine
===
machine
)"
class=
"row alert alert-warning"
role=
"alert"
>
<div>
<span><
%=
l
'
One
of
the
machines
that
are
currently
running
will
be
shutdown.
'
%
></span>
<br>
...
...
@@ -46,14 +46,14 @@
<br>
</div>
<div
class=
"pull-right"
>
<input
type=
"button"
class=
"btn btn-danger btn-xs"
value=
"<%=l 'Yes' %>"
ng-click=
"confirming
MachineStopOnNewMachineStartData
Done()"
>
<input
type=
"button"
class=
"btn btn-primary btn-xs"
value=
"<%=l 'No' %>"
ng-click=
"confirming
MachineStopOnNewMachineStartData
Cancelled()"
>
<input
type=
"button"
class=
"btn btn-danger btn-xs"
value=
"<%=l 'Yes' %>"
ng-click=
"confirming
Stop
Done()"
>
<input
type=
"button"
class=
"btn btn-primary btn-xs"
value=
"<%=l 'No' %>"
ng-click=
"confirming
Stop
Cancelled()"
>
</div>
<br>
</div>
<div
class=
"row"
>
<a
type=
"
button
"
class=
"btn btn-success mr-2"
ng-hide=
"machine.action"
ng-click=
"action(machine,'start')"
><strong><i
class=
"fa fa-play"
aria-hidden=
"true"
></i>
<
%=
l
'
Start
'
%
></strong></
a
>
<
button
class=
"btn btn-success mr-2"
ng-hide=
"machine.action"
ng-click=
"action(machine,'start')"
><strong><i
class=
"fa fa-play"
aria-hidden=
"true"
></i>
<
%=
l
'
Start
'
%
></strong></
button
>
<div
class=
"dropdown"
>
<button
ng-show=
"machine.is_active && !machine.action"
class=
"btn btn-secondary dropdown-toggle"
ng-click=
"$parent.refresh=20"
type=
"button"
id=
"dropdownMenuButton"
...
...
templates/main/vm_actions.html.ep
View file @
c106222c
...
...
@@ -10,20 +10,6 @@
<br><br>
</div>
<div ng-show="(confirmingMachineStopOnNewMachineStartData) && (confirmingMachineStopOnNewMachineStartData.action === 'start')" class="alert alert-warning" role="alert">
<div>
<span><%=l 'One of the machines that are currently running will be shutdown.' %></span>
<br>
<span><%=l 'Continue?' %></span>
<br>
</div>
<div class="pull-right">
<input type="button" class="btn btn-danger btn-xs" value="<%=l 'Yes' %>" ng-click="confirmingMachineStopOnNewMachineStartDataDone()">
<input type="button" class="btn btn-primary btn-xs" value="<%=l 'No' %>" ng-click="confirmingMachineStopOnNewMachineStartDataCancelled()">
</div>
<br>
</div>
<div ng-show="showmachine.can_view">
<button type="button" class="btn btn-primary btn-sm"
ng-click="action('machine','view',showmachine.id)"
...
...
@@ -34,20 +20,6 @@
<br><br>
</div>
<div type="warning" ng-show="(confirmingMachineStopOnNewMachineStartData) && (confirmingMachineStopOnNewMachineStartData.action === 'view')" class="alert alert-warning" role="alert">
<div>
<span><%=l 'One of the machines that are currently running will be shutdown.' %></span>
<br>
<span><%=l 'Continue?' %></span>
<br>
</div>
<div class="pull-right">
<input type="button" class="btn btn-primary btn-xs" value="<%=l 'Yes' %>" ng-click="confirmingMachineStopOnNewMachineStartDataDone()">
<input type="button" class="btn btn-primary btn-xs" value="<%=l 'No' %>" ng-click="confirmingMachineStopOnNewMachineStartDataCancelled()">
</div>
<br>
</div>
<div ng-show="showmachine.can_hibernate">
<button type="button" class="btn btn-warning btn-sm"
ng-click="action('machine','hibernate',showmachine.id)"
...
...
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