This commit is contained in:
Yukino Song
2025-02-08 03:37:42 +08:00
parent 137845f8e5
commit dca9092a2c
6 changed files with 394 additions and 354 deletions

View File

@@ -399,7 +399,7 @@
<button @click="showEditForm = false" class="btn btn-secondary m-2">
{{ $t('_common.cancel') }}
</button>
<button class="btn btn-primary m-2" @click="save">{{ $t('_common.save') }}</button>
<button class="btn btn-primary m-2" :disabled="!editForm.name.trim()" @click="save">{{ $t('_common.save') }}</button>
</div>
</div>
</div>
@@ -418,18 +418,18 @@
import { Dropdown } from 'bootstrap/dist/js/bootstrap'
const newApp = {
name: "",
output: "",
cmd: [],
"name": "New App",
"output": "",
"cmd": "",
"exclude-global-prep-cmd": false,
elevated: false,
"elevated": false,
"auto-detach": true,
"wait-all": true,
"exit-timeout": 5,
"prep-cmd": [],
detached: [],
"detached": [],
"image-path": "",
"scale-factor": "100",
"scale-factor": 100,
"use-app-identity": false,
"per-client-app-identity": false,
"allow-client-commands": true,
@@ -526,11 +526,19 @@
"Are you sure to delete " + app.name + "?"
);
if (resp) {
this.actionDisabled = true;
fetch("./api/apps/delete?uuid=" + app.uuid, {
credentials: 'include',
method: "POST"
}).then((r) => {
if (r.status === 200) document.location.reload();
}).then((r) => r.json())
.then((r) => {
if (!r.status) {
alert("Delete failed! " + r.error);
}
})
.finally(() => {
this.actionDisabled = false;
this.loadApps();
});
}
},
@@ -643,14 +651,26 @@
},
save() {
this.editForm.name = this.editForm.name.trim();
if (!this.editForm.name) {
return;
}
this.editForm["exit-timeout"] = parseInt(this.editForm["exit-timeout"]) || 5
this.editForm["scale-factor"] = parseInt(this.editForm["scale-factor"]) || 100
this.editForm["image-path"] = this.editForm["image-path"].toString().trim().replace(/"/g, '');
delete this.editForm["id"];
fetch("./api/apps", {
credentials: 'include',
method: "POST",
body: JSON.stringify(this.editForm),
}).then((r) => {
if (r.status === 200) document.location.reload();
}).then((r) => r.json())
.then((r) => {
if (!r.status) {
alert(this.$t('apps.save_failed') + r.error);
}
})
.finally(() => {
this.showEditForm = false;
this.loadApps();
});
},
},

View File

@@ -50,6 +50,7 @@
"cmd_prep_name": "Command Preparations",
"covers_found": "Covers Found",
"delete": "Delete",
"delete_failed": "App delete failed: ",
"detached_cmds": "Detached Commands",
"detached_cmds_add": "Add Detached Command",
"detached_cmds_desc": "A list of commands to be run in the background.",
@@ -91,6 +92,7 @@
"per_client_app_identity": "Per Client App Identity",
"per_client_app_identity_desc": "Separate the app's identity per-client. Useful when you want different virtual display configurations on this specific app for different clients",
"run_as_desc": "This can be necessary for some applications that require administrator permissions to run properly. Might cause URL schemes to fail.",
"save_failed": "Failed to save app: ",
"wait_all": "Continue streaming until all app processes exit",
"wait_all_desc": "This will continue streaming until all processes started by the app have terminated. When unchecked, streaming will stop when the initial app process exits, even if other app processes are still running.",
"working_dir": "Working Directory",

View File

@@ -50,6 +50,7 @@
"cmd_prep_name": "命令准备工作",
"covers_found": "找到的封面",
"delete": "删除",
"delete_failed": "APP删除失败",
"detached_cmds": "独立命令",
"detached_cmds_add": "添加独立命令",
"detached_cmds_desc": "要在后台运行的命令列表。",
@@ -90,6 +91,7 @@
"per_client_app_identity": "按客户端区分 App 身份",
"per_client_app_identity_desc": "当你希望在使用此 App 时每个客户端都有不同的虚拟显示器组合配置时有用。",
"run_as_desc": "这可能是某些需要管理员权限才能正常运行的应用程序所必需的。可能会导致 URL schemes 无法正常启动。",
"save_failed": "保存APP失败",
"wait_all": "继续串流直到所有应用进程退出",
"wait_all_desc": "这将继续串流直到应用程序启动的所有进程终止。 当未选中时,串流将在初始应用进程终止时停止,即使其他应用进程仍在运行。",
"working_dir": "工作目录",