url 配置项

This commit is contained in:
Cheney 2024-10-17 15:37:21 +08:00
parent 20782a7c24
commit b3ece1ad61
4 changed files with 20 additions and 9 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<project ver="10" name="awin" libEmbed="true" icon="..." ui="win" output="awin.exe" CompanyName="aardio" FileDescription="awin" LegalCopyright="Copyright (C) 作者 2024" ProductName="awin" InternalName="awin" FileVersion="0.0.0.1" ProductVersion="0.0.0.1" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<project ver="10" name="awin" libEmbed="true" icon="..." ui="win" output="awin.exe" CompanyName="aardio" FileDescription="awin" LegalCopyright="Copyright (C) 作者 2024" ProductName="awin" InternalName="awin" FileVersion="0.0.0.2" ProductVersion="0.0.0.2" publishDir="/dist/" dstrip="false" local="false" ignored="false">
<file name="main" path="main.aardio"/>
<folder name="窗体" path="forms" comment="" embed="true" local="false" ignored="false"/>
<folder name="网页" path="web" embed="true" comment="目录" local="true" ignored="false">

View File

@ -64,11 +64,16 @@ namespace init{
object.merge(configs, appDataConfig, true);
}
checkConfig(configs);
gLog.print("configs", util.table.stringify(configs, true));
return configs;
};
/*
* 默认配置
*/
checkConfig = function (config){
gLog.print("checkConfig");
if( ! config.window ){
config.window = {}
}
@ -78,6 +83,9 @@ namespace init{
if( ! config.window.height ) {
config.window.height = 500
}
if( (! config.frontend) or config.frontend == "" ){
config.frontend = "web/index.html"
}
return config;
}

View File

@ -110,13 +110,16 @@ import wsock.tcp.simpleHttpServer;
去掉下面的前端项目调试端口号 37151 或发布 EXE 后运行才会打开 "\web\index.html"。
否则打开 http://localhost:37151
*/
var url = gConfig.frontend
gLog.print("url=" , url)
if( gDebug ){
theView.go("\web\index.html",37151);
theView.go(url,37151);
} else {
theView.go("\web\index.html");
theView.go(url);
}
mainForm.show();
win.loopMessage();
// tray.delete();
// tray.delete();

View File

@ -1,11 +1,11 @@
{
"app" : "",
"title" : "",
"app" : "awin-portable-template",
"title" : "awin portable template",
"icon" : "",
"backend" : "",
"frontend" : "",
"frontend" : "dist/index.html",
"window" : {
"width" : "",
"height" : ""
"width" : 1024,
"height" : 768
}
}