change print settings for cloud
This commit is contained in:
@@ -15,8 +15,11 @@ div.form-inputs span{
|
||||
<div class="form-inputs p-l-15">
|
||||
<%= f.input :station_name %>
|
||||
<%= f.input :is_active %>
|
||||
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<% if(@server_mode != 'cloud') %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<% else %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => [], include_blank: false %>
|
||||
<% end %>
|
||||
<!-- <%= f.input :font_size %> -->
|
||||
<%= f.input :print_copy %>
|
||||
<%= f.hidden_field :processing_items %>
|
||||
@@ -63,4 +66,20 @@ div.form-inputs span{
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
var serverMode = "<%= @server_mode %>";
|
||||
if(serverMode == 'cloud'){
|
||||
var printers = code2lab.getPrinters();
|
||||
var printerInfo = JSON.parse([printers]);
|
||||
var select = $("#order_queue_station_printer_name");
|
||||
|
||||
$.each(printerInfo, function(key, value) {
|
||||
$('#order_queue_station_printer_name')
|
||||
.append($("<option></option>")
|
||||
.attr("value",value.target)
|
||||
.text(value.deviceName));
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user