ADD_PATH : AADHAVAN
This commit is contained in:
parent
540985871a
commit
4eed069281
@ -221,7 +221,8 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const path =require('path');
|
||||||
|
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
//get value from .env
|
//get value from .env
|
||||||
@ -239,8 +240,9 @@
|
|||||||
function loadXML(xmlFileName) {
|
function loadXML(xmlFileName) {
|
||||||
|
|
||||||
//XmlPath get from .env
|
//XmlPath get from .env
|
||||||
const xmlPath=process.env.XML_FILE_PATH;
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
console.log(xmlFileName)
|
const xmlPath =path.join(__dirname,xmlPathenv);
|
||||||
|
console.log(xmlFileName)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
fs.readFile(`${xmlPath}`+xmlFileName, 'utf8', (error, data) => {
|
fs.readFile(`${xmlPath}`+xmlFileName, 'utf8', (error, data) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
@ -590,8 +590,10 @@ var xmlPath ="" //get the xml filepath in .env file local variable
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
|
const path = require('path');
|
||||||
//xmlPath added
|
//xmlPath added
|
||||||
xmlPath=process.env.XML_FILE_PATH;
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
|
xmlPath=path.join(__dirname, xmlPathenv);
|
||||||
// console.log(xmlPath);
|
// console.log(xmlPath);
|
||||||
const isEncrypted = process.env.ENCRYPTED;
|
const isEncrypted = process.env.ENCRYPTED;
|
||||||
// console.log(isEncrypted);
|
// console.log(isEncrypted);
|
||||||
|
|||||||
@ -275,8 +275,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const Swal = require('sweetalert2')
|
const Swal = require('sweetalert2');
|
||||||
|
|
||||||
function uploadFile() {
|
function uploadFile() {
|
||||||
|
console.log("file upload");
|
||||||
const fileInput = document.getElementById('fileInput');
|
const fileInput = document.getElementById('fileInput');
|
||||||
const selectedFile = fileInput.files[0];
|
const selectedFile = fileInput.files[0];
|
||||||
console.log(selectedFile)
|
console.log(selectedFile)
|
||||||
@ -289,7 +291,8 @@ var modal = document.getElementById('myModal');
|
|||||||
var fileInput = document.getElementById('fileInput');
|
var fileInput = document.getElementById('fileInput');
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
//XmlPath get from .env
|
//XmlPath get from .env
|
||||||
const xmlPath=process.env.XML_FILE_PATH;
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
|
const xmlPath = path.join(__dirname,xmlPathenv);
|
||||||
|
|
||||||
function fileupload(filePaths) {
|
function fileupload(filePaths) {
|
||||||
|
|
||||||
|
|||||||
6
main.js
6
main.js
@ -7,12 +7,14 @@ const jquery = require('jquery');
|
|||||||
let onlineStatus = true;
|
let onlineStatus = true;
|
||||||
const { dialog } = require('electron');
|
const { dialog } = require('electron');
|
||||||
const saveFile = require('./savexml')
|
const saveFile = require('./savexml')
|
||||||
require('dotenv').config()
|
require('dotenv').config({ path: path.join(__dirname, '.env') });
|
||||||
|
let mainWindow;
|
||||||
|
|
||||||
|
|
||||||
const auto_close= process.env.DISABLE_AUTO_CLOSE;
|
const auto_close= process.env.DISABLE_AUTO_CLOSE;
|
||||||
const auto_close_time = parseInt(process.env.AUTO_CLOSE_TIME) * 1000;
|
const auto_close_time = parseInt(process.env.AUTO_CLOSE_TIME) * 1000;
|
||||||
|
|
||||||
let mainWindow;
|
|
||||||
|
|
||||||
async function createWindow() {
|
async function createWindow() {
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
|
|||||||
1263
package-lock.json
generated
1263
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,12 +5,15 @@
|
|||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "start",
|
"test": "start",
|
||||||
"start": "electron ."
|
"start": "electron .",
|
||||||
|
"build": "cross-env NODE_ENV=production electron-packager . ProjectB --platform=win32 --arch=x64"
|
||||||
},
|
},
|
||||||
"author": "venkatesh",
|
"author": "venkatesh",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^26.1.0"
|
"electron": "^26.1.0",
|
||||||
|
"electron-packager": "^17.1.2",
|
||||||
|
"electron-wix-msi": "^5.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap-icons": "^1.11.1",
|
"bootstrap-icons": "^1.11.1",
|
||||||
|
|||||||
10
savexml.js
10
savexml.js
@ -2,12 +2,14 @@ const fs = require('fs');
|
|||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const Swal = require('sweetalert2')
|
const Swal = require('sweetalert2')
|
||||||
const encode = require('./encode')
|
const encode = require('./encode')
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
require('dotenv').config();
|
require('dotenv').config();
|
||||||
//Get the value from .env
|
//Get the value from .env
|
||||||
const isEncrypted = process.env.ENCRYPTED;
|
const isEncrypted = process.env.ENCRYPTED;
|
||||||
|
|
||||||
function saveXmlToFile(xmlData, filePath) {
|
function saveXmlToFile(xmlData, filePath) {
|
||||||
|
console.log(filePath);
|
||||||
// Check if the file path is provided
|
// Check if the file path is provided
|
||||||
if (!filePath) {
|
if (!filePath) {
|
||||||
console.error('File path is required.');
|
console.error('File path is required.');
|
||||||
@ -50,8 +52,8 @@ function savexml(UserFilename) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//XmlPath get from .env
|
//XmlPath get from .env
|
||||||
const xmlPath=process.env.XML_FILE_PATH;
|
const xmlPathenv=process.env.XML_FILE_PATH;
|
||||||
|
const xmlPath = path.join(__dirname, xmlPathenv)
|
||||||
// Get the json string from localStorage for set fileName
|
// Get the json string from localStorage for set fileName
|
||||||
var jsonData = localStorage.getItem("json");
|
var jsonData = localStorage.getItem("json");
|
||||||
|
|
||||||
@ -60,7 +62,9 @@ function savexml(UserFilename) {
|
|||||||
// var jsonfilename = `${UserFilename}.json`;
|
// var jsonfilename = `${UserFilename}.json`;
|
||||||
|
|
||||||
// file path where you want to save the XML file
|
// file path where you want to save the XML file
|
||||||
const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
// const xmlfilePath = process.cwd() + `/${xmlPath}` + xmlfilename;
|
||||||
|
|
||||||
|
const xmlfilePath = `${xmlPath}` + xmlfilename;
|
||||||
// const jsonfilePath = process.cwd() + '/xml/' + jsonfilename;
|
// const jsonfilePath = process.cwd() + '/xml/' + jsonfilename;
|
||||||
|
|
||||||
// Call the function to save the XML file
|
// Call the function to save the XML file
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user