Commit cc9ce163 authored by joelalju's avatar joelalju
Browse files

[#404]Screenshot tab added; you can take from settings a screenshot and display it.

parent 48456740
...@@ -1616,4 +1616,8 @@ sub type { ...@@ -1616,4 +1616,8 @@ sub type {
return $type; return $type;
} }
sub file_screenshot($self){
return $self->_data('file_screenshot');
}
1; 1;
...@@ -152,9 +152,15 @@ ...@@ -152,9 +152,15 @@
$http.get('/machine/remove_clones/'+machineId+'.json'); $http.get('/machine/remove_clones/'+machineId+'.json');
}; };
$scope.reload_page_msg = false;
$scope.action = function(target,action,machineId){ $scope.action = function(target,action,machineId){
$http.get('/'+target+'/'+action+'/'+machineId+'.json'); $http.get('/'+target+'/'+action+'/'+machineId+'.json');
$scope.reload_page_msg = true;
setTimeout(function () {
window.location.reload(false);
}, 5000);
}; };
$scope.rename = function(machineId, old_name) { $scope.rename = function(machineId, old_name) {
if ($scope.new_name_duplicated || $scope.new_name_invalid) return; if ($scope.new_name_duplicated || $scope.new_name_invalid) return;
$scope.rename_requested=1; $scope.rename_requested=1;
...@@ -191,7 +197,7 @@ ...@@ -191,7 +197,7 @@
$scope.set_public = function(machineId, value) { $scope.set_public = function(machineId, value) {
$http.get("/machine/public/"+machineId+"/"+value); $http.get("/machine/public/"+machineId+"/"+value);
}; };
//On load code //On load code
$scope.showmachineId = window.location.pathname.split("/")[3].split(".")[0] || -1 ; $scope.showmachineId = window.location.pathname.split("/")[3].split(".")[0] || -1 ;
$http.get('/machine/info/'+$scope.showmachineId+'.json').then(function(response) { $http.get('/machine/info/'+$scope.showmachineId+'.json').then(function(response) {
......
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
% } % }
</div> </div>
% } % }
% if ($USER->can_change_settings) {
<div class="tab-pane fade" id="screenshot">
%= include 'main/vm_screenshot'
</div>
% }
% if ($domain->type eq 'KVM') { % if ($domain->type eq 'KVM') {
<div class="tab-pane fade" id="graphics"> <div class="tab-pane fade" id="graphics">
% if ($domain->is_base) { % if ($domain->is_base) {
...@@ -42,4 +47,3 @@ ...@@ -42,4 +47,3 @@
%= include 'main/vm_remove' %= include 'main/vm_remove'
</div> </div>
% } % }
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
% if ($USER->can_change_settings && $domain->drivers) { % if ($USER->can_change_settings && $domain->drivers) {
<li class="nav"><a href="#drivers" data-toggle="tab">Drivers</a></li> <li class="nav"><a href="#drivers" data-toggle="tab">Drivers</a></li>
% } % }
% if ($USER->can_change_settings) {
<li class="nav"><a href="#screenshot" data-toggle="tab">Screenshot</a></li>
% }
% if ($domain->drivers) { % if ($domain->drivers) {
<li class="nav"><a href="#graphics" data-toggle="tab">Graphics</a></li> <li class="nav"><a href="#graphics" data-toggle="tab">Graphics</a></li>
% } % }
...@@ -17,4 +20,3 @@ ...@@ -17,4 +20,3 @@
<li class="nav"><a href="#remove" data-toggle="tab">Remove Machine</a></li> <li class="nav"><a href="#remove" data-toggle="tab">Remove Machine</a></li>
% } % }
</ul> </ul>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment