- 应用外壳换成 stash-ui Layout:左侧导航(任务调度 / Python 镜像)+ 页面标题区,窄屏折叠为顶部导航 - 新增 python_mirrors 表与 CRUD/设默认接口,内置清华、阿里云、中科大、PyPI 官方 - Python 脚本任务运行时注入默认镜像的 PIP_INDEX_URL / UV_INDEX_URL,任务自身环境变量优先 - 新增镜像管理页与表单,支持新增、编辑、启用/停用、设默认、删除 - 重新生成 OpenAPI 与 TS 类型;补齐后端镜像测试、前端单测与 e2e,修复窄屏页面被宽表格撑开
63 lines
1.6 KiB
SQL
63 lines
1.6 KiB
SQL
CREATE TABLE IF NOT EXISTS python_mirrors (
|
|
id TEXT PRIMARY KEY NOT NULL,
|
|
name TEXT NOT NULL,
|
|
index_url TEXT NOT NULL,
|
|
trusted_host TEXT,
|
|
enabled INTEGER NOT NULL DEFAULT 1 CHECK (enabled IN (0, 1)),
|
|
is_default INTEGER NOT NULL DEFAULT 0 CHECK (is_default IN (0, 1)),
|
|
created_at TEXT NOT NULL,
|
|
updated_at TEXT NOT NULL
|
|
);
|
|
|
|
-- 同一时间只允许一个默认镜像
|
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_python_mirrors_default
|
|
ON python_mirrors(is_default)
|
|
WHERE is_default = 1;
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_python_mirrors_index_url
|
|
ON python_mirrors(index_url);
|
|
|
|
INSERT OR IGNORE INTO python_mirrors
|
|
(id, name, index_url, trusted_host, enabled, is_default, created_at, updated_at)
|
|
VALUES
|
|
(
|
|
'tsinghua',
|
|
'清华 TUNA',
|
|
'https://pypi.tuna.tsinghua.edu.cn/simple',
|
|
NULL,
|
|
1,
|
|
1,
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now'),
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
),
|
|
(
|
|
'aliyun',
|
|
'阿里云',
|
|
'https://mirrors.aliyun.com/pypi/simple/',
|
|
NULL,
|
|
1,
|
|
0,
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now'),
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
),
|
|
(
|
|
'ustc',
|
|
'中科大',
|
|
'https://pypi.mirrors.ustc.edu.cn/simple/',
|
|
NULL,
|
|
1,
|
|
0,
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now'),
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
),
|
|
(
|
|
'pypi',
|
|
'PyPI 官方',
|
|
'https://pypi.org/simple',
|
|
NULL,
|
|
1,
|
|
0,
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now'),
|
|
strftime('%Y-%m-%dT%H:%M:%fZ', 'now')
|
|
);
|