instant ui launch
This commit is contained in:
parent
527ef78d36
commit
b4a832ae69
|
|
@ -203,6 +203,12 @@
|
||||||
currentUIOptions = await res.json();
|
currentUIOptions = await res.json();
|
||||||
renderSelect('dept_ou', currentUIOptions.ou_list, '请选择部门 OU...');
|
renderSelect('dept_ou', currentUIOptions.ou_list, '请选择部门 OU...');
|
||||||
renderSelect('base_group', currentUIOptions.base_group_list, '请选择基础组...');
|
renderSelect('base_group', currentUIOptions.base_group_list, '请选择基础组...');
|
||||||
|
|
||||||
|
// 如果列表包含 staff,设置为默认选项
|
||||||
|
if (currentUIOptions.base_group_list && currentUIOptions.base_group_list.includes('staff')) {
|
||||||
|
document.getElementById('base_group').value = 'staff';
|
||||||
|
}
|
||||||
|
|
||||||
renderCheckboxes('project_groups_container', 'project_groups_input', currentUIOptions.project_group_list);
|
renderCheckboxes('project_groups_container', 'project_groups_input', currentUIOptions.project_group_list);
|
||||||
renderCheckboxes('resource_groups_container', 'resource_groups_input', currentUIOptions.resource_group_list);
|
renderCheckboxes('resource_groups_container', 'resource_groups_input', currentUIOptions.resource_group_list);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
run.sh
23
run.sh
|
|
@ -1,15 +1,17 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
PYTHON_BIN="/opt/homebrew/Caskroom/miniconda/base/bin/python"
|
PYTHON_BIN="python3"
|
||||||
CONFIG_PATH="config/config.yaml"
|
CONFIG_PATH="config/config.yaml"
|
||||||
INPUT_FILE=""
|
INPUT_FILE=""
|
||||||
DRY_RUN="false"
|
DRY_RUN="false"
|
||||||
CONTINUE_ON_ERROR="true"
|
CONTINUE_ON_ERROR="true"
|
||||||
|
COMMAND=""
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
Usage:
|
Usage:
|
||||||
|
./run.sh ui
|
||||||
./run.sh
|
./run.sh
|
||||||
./run.sh -f users.csv
|
./run.sh -f users.csv
|
||||||
./run.sh -f users.xlsx
|
./run.sh -f users.xlsx
|
||||||
|
|
@ -17,6 +19,9 @@ Usage:
|
||||||
./run.sh -f users.xlsx --continue-on-error false
|
./run.sh -f users.xlsx --continue-on-error false
|
||||||
./run.sh -c config/config.yaml
|
./run.sh -c config/config.yaml
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
ui Start the Web UI in the background on port 9999
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-f <file> Batch input file (.csv/.xlsx). If omitted, interactive mode is used.
|
-f <file> Batch input file (.csv/.xlsx). If omitted, interactive mode is used.
|
||||||
-c <path> YAML config path (default: config/config.yaml)
|
-c <path> YAML config path (default: config/config.yaml)
|
||||||
|
|
@ -26,6 +31,12 @@ Options:
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 检查是否为独立的 ui 命令
|
||||||
|
if [[ "${1:-}" == "ui" ]]; then
|
||||||
|
COMMAND="ui"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-f)
|
-f)
|
||||||
|
|
@ -60,6 +71,16 @@ while [[ $# -gt 0 ]]; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ "${COMMAND}" == "ui" ]]; then
|
||||||
|
mkdir -p state
|
||||||
|
LOG_FILE="state/web.log"
|
||||||
|
nohup "${PYTHON_BIN}" -m ad_user_creator.main --config "${CONFIG_PATH}" web --port 9999 > "${LOG_FILE}" 2>&1 &
|
||||||
|
echo "UI 服务已在后台启动,监听 http://0.0.0.0:9999"
|
||||||
|
echo "PID: $!"
|
||||||
|
echo "日志: ${LOG_FILE}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "${INPUT_FILE}" ]]; then
|
if [[ -z "${INPUT_FILE}" ]]; then
|
||||||
CMD=("${PYTHON_BIN}" -m ad_user_creator.main --config "${CONFIG_PATH}" interactive)
|
CMD=("${PYTHON_BIN}" -m ad_user_creator.main --config "${CONFIG_PATH}" interactive)
|
||||||
if [[ "${DRY_RUN}" == "true" ]]; then
|
if [[ "${DRY_RUN}" == "true" ]]; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue