修改下载页面渲染

This commit is contained in:
zyj
2025-11-24 18:59:19 +08:00
parent 51cfd5cf21
commit 65d4d458d0
10 changed files with 2328 additions and 111 deletions

View File

@@ -127,6 +127,17 @@ export function DownloadSite(uri, obj) {
return $Call.ByID(2539977978, uri, obj);
}
/**
* DownloadSiteWithOptions 带配置选项的下载网站资源
* @param {string} uri
* @param {services$0.ResourcesList} obj
* @param {types$0.DownloadOptions} options
* @returns {$CancellablePromise<boolean>}
*/
export function DownloadSiteWithOptions(uri, obj, options) {
return $Call.ByID(540154920, uri, obj, options);
}
/**
* 启用站点
* @param {string} siteName
@@ -166,13 +177,23 @@ export function GetDownloadList() {
}));
}
/**
* GetDownloadOptions 获取下载配置
* @returns {$CancellablePromise<types$0.DownloadOptions>}
*/
export function GetDownloadOptions() {
return $Call.ByID(4070576415).then(/** @type {($result: any) => any} */(($result) => {
return $$createType8($result);
}));
}
/**
* GetDownloadStats 获取下载统计
* @returns {$CancellablePromise<{ [_: string]: any }>}
*/
export function GetDownloadStats() {
return $Call.ByID(180408518).then(/** @type {($result: any) => any} */(($result) => {
return $$createType8($result);
return $$createType9($result);
}));
}
@@ -183,7 +204,7 @@ export function GetDownloadStats() {
*/
export function GetNginxAccessLog(lines) {
return $Call.ByID(3967804239, lines).then(/** @type {($result: any) => any} */(($result) => {
return $$createType9($result);
return $$createType10($result);
}));
}
@@ -194,7 +215,7 @@ export function GetNginxAccessLog(lines) {
*/
export function GetNginxErrorLog(lines) {
return $Call.ByID(3102869025, lines).then(/** @type {($result: any) => any} */(($result) => {
return $$createType9($result);
return $$createType10($result);
}));
}
@@ -219,7 +240,7 @@ export function GetRecentDownloadRecords(limit) {
*/
export function GetResources(rawURL) {
return $Call.ByID(2167352808, rawURL).then(/** @type {($result: any) => any} */(($result) => {
return $$createType11($result);
return $$createType12($result);
}));
}
@@ -340,7 +361,8 @@ const $$createType4 = types$0.NginxSiteConfig.createFrom;
const $$createType5 = $Create.Array($$createType4);
const $$createType6 = utils$0.FileDir.createFrom;
const $$createType7 = $Create.Array($$createType6);
const $$createType8 = $Create.Map($Create.Any, $Create.Any);
const $$createType9 = $Create.Array($Create.Any);
const $$createType10 = services$0.ResourcesList.createFrom;
const $$createType11 = $Create.Nullable($$createType10);
const $$createType8 = types$0.DownloadOptions.createFrom;
const $$createType9 = $Create.Map($Create.Any, $Create.Any);
const $$createType10 = $Create.Array($Create.Any);
const $$createType11 = services$0.ResourcesList.createFrom;
const $$createType12 = $Create.Nullable($$createType11);

View File

@@ -3,5 +3,7 @@
// This file is automatically generated. DO NOT EDIT
export {
DownloadMode,
DownloadOptions,
NginxSiteConfig
} from "./models.js";

View File

@@ -6,6 +6,125 @@
// @ts-ignore: Unused imports
import { Create as $Create } from "@wailsio/runtime";
/**
* DownloadMode 下载模式
* @readonly
* @enum {string}
*/
export const DownloadMode = {
/**
* The Go zero value for the underlying type of the enum.
*/
$zero: "",
/**
* DownloadModeSameDomain 只下载同域名资源
*/
DownloadModeSameDomain: "same-domain",
/**
* DownloadModeAllResources 下载所有资源
*/
DownloadModeAllResources: "all-resources",
/**
* DownloadModeCustom 自定义下载规则
*/
DownloadModeCustom: "custom",
};
/**
* DownloadOptions 下载配置选项
*/
export class DownloadOptions {
/**
* Creates a new DownloadOptions instance.
* @param {Partial<DownloadOptions>} [$$source = {}] - The source object to create the DownloadOptions.
*/
constructor($$source = {}) {
if (!("mode" in $$source)) {
/**
* 下载模式
* @member
* @type {DownloadMode}
*/
this["mode"] = DownloadMode.$zero;
}
if (!("customDomains" in $$source)) {
/**
* 自定义域名列表(当 Mode = custom 时使用)
* @member
* @type {string[]}
*/
this["customDomains"] = [];
}
if (!("skipLargeFiles" in $$source)) {
/**
* 是否跳过超大文件
* @member
* @type {boolean}
*/
this["skipLargeFiles"] = false;
}
if (!("maxFileSize" in $$source)) {
/**
* 最大文件大小MB
* @member
* @type {number}
*/
this["maxFileSize"] = 0;
}
if (!("downloadExternalCSS" in $$source)) {
/**
* 是否下载外部CSS
* @member
* @type {boolean}
*/
this["downloadExternalCSS"] = false;
}
if (!("downloadExternalJS" in $$source)) {
/**
* 是否下载外部JS
* @member
* @type {boolean}
*/
this["downloadExternalJS"] = false;
}
if (!("downloadExternalImages" in $$source)) {
/**
* 是否下载外部图片
* @member
* @type {boolean}
*/
this["downloadExternalImages"] = false;
}
if (!("downloadExternalVideos" in $$source)) {
/**
* 是否下载外部视频
* @member
* @type {boolean}
*/
this["downloadExternalVideos"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new DownloadOptions instance from a string or object.
* @param {any} [$$source = {}]
* @returns {DownloadOptions}
*/
static createFrom($$source = {}) {
const $$createField1_0 = $$createType0;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("customDomains" in $$parsedSource) {
$$parsedSource["customDomains"] = $$createField1_0($$parsedSource["customDomains"]);
}
return new DownloadOptions(/** @type {Partial<DownloadOptions>} */($$parsedSource));
}
}
/**
* NginxSiteConfig 站点配置结构
*/