-
Notifications
You must be signed in to change notification settings - Fork 26
/
preload.js
163 lines (133 loc) · 4.47 KB
/
preload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
const { ipcRenderer, contextBridge } = require('electron')
contextBridge.exposeInMainWorld('btslite_api', {
//Run generic database queries
async dbQuery(query) {
const result = await ipcRenderer.invoke('db.query', query)
return result
},
//Run generic database queries
async submitCode(args) {
const result = await ipcRenderer.invoke('code.run', args)
return result
},
//Run migrations
async migrateUp() {
const result = await ipcRenderer.invoke('db.migrate-up')
return result
},
async createCategory(data) {
const result = await ipcRenderer.invoke('reports.create-category', data);
return result;
},
async updateCategory(data) {
const result = await ipcRenderer.invoke('reports.update-category', data);
return result;
},
async createReport(data) {
const result = await ipcRenderer.invoke('reports.create-report', data);
return result;
},
async updateReport(data) {
const result = await ipcRenderer.invoke('reports.update-report', data);
return result;
},
//launch file selection window
async shellOpenPath(path) {
const result = await ipcRenderer.invoke('shell.open-path', path);
return result;
},
//add message to log
async addToLog(message) {
const result = await ipcRenderer.invoke('log.add', message);
return result;
},
//parse cm data
async parseCmData(config) {
const result = await ipcRenderer.invoke('cm.parse-cm-data', config);
return result;
},
//parse cm data
async loadCmData(config) {
const result = await ipcRenderer.invoke('cm.load-cm-data', config);
return result;
},
//download reports
async reportsDownload(config) {
const result = await ipcRenderer.invoke('reports.download', config);
return result;
},
//show item in folder
async shellShowItemInFolder(path) {
const result = await ipcRenderer.invoke('shell.show-item-in-folder', path);
return result;
},
async getPath(path){
const result = await ipcRenderer.invoke('app.get-path', path);
return result;
},
async openPath(path){
const result = await ipcRenderer.invoke('shell.open-path', path);
return result;
},
async openDirectory(path){
const result = await ipcRenderer.invoke('dialog.open-directory', path);
return result;
},
async openLogFile(){
const result = await ipcRenderer.invoke('log.open-file', path);
return result;
},
async openLink(path){
const result = await ipcRenderer.invoke('shell.open-link', path);
return result;
},
async gisUploadFile(filename){
const result = await ipcRenderer.invoke('gis.upload-file', filename);
return result;
},
//Run baseline
async baselineRun(config){
const result = await ipcRenderer.invoke('baseline.run', config);
return result;
},
//Upload baseline
async baselineUpload(config){
const result = await ipcRenderer.invoke('baseline.upload', config);
return result;
},
//upload parameter reference
async uploadParameterReference(config){
const result = await ipcRenderer.invoke('telecomlib.upload-parameter-reference', config);
return result;
},
//auto generate parameter reference
async authoGenerateParameterRef(config){
const result = await ipcRenderer.invoke('telecomlib.auto-generate-parameter-reference', config);
return result;
},
//convert csv to excel
async convertCsvToExcel(config){
const result = await ipcRenderer.invoke('utilities.convert-csv-to-excel', config);
return result;
},
//get data header
async kmlGetDataHeader(config){
const result = await ipcRenderer.invoke('kml.get-data-header', config);
return result;
},
//generate KML file
async kmlGenerateKMLFile(config){
const result = await ipcRenderer.invoke('kml.generate-kml-file', config);
return result;
},
//open log file
async logOpenLogFile(config){
const result = await ipcRenderer.invoke('log.open-log-file', config);
return result;
},
//open log file
async downloadBaseLineRef(config){
const result = await ipcRenderer.invoke('baseline.download-ref', config);
return result;
}
})