Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VITE_LOCAL_SERVER_URL=http://localhost:9696
VITE_LOCAL_SERVER_PORT=9696
VITE_APP_VERSION='v4 R401'
VITE_APP_VERSION_CODE=401
VITE_APP_VERSION='v4 R400'
VITE_APP_VERSION_CODE=400
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
{
"name": "Launch via NPM",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
"run",
"dev"
],
"runtimeExecutable": "npm",
"windows": {
"runtimeExecutable": "nvm4w"
"runtimeExecutable": "npm.cmd"
},
"skipFiles": [
"<node_internals>/**"
Expand Down
59 changes: 37 additions & 22 deletions electron.vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,48 @@
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
*/
import {resolve} from 'path';
import {defineConfig, externalizeDepsPlugin, bytecodePlugin}
import {defineConfig, externalizeDepsPlugin, bytecodePlugin, loadEnv}
from 'electron-vite';

export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
sourcemap: true,
minify: false,
rollupOptions: {
input: {
index: resolve(__dirname, 'src/main/index.ts'),
express: resolve(__dirname, 'src/main/express.ts'),
export default defineConfig(({mode}) => {
const env = loadEnv(mode, process.cwd(), '');

return {
main: {
plugins: [externalizeDepsPlugin()],
build: {
sourcemap: true,
minify: false,
rollupOptions: {
input: {
index: resolve(__dirname, 'src/main/index.ts'),
express: resolve(__dirname, 'src/main/express.ts'),
},
external: ['better-sqlite3'],
},
external: ['better-sqlite3'],
},
},
},
preload: {
plugins: [externalizeDepsPlugin(), bytecodePlugin()],
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@shared': resolve('./src/shared'),
preload: {
plugins: [externalizeDepsPlugin(), bytecodePlugin()],
},
renderer: {
plugins: [
{
name: 'html-transform',
transformIndexHtml(html) {
return html.replace(
/%VITE_APP_VERSION%/g,
env.VITE_APP_VERSION || '4.0.0',
);
},
},
],
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
'@shared': resolve('./src/shared'),
},
},
},
},
};
});
20 changes: 10 additions & 10 deletions src/main/xmds/xmds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:RegisterDisplay>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <displayName xsi:type="xsd:string">' + this.config.displayName + '</displayName>\n' +
' <clientType xsi:type="xsd:string">' + this.config.getXmdsPlayerType() + '</clientType>\n' +
Expand Down Expand Up @@ -232,7 +232,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:RequiredFiles>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' </tns:RequiredFiles>\n' +
' </soap:Body>\n' +
Expand Down Expand Up @@ -262,7 +262,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:MediaInventory>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <mediaInventory xsi:type-="xsd:string">&lt;files&gt;' + files + '&lt;/files&gt;</mediaInventory>\n' +
' </tns:MediaInventory>\n' +
Expand Down Expand Up @@ -290,7 +290,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:Schedule>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' </tns:Schedule>\n' +
' </soap:Body>\n' +
Expand Down Expand Up @@ -318,7 +318,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:SubmitScreenShot>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <screenShot xsi:type-="xsd:base64Binary">iVBORw0KGgoAAAANSUhEUgAAAMgAAADIBAMAAABfdrOtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAADUExURQAAAKd6PdoAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAArSURBVHja7cExAQAAAMKg9U9tCU8gAAAAAAAAAAAAAAAAAAAAAAAAALipAU7oAAG73DR2AAAAAElFTkSuQmCC</screenShot>\n' +
' </tns:SubmitScreenShot>\n' +
Expand Down Expand Up @@ -366,7 +366,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:SubmitLog>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <logXml xsi:type="xsd:string">&lt;logs&gt;' + logsXmlStr + '&lt;/logs&gt;</logXml>\n' +
' </tns:SubmitLog>\n' +
Expand Down Expand Up @@ -436,7 +436,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:SubmitStats>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <statXml xsi:type="xsd:string">&lt;records&gt;' + statsXmlString + '&lt;/records&gt;</statXml>\n' +
' </tns:SubmitStats>\n' +
Expand All @@ -462,7 +462,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:NotifyStatus>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <status xsi:type-="xsd:string">' + this.config.state.toJson() + '</status>\n' +
' </tns:NotifyStatus>\n' +
Expand Down Expand Up @@ -490,7 +490,7 @@ export class Xmds {
// const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
// ' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
// ' <tns:ReportFaults>\n' +
// ' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
// ' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
// ' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
// ' <fault xsi:type-="xsd:string">' + faultsParam + '</fault>\n' +
// ' </tns:ReportFaults>\n' +
Expand All @@ -511,7 +511,7 @@ export class Xmds {
const soapXml = '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:xmds" xmlns:types="urn:xmds/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">\n' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">\n' +
' <tns:GetResource>\n' +
' <serverKey xsi:type="xsd:string">' + this.config.cmsKey + '</serverKey>\n' +
' <serverKey xsi:type="xsd:string"><![CDATA[' + this.config.cmsKey + ']]></serverKey>\n' +
' <hardwareKey xsi:type="xsd:string">' + this.config.hardwareKey + '</hardwareKey>\n' +
' <layoutId xsi:type="xsd:string">' + file.layoutId + '</layoutId>\n' +
' <regionId xsi:type="xsd:string">' + file.regionId + '</regionId>\n' +
Expand Down