mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-15 22:19:18 +00:00
Add: AppAsarUpdate and GitOverCdn
This commit is contained in:
parent
3397869195
commit
49f4b9618e
@ -157,6 +157,9 @@ Deploy:
|
||||
# '["alas"]' specified "alas" config
|
||||
# '["alas","alas2"]' specified "alas" "alas2" configs
|
||||
Run: null
|
||||
# To update app.asar
|
||||
# [In most cases] true
|
||||
AppAsarUpdate: true
|
||||
# --no-sandbox. https://github.com/electron/electron/issues/30966
|
||||
# Some Windows systems cannot call the GPU normally for virtualization, and you need to manually turn off sandbox mode
|
||||
NoSandbox: false
|
||||
|
@ -157,6 +157,9 @@ Deploy:
|
||||
# '["alas"]' specified "alas" config
|
||||
# '["alas","alas2"]' specified "alas" "alas2" configs
|
||||
Run: null
|
||||
# To update app.asar
|
||||
# [In most cases] true
|
||||
AppAsarUpdate: true
|
||||
# --no-sandbox. https://github.com/electron/electron/issues/30966
|
||||
# Some Windows systems cannot call the GPU normally for virtualization, and you need to manually turn off sandbox mode
|
||||
NoSandbox: false
|
||||
|
@ -48,8 +48,8 @@ class AppManager(DeployConfig):
|
||||
def app_update(self):
|
||||
logger.hr(f'Update app', 0)
|
||||
|
||||
if not self.AutoUpdate:
|
||||
logger.info('AutoUpdate is disabled, skip')
|
||||
if not self.AppAsarUpdate:
|
||||
logger.info('AppAsarUpdate is disabled, skip')
|
||||
Progress.UpdateAlasApp()
|
||||
return False
|
||||
|
||||
|
@ -55,13 +55,18 @@ class ConfigModel:
|
||||
|
||||
# Webui
|
||||
WebuiHost: str = "0.0.0.0"
|
||||
WebuiPort: int = 22267
|
||||
WebuiPort: int = 22367
|
||||
Language: str = "en-US"
|
||||
Theme: str = "default"
|
||||
DpiScaling: bool = True
|
||||
Password: Optional[str] = None
|
||||
CDN: Union[str, bool] = False
|
||||
Run: Optional[str] = None
|
||||
AppAsarUpdate: bool = True
|
||||
NoSandbox: bool = True
|
||||
|
||||
# Dynamic
|
||||
GitOverCdn: bool = False
|
||||
|
||||
|
||||
class DeployConfig(ConfigModel):
|
||||
@ -75,6 +80,13 @@ class DeployConfig(ConfigModel):
|
||||
self.config_template = {}
|
||||
self.read()
|
||||
|
||||
self.GitOverCdn = self.Repository in ['cn']
|
||||
if self.Repository in [
|
||||
'cn',
|
||||
'global',
|
||||
]:
|
||||
self.Repository = 'https://github.com/LmeSzinc/StarRailCopilot'
|
||||
|
||||
self.write()
|
||||
self.show_config()
|
||||
|
||||
|
@ -157,6 +157,9 @@ Deploy:
|
||||
# '["alas"]' specified "alas" config
|
||||
# '["alas","alas2"]' specified "alas" "alas2" configs
|
||||
Run: null
|
||||
# To update app.asar
|
||||
# [In most cases] true
|
||||
AppAsarUpdate: true
|
||||
# --no-sandbox. https://github.com/electron/electron/issues/30966
|
||||
# Some Windows systems cannot call the GPU normally for virtualization, and you need to manually turn off sandbox mode
|
||||
NoSandbox: false
|
||||
|
@ -504,6 +504,22 @@ class ConfigGenerator:
|
||||
# update('template-docker', docker)
|
||||
# update('template-docker-cn', docker, cn)
|
||||
|
||||
tpl = {
|
||||
'Repository': '{{repository}}',
|
||||
'GitExecutable': '{{gitExecutable}}',
|
||||
'PythonExecutable': '{{pythonExecutable}}',
|
||||
'AdbExecutable': '{{adbExecutable}}',
|
||||
'Language': '{{language}}',
|
||||
'Theme': '{{theme}}',
|
||||
}
|
||||
def update(file, *args):
|
||||
new = deepcopy(template)
|
||||
for dic in args:
|
||||
new.update(dic)
|
||||
poor_yaml_write(data=new, file=file)
|
||||
|
||||
update('./webapp/packages/main/public/deploy.yaml.tpl', tpl)
|
||||
|
||||
def insert_assignment(self):
|
||||
from tasks.assignment.keywords import AssignmentEntry
|
||||
assignments = [entry.name for entry in AssignmentEntry.instances.values()]
|
||||
|
@ -1,8 +1,8 @@
|
||||
Deploy:
|
||||
Git:
|
||||
# URL of AzurLaneAutoScript repository
|
||||
# [CN user] Use 'git://git.lyoko.io/AzurLaneAutoScript' for faster and more stable download
|
||||
# [Other] Use 'https://github.com/LmeSzinc/AzurLaneAutoScript'
|
||||
# [CN user] Use 'cn' to get update from git-over-cdn service
|
||||
# [Other] Use 'global' to get update from https://github.com/LmeSzinc/StarRailCopilot
|
||||
Repository: {{repository}}
|
||||
# Branch of Alas
|
||||
# [Developer] Use 'dev', 'app', etc, to try new features
|
||||
@ -128,8 +128,8 @@ Deploy:
|
||||
WebuiHost: 0.0.0.0
|
||||
# --port. Port to listen
|
||||
# You will be able to access webui via `http://{host}:{port}`
|
||||
# [In most cases] Default to 22267
|
||||
WebuiPort: 22267
|
||||
# [In most cases] Default to 22367
|
||||
WebuiPort: 22367
|
||||
# Language to use on web ui
|
||||
# 'zh-CN' for Chinese simplified
|
||||
# 'en-US' for English
|
||||
|
@ -9,6 +9,6 @@ export async function initAppConfigStore() {
|
||||
appStore.setRepository(
|
||||
(repositoryValueMap[config?.repository] as 'global' | 'china') ?? 'global',
|
||||
);
|
||||
appStore.setWebuiUrl(config?.webuiUrl ?? '127.0.0.1:22267');
|
||||
appStore.setWebuiUrl(config?.webuiUrl ?? '127.0.0.1:22367');
|
||||
appStore.setAlasPath(config?.alasPath ?? '');
|
||||
}
|
||||
|
1
webapp/types/index.d.ts
vendored
1
webapp/types/index.d.ts
vendored
@ -64,6 +64,7 @@ declare interface DefAlasConfig {
|
||||
Password: null | string;
|
||||
CDN: boolean;
|
||||
Run: null | string;
|
||||
AppAsarUpdate: boolean;
|
||||
NoSandbox: boolean;
|
||||
};
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user