Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74355c1dd2 | ||
|
|
a446a1ba37 |
@@ -0,0 +1,28 @@
|
||||
# 皮肤选择卡片的预览图是怎么来的
|
||||
|
||||
面板「云端加密 → 验证界面」里 8 张预览图是**真机截图**,不是设计稿:
|
||||
|
||||
```
|
||||
frontend/public/theme-previews/{classic,dark,light,industrial,compact,split,card,terminal}.png
|
||||
```
|
||||
|
||||
统一 560×420(4:3),窗口居中、去掉黑边,单张 14–33KB,合计约 190KB。构建时由 Vite 原样拷进 `dist/theme-previews/`,页面里按 `/theme-previews/<theme>.png` 引用。
|
||||
|
||||
## 重新生成(换皮肤/改布局后要重跑)
|
||||
|
||||
1. **打 8 个样本**:`packthemed origin64.exe themed/prev_<theme>.exe cfg_prev_<theme>.json <theme>`
|
||||
- `cfg_prev_<theme>.json` 里的 `name` 用中性值(例如「示例软件」),不要留测试名
|
||||
- **`cfg` 里的 `theme` 必须和该主题一致**:`PatchSignedThemed` 只按第四个参数挑要嵌的 shell DLL,不会改写 cfg;cfg 里写错皮肤名,8 个产物会渲染成同一套
|
||||
2. **截图**:`/root/work/shot64.sh prev_classic prev_dark …`
|
||||
- `Xvfb :99` + `openbox` + `scrot`
|
||||
- **必须用独立的 64 位 prefix**(`WINEPREFIX=/root/.wine64 WINEARCH=win64`):装了 `wine32:i386` 之后默认 prefix 会报 `could not load kernel32.dll`
|
||||
- 每轮开始前 `wineserver -k` 并等到可见窗口数归零,否则会截到上一套皮肤的窗口
|
||||
3. **裁边 + 统一尺寸**:`python3 /root/work/mktheme_previews.py`
|
||||
- 不依赖 PIL:用 `ffmpeg -f rawvideo -pix_fmt rgb24` 取出像素
|
||||
- 窗口边界用**逐列/逐行亮像素密度**判定(阈值 + 最小像素数),避免桌面上的零星亮像素把边界撑大导致缩略图偏心
|
||||
- `scale=W:H:force_original_aspect_ratio=decrease` 后再 `pad`,保证任何宽高比的窗口都不变形
|
||||
4. **重新构建前端**:`npm run build`,否则页面拿到的还是旧的 `dist/theme-previews/`
|
||||
|
||||
## 位宽徽标
|
||||
|
||||
卡片右上角的徽标由 `themeBits()` 决定:`classic` 显示「32/64 位」,其余 7 套显示「64 位」—— 因为 DuiLib 皮肤只做了 64 位构建,32 位程序加壳时服务端会自动回落到经典壳。
|
||||
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -87,6 +87,18 @@ const themeOptions = computed(() => [
|
||||
{ value: 'terminal', label: t('admin.protect.themeTerminal') },
|
||||
])
|
||||
// DuiLib 壳目前只有 64 位构建;32 位程序产物会回落到 classic 壳(服务端处理)
|
||||
// 皮肤名形如「深色 · 卡密登录」:卡片上标题取前半,副标题取后半
|
||||
function themeTitle(label: string) {
|
||||
return label.split('·')[0].trim()
|
||||
}
|
||||
function themeSub(label: string) {
|
||||
const parts = label.split('·')
|
||||
return parts.length > 1 ? parts.slice(1).join('·').trim() : ''
|
||||
}
|
||||
// 位宽提示:经典壳 32/64 位都有产物,DuiLib 那几套只有 64 位构建
|
||||
function themeBits(theme: string) {
|
||||
return theme === 'classic' ? t('admin.protect.themeBits32') : t('admin.protect.themeBits64')
|
||||
}
|
||||
const themeDisabled = computed(() => false)
|
||||
|
||||
// 证书选择:直接列「每一套证书」(不再先选文件、再选身份)
|
||||
@@ -535,25 +547,46 @@ onBeforeUnmount(() => {
|
||||
{{ certOptionsForFile.length ? t('admin.protect.signProfileHint') : t('admin.protect.signProfileEmpty') }}
|
||||
</p>
|
||||
|
||||
<!-- 验证界面皮肤:云端加密时选择,产物里的壳按此渲染 -->
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
|
||||
<UiLabel class="shrink-0 text-sm font-medium">
|
||||
{{ t('admin.protect.themeLabel') }}
|
||||
</UiLabel>
|
||||
<UiSelect v-model="shellTheme" :disabled="themeDisabled">
|
||||
<UiSelectTrigger class="w-full sm:max-w-xs">
|
||||
<UiSelectValue :placeholder="t('admin.protect.themeClassic')" />
|
||||
</UiSelectTrigger>
|
||||
<UiSelectContent>
|
||||
<UiSelectItem v-for="o in themeOptions" :key="o.value" :value="o.value">
|
||||
{{ o.label }}
|
||||
</UiSelectItem>
|
||||
</UiSelectContent>
|
||||
</UiSelect>
|
||||
<!-- 验证界面皮肤:云端加密时选择,产物里的壳按此渲染(带界面预览,选哪套一眼就能看出来) -->
|
||||
<div class="space-y-3">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<UiLabel class="shrink-0 text-sm font-medium">
|
||||
{{ t('admin.protect.themeLabel') }}
|
||||
</UiLabel>
|
||||
<span class="text-xs text-muted-foreground">{{ t('admin.protect.themeGridHint') }}</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-3 sm:grid-cols-4">
|
||||
<button
|
||||
v-for="o in themeOptions" :key="o.value" type="button"
|
||||
class="group relative overflow-hidden rounded-lg border text-left transition-all"
|
||||
:class="shellTheme === o.value
|
||||
? 'border-primary ring-2 ring-primary/25'
|
||||
: 'border-border hover:border-primary/40'"
|
||||
@click="shellTheme = o.value"
|
||||
>
|
||||
<img
|
||||
:src="`/theme-previews/${o.value}.png`" :alt="o.label"
|
||||
class="aspect-[4/3] w-full bg-[#101419] object-cover transition-transform group-hover:scale-[1.02]"
|
||||
loading="lazy"
|
||||
>
|
||||
<span
|
||||
class="absolute right-1.5 top-1.5 rounded bg-black/55 px-1.5 py-0.5 text-[10px] leading-none text-white/90 backdrop-blur-sm"
|
||||
>{{ themeBits(o.value) }}</span>
|
||||
<div class="space-y-0.5 px-2 py-1.5">
|
||||
<div class="flex items-center justify-between gap-1">
|
||||
<span class="truncate text-xs font-medium">{{ themeTitle(o.label) }}</span>
|
||||
<CheckCircle2 v-if="shellTheme === o.value" class="size-3.5 shrink-0 text-primary" />
|
||||
</div>
|
||||
<p v-if="themeSub(o.label)" class="truncate text-[11px] text-muted-foreground">
|
||||
{{ themeSub(o.label) }}
|
||||
</p>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
{{ t('admin.protect.themeHint') }}
|
||||
</p>
|
||||
</div>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
{{ t('admin.protect.themeHint') }}
|
||||
</p>
|
||||
|
||||
<!-- 程序版本:壳拿它和平台已发布版本比对,决定是否提示/强制更新 -->
|
||||
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
|
||||
|
||||
@@ -2662,14 +2662,17 @@
|
||||
"themeDark": "Dark · card key login",
|
||||
"themeLight": "Light · office style",
|
||||
"themeIndustrial": "Industrial blue · device licensing",
|
||||
"themeHint": "DuiLib skins apply to 64-bit builds; 32-bit binaries keep the classic shell.",
|
||||
"themeHint": "DuiLib skins are 64-bit builds only; 32-bit programs fall back to the classic shell automatically.",
|
||||
"themeCompact": "Compact banner · single row",
|
||||
"themeSplit": "Split · brand sidebar",
|
||||
"themeCard": "Wide card · two columns",
|
||||
"themeTerminal": "Terminal style",
|
||||
"programVersionLabel": "Program version",
|
||||
"programVersionPlaceholder": "e.g. 1.2.3 (leave empty to skip update check)",
|
||||
"programVersionHint": "When set, the packaged program asks the platform for updates on startup. Publishing a newer version shows an update prompt; forced updates cannot be skipped."
|
||||
"programVersionHint": "When set, the packaged program asks the platform for updates on startup. Publishing a newer version shows an update prompt; forced updates cannot be skipped.",
|
||||
"themeGridHint": "Click a skin to apply it to the build — screenshots are from the real client",
|
||||
"themeBits64": "64-bit",
|
||||
"themeBits32": "32/64-bit"
|
||||
},
|
||||
"signProfiles": {
|
||||
"title": "Signing certificates",
|
||||
|
||||
@@ -2681,14 +2681,17 @@
|
||||
"themeDark": "深色 · 卡密登录",
|
||||
"themeLight": "浅色 · 办公风",
|
||||
"themeIndustrial": "工业蓝 · 设备授权",
|
||||
"themeHint": "DuiLib 皮肤目前 64 位生效;32 位程序仍用经典壳。选好皮肤后云端加密,产物弹窗就按该皮肤渲染。",
|
||||
"themeHint": "DuiLib 皮肤只做了 64 位构建,32 位程序固定用经典壳(服务端会自动回落)。选好后云端加密,产物验证弹窗就按这套皮肤渲染。",
|
||||
"themeCompact": "极简横幅 · 单行激活",
|
||||
"themeSplit": "左右分栏 · 品牌竖栏",
|
||||
"themeCard": "宽扁卡片 · 双列说明",
|
||||
"themeTerminal": "终端风 · 命令行",
|
||||
"programVersionLabel": "程序版本",
|
||||
"programVersionPlaceholder": "例如 1.2.3(留空则不检查更新)",
|
||||
"programVersionHint": "填了版本号后,程序启动时会向平台查询是否有更新;平台里发布更高版本就会弹出更新提示,设为强制更新时不允许跳过。"
|
||||
"programVersionHint": "填了版本号后,程序启动时会向平台查询是否有更新;平台里发布更高版本就会弹出更新提示,设为强制更新时不允许跳过。",
|
||||
"themeGridHint": "点一套直接套用到产物,下面是各套界面实拍",
|
||||
"themeBits64": "64 位",
|
||||
"themeBits32": "32/64 位"
|
||||
},
|
||||
"signProfiles": {
|
||||
"title": "签名证书",
|
||||
|
||||