print setting for jade print
This commit is contained in:
@@ -94,7 +94,6 @@ $(document).on('turbolinks:load', function() {
|
|||||||
oqs_append.empty();
|
oqs_append.empty();
|
||||||
var filter = $('.filter').text();
|
var filter = $('.filter').text();
|
||||||
|
|
||||||
console.log(table_id)
|
|
||||||
//Start Ajax
|
//Start Ajax
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
|||||||
@@ -18,10 +18,12 @@ class PrintSettingsController < ApplicationController
|
|||||||
# GET /print_settings/new
|
# GET /print_settings/new
|
||||||
def new
|
def new
|
||||||
@print_setting = PrintSetting.new
|
@print_setting = PrintSetting.new
|
||||||
|
@server_mode = ENV["SERVER_MODE"]
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /print_settings/1/edit
|
# GET /print_settings/1/edit
|
||||||
def edit
|
def edit
|
||||||
|
@server_mode = ENV["SERVER_MODE"]
|
||||||
end
|
end
|
||||||
|
|
||||||
# POST /print_settings
|
# POST /print_settings
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||||
|
|
||||||
<!-- Google Fonts -->
|
<!-- Google Fonts -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
|
<!-- <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
|
||||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> -->
|
||||||
|
|
||||||
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
|
<div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@@ -11,7 +10,16 @@
|
|||||||
<%= f.input :unique_code %>
|
<%= f.input :unique_code %>
|
||||||
<%= f.input :template %>
|
<%= f.input :template %>
|
||||||
<%= f.input :font %>
|
<%= f.input :font %>
|
||||||
|
<%
|
||||||
|
if(@server_mode != 'cloud')
|
||||||
|
%>
|
||||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
<%= 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 :brand_name %>
|
<%= f.input :brand_name %>
|
||||||
<%= f.input :printer_type %>
|
<%= f.input :printer_type %>
|
||||||
<%= f.input :api_settings %>
|
<%= f.input :api_settings %>
|
||||||
@@ -64,9 +72,23 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
var serverMode = "<%= @server_mode %>";
|
||||||
|
if(serverMode == 'cloud'){
|
||||||
|
var printers = code2lab.getPrinters();
|
||||||
|
var printerInfo = JSON.parse([printers]);
|
||||||
|
var select = $("#print_setting_printer_name");
|
||||||
|
|
||||||
|
$.each(printerInfo, function(key, value) {
|
||||||
|
$('#print_setting_printer_name')
|
||||||
|
.append($("<option></option>")
|
||||||
|
.attr("value",value.target)
|
||||||
|
.text(value.deviceName));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// if selected printer change call and bind
|
// if selected printer change call and bind
|
||||||
$("#print_setting_printer_name").on("change", function(){
|
$("#print_setting_printer_name").on("change", function(){
|
||||||
|
if(serverMode != 'cloud'){
|
||||||
var printer_name = $(this).val();
|
var printer_name = $(this).val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
@@ -76,6 +98,10 @@
|
|||||||
$("#print_setting_api_settings").val(result.url);
|
$("#print_setting_api_settings").val(result.url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$("#print_setting_api_settings").val($(this).val());
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
development:
|
development:
|
||||||
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
secret_key_base: b61d85f8ed2a1a9e0eeece3443b3e8f838d002cc1d9f32115d8e93db920e2957adfedc57501d44741211538f3108b742cdeada87d5bfae796c53da1f90a3cd61
|
||||||
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
sx_provision_url: connect.smartsales.dev/api #connect.smartsales.dev/api #connect.smartsales.asia/api #provision.zsai.ws/api
|
||||||
server_mode: application
|
server_mode: cloud
|
||||||
cipher_type: AES-256-CBC
|
cipher_type: AES-256-CBC
|
||||||
sx_key: Wh@t1$C2L
|
sx_key: Wh@t1$C2L
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user