Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
phyusin
2018-09-14 10:19:33 +06:30
3 changed files with 32 additions and 5 deletions

View File

@@ -184,6 +184,15 @@ class HomeController < ApplicationController
render :json => {:status=> "Success", :url => root_path }.to_json
end
def run_teamviewer
if File.directory?("/opt/teamviewer")
output = IO.popen('/opt/teamviewer/tv_bin/script/teamviewer')
render :json => {:status=> true}
else
render :json => {:status=> false}
end
end
private
# Never trust parameters from the scary internet, only allow the white list through.

View File

@@ -69,12 +69,12 @@
</a>
</p>
</li>
<!-- <li>
<p class="waves-effect waves-block p-l-30 m-b-5">
<i class="material-icons font-7 logout_icon shopinfo">add</i>
<span class="font-15 shopinfo" >Team Viewer</span>
<li>
<p class="waves-effect waves-block p-l-30 m-b-5 team_viewer">
<i class="material-icons font-7 logout_icon shopinfo">touch_app</i>
<span class="font-15 shopinfo" >Team Viewer</span>
</p>
</li> -->
</li>
<% end %>
<li>
<!-- <p class="delete waves-effect waves-block p-l-30 m-b-5" data-ref="<%=logout_path%>" data-method="delete">
@@ -136,6 +136,22 @@
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
$(".team_viewer").on('click',function(){
// /opt/teamviewer/tv_bin/script/teamviewer
$.ajax({
type: "POST",
data: {},
dataType: 'json',
url: "/run_teamviewer",
success: function(data){
if(!data.status){
window.open('https://www.teamviewer.com', '_blank');
return false;
}
}
});
});
});
</script>

View File

@@ -537,6 +537,8 @@ scope "(:locale)", locale: /en|mm/ do
get '/get_printer_options/:printer_name' => 'print_settings#get_printer_options'
resources :commissioners
post '/run_teamviewer' => 'home#run_teamviewer', :defaults => { :format => 'json' }
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
end