diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 879145c2b..0cd05e256 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,6 @@ name: build on: + workflow_dispatch: push: branches: - master @@ -35,10 +36,11 @@ jobs: with: vercel-token: ${{ secrets.VERCEL_TOKEN }} # Required # github-token: ${{ secrets.GITHUB_TOKEN }} # Optional - vercel-args: "--prod" # Optional + vercel-args: "--prod --debug" # Optional vercel-org-id: ${{ secrets.ORG_ID}} # Required vercel-project-id: ${{ secrets.PROJECT_ID}} # Required working-directory: dist + vercel-version: '48.9.0' - name: zip run: | zip -r dist.zip dist diff --git a/.github/workflows/update-vercel-project-settings.yml b/.github/workflows/update-vercel-project-settings.yml new file mode 100644 index 000000000..1f019f18d --- /dev/null +++ b/.github/workflows/update-vercel-project-settings.yml @@ -0,0 +1,16 @@ +# 该 workflow 用于更新 Vercel 项目的 Node.js 版本 +name: Update Vercel project settings +on: + workflow_dispatch: + +jobs: + update-nodejs-version: + runs-on: ubuntu-latest + steps: + - name: Update Vercel project Node.js version + run: | + curl --request PATCH \ + --url https://api.vercel.com/v9/projects/${{ secrets.PROJECT_ID }} \ + --header 'Authorization: Bearer ${{ secrets.VERCEL_TOKEN }}' \ + --header 'Content-Type: application/json' \ + --data '{ "nodeVersion":"22.x"}' \ No newline at end of file diff --git a/package.json b/package.json index 7025c829d..a192fe412 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sub-store-front-end", - "version": "2.15.66", + "version": "2.16.18", "private": true, "scripts": { "dev": "vite --host", diff --git a/src/api/share/index.ts b/src/api/share/index.ts index 82bd8d9a6..2fd3f1438 100644 --- a/src/api/share/index.ts +++ b/src/api/share/index.ts @@ -11,10 +11,11 @@ export function useShareApi() { data, }); }, - deleteShare: (token: string): AxiosPromise => { + deleteShare: (token: string, type: string, name: string): AxiosPromise => { return request({ url: `/api/token/${encodeURIComponent(token)}`, method: "delete", + params: { type, name }, }); }, getShares: (type?: string, name?: string): AxiosPromise => { diff --git a/src/assets/icons/concurrency.svg b/src/assets/icons/concurrency.svg new file mode 100644 index 000000000..a20ea37a7 --- /dev/null +++ b/src/assets/icons/concurrency.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/headersCacheTtl.svg b/src/assets/icons/headersCacheTtl.svg new file mode 100644 index 000000000..df8390e54 --- /dev/null +++ b/src/assets/icons/headersCacheTtl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/resourceCacheTtl.svg b/src/assets/icons/resourceCacheTtl.svg new file mode 100644 index 000000000..215f22bef --- /dev/null +++ b/src/assets/icons/resourceCacheTtl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/scriptCacheTtl.svg b/src/assets/icons/scriptCacheTtl.svg new file mode 100644 index 000000000..2bedb77f9 --- /dev/null +++ b/src/assets/icons/scriptCacheTtl.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/styles/reduced-motion-fix.scss b/src/assets/styles/reduced-motion-fix.scss new file mode 100644 index 000000000..ae89d625d --- /dev/null +++ b/src/assets/styles/reduced-motion-fix.scss @@ -0,0 +1,40 @@ +/** + * 修复 modern-css-reset 在 prefers-reduced-motion 时的问题 + * + * 问题:modern-css-reset 将动画/过渡时间设置为 0.01ms,这会导致: + * 1. Notify 通知极快闪现 + * 2. 代码编辑器 cmView 滚动不跟手 + * 详见:https://github.com/sub-store-org/Sub-Store/issues/486 + * 解决方案:让动画和过渡完全禁用,针对性处理Notify和代码编辑器样式 + */ +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0s !important; + animation-iteration-count: 1 !important; + transition-duration: 0s !important; + scroll-behavior: auto !important; + } + + /* 需要保持动画的元素:添加 .keep-motion 类或使用特定前缀 */ + .keep-motion, + .keep-motion *, + [class^="Toastify"], + [class*=" Toastify"], + [class^="nut-toast"], + [class^="nut-overlay"] { + animation-duration: 0.5s !important; + transition-duration: 0.5s !important; + } + + // NutUI Toast.loading 动画 + .nut-toast-loading .nut-toast-icon-wrapper { + animation: rotation 1s linear infinite !important; + } + + .cmviewRef, + .cm-scroller { + scroll-behavior: auto !important; + } +} diff --git a/src/changelogs/2023-08-15.md b/src/changelogs/2023-08-15.md deleted file mode 100644 index 656279c48..000000000 --- a/src/changelogs/2023-08-15.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -date: 2023-08-15 ---- - -- 更新组件库 NutUI v3.3.8、Picker 问题修复 -- 解决反复重启并发消耗资源、降低资源占用内存 -- 移除:Monaco-Editor 组件 - -- 添加新主题、Simple 模式 主页与管理页 -- 自定义后端 HostAPI 更多使用场景 - -- 优化侧滑返回容易失效的问题 -- 修复左右滑动组件的时候 没有阻止会上下滑动 容易误触 -- 修复拖动卡片的时会把快捷方式跟着拖动 -- 脚本操作、正则操作、等平铺放置更容易添加操作 -- 点击订阅左边的图标才会预览,防止误触预览节点 -- 首页订阅页面:卡片左滑呼出快捷方式,可设置右滑呼出。ㅤ ㅤ -- 点击卡片空白处可关闭当前滑块。添加编辑方便修改 - -- 改进 Service Worker 通过将资源预缓存,更快、流畅地加载ㅤ ㅤ -- 网络连接稳定或不可用时仍能够访问程序 -- 增加预览时候的 V2Ray 入口 -- 新增长按卡片拖动排序,前端需 v2.14.6+ 后端 v2.14.13+ -- 首页订阅页面图标默认为黑白,可自定义开启图标为彩色 diff --git a/src/changelogs/2023-08-23.md b/src/changelogs/2023-08-23.md deleted file mode 100644 index 2baec1acb..000000000 --- a/src/changelogs/2023-08-23.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -date: 2023-08-23 ---- - -### 新增开关项 -- 订阅编辑页面 常用配置板块 默认开启 -- 添加简洁模式 卡片开启刷新按钮 默认关闭 \ No newline at end of file diff --git a/src/changelogs/2023-08-27.md b/src/changelogs/2023-08-27.md deleted file mode 100644 index b8d0440e1..000000000 --- a/src/changelogs/2023-08-27.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -date: 2023-08-27 ---- - -### 修复 - -- 修复了当隐藏同步页面时 tab bar 的 active 状态错误 - -### 优化 - -- 优化了订阅列表复制预览等按钮的操作逻辑 - -### 功能 - -- 域名解析服务增加了 Ali 和 Tencent (要求: 后端 >= 2.14.33) -- 新增了后端 API 管理页面,可以方便的在多个后端之间切换 -- 新增了在 url 查询参数传入 api 时可以自动将其加入后端 API 列表并切换至该 API diff --git a/src/changelogs/2023-08-28.md b/src/changelogs/2023-08-28.md deleted file mode 100644 index f95c01364..000000000 --- a/src/changelogs/2023-08-28.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -date: 2023-08-28 ---- - -### 功能 - -- 输出支持 Clash.Meta (要求: 后端 >= 2.14.35) - -### UI - -- 修复错位,标题栏偏移 \ No newline at end of file diff --git a/src/changelogs/2023-09-02.md b/src/changelogs/2023-09-02.md deleted file mode 100644 index f46bd9f22..000000000 --- a/src/changelogs/2023-09-02.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -date: 2023-10-26 ---- - -- 拖动排序失败回退 -- 检测后端版本启用 name 排序接口 -- 我的页面取消禁止滑动 -- 修复重复点击多次保存会提示重复的问题 \ No newline at end of file diff --git a/src/changelogs/2023-10-31.md b/src/changelogs/2023-10-31.md deleted file mode 100644 index e82ab7c50..000000000 --- a/src/changelogs/2023-10-31.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -date: 2023-10-31 ---- - -- 修复订阅/组合编辑编辑报错不显示的问题 -- 修复动态添加节点后无法预览的问题 \ No newline at end of file diff --git a/src/changelogs/2023-11-08.md b/src/changelogs/2023-11-08.md deleted file mode 100644 index 0efe51000..000000000 --- a/src/changelogs/2023-11-08.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -date: 2023-11-08 ---- - -- 为同步订阅项增加了点击预览来源订阅的功能(便于查看确认来源订阅是否正常) \ No newline at end of file diff --git a/src/changelogs/2023-11-25.md b/src/changelogs/2023-11-25.md deleted file mode 100644 index 3998d2c11..000000000 --- a/src/changelogs/2023-11-25.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -date: 2023-11-25 ---- - -- 支持设置默认 User-Agent(后端版本应 > 2.14.101) \ No newline at end of file diff --git a/src/changelogs/2024-01-12.md b/src/changelogs/2024-01-12.md deleted file mode 100644 index 041eb3f41..000000000 --- a/src/changelogs/2024-01-12.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -date: 2024-01-12 ---- - -### 阶段性更新汇总 - -- 同步配置支持文件(后端 > 2.14.144) - -- 新增文件功能 - -- 默认隐藏悬浮刷新按钮(可在设置中切换) - -- 支持 Surfboard - -- 节点操作中的正则支持拖拽排序 - -- 支持忽略失败的远程订阅 - -- 手动下载备份文件和使用备份上传恢复 - -- 支持按顺序合并本地和远程订阅 - -- 远程订阅支持换行输入多个订阅 - -- 预览节点时增加 JSON 数据便于查看复制 \ No newline at end of file diff --git a/src/changelogs/2024-01-29.md b/src/changelogs/2024-01-29.md deleted file mode 100644 index 37a534e13..000000000 --- a/src/changelogs/2024-01-29.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -date: 2024-01-29 ---- - -### UI - -- 优化 iOS PWA 下状态栏样式 - -- 适配桌面端左右滑动 diff --git a/src/changelogs/2024-04-23.md b/src/changelogs/2024-04-23.md deleted file mode 100644 index 1c77349fa..000000000 --- a/src/changelogs/2024-04-23.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -date: 2024-04-23 ---- - -### 阶段性更新汇总 - -此处的更新可能不完整不及时 - -Telegram 频道 https://t.me/cool_scripts 内有每次更新的详细说明 - -- 处理手动删除 Gist 之后, Sub-Store 侧重新同步的逻辑 - -- QX 输出正式支持 VLESS - -- 节点操作支持单项展开/收起 - -- 支持 Loon SOCKS5/SOCKS5-TLS - -- 支持 WireGuard URI 输入和输出 - -- 支持 dialer-proxy, detour - -- fancy-characters 增加 modifier-letter(小写没有 q, 用 ᵠ 替代. 大写缺的太多, 用小写替代) - -- 订阅支持输出哪吒探针兼容响应, 网络监控接口(Loon/Surge 可输出节点延迟) - -- 节点操作增加收起/展开按钮, 方便处理多个操作 - -- 远程订阅 URL 新增参数 validCheck 将检查订阅有效期和剩余流量 - -- 增加脚本说明文档链接 - -- HTML 中增加 version meta - -- 支持导出操作的数据到剪贴板, 从剪贴板数据导入操作 - -- 设置展示订阅进度 - -- 增加提示文案(部分浏览器上 HTTPS 前端无法访问本地 HTTP 后端) - -- 恢复数据后 重新加载页面 - -- 旗帜操作(支持更多选项) - -- 协议类型筛选支持 SSH - -- 增加 User-Agent 说明文案 - -- 预览界面显示保留/过滤节点数量并可跳转 - -- 预览界面增加端口 - -- 域名解析新增 IP4P, 支持禁用缓存 - -- 增加下载缓存阈值 - -- 文件预览界面增加复制预览内容按钮 - -- 订阅列表的流量信息兼容远程和本地合并的情况, 排除设置了不查询订阅信息的链接 - -- 支持显示剩余重置天数 - -- 支持自定义订阅流量信息 - -- 通过代理/节点/策略获取订阅 现已支持 Surge, Loon, Stash, Shadowrocket, QX, Node.js - -- 支持设置查询远程订阅流量信息时的 User-Agent - -- 支持收起/展开订阅 - -- 订阅支持标签分组 - -- 组合订阅中的子订阅支持分组筛选(仅支持筛选, 未实现动态绑定一个分组的所有订阅) - -- 支持参数 hideExpire 隐藏到期时间 - -- 订阅链接支持 `showRemaining` 参数, 此时将显示剩余流量而不是已用流量 - -- 支持设置并在远程订阅失败时读取最近一次成功的缓存 diff --git a/src/changelogs/2024-12-15.md b/src/changelogs/2024-12-15.md deleted file mode 100644 index 5a35c0fde..000000000 --- a/src/changelogs/2024-12-15.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -date: 2024-12-15 ---- - -### 阶段性更新汇总 - -此处的更新可能不完整不及时 - -Telegram 频道 https://t.me/cool_scripts 内有每次更新的详细说明 - -#### 核心功能增强 - -1. 协议支持 - -- 新增支持 Egern 输出 - -- 支持 VLESS mKcp - -- 支持 Juicity, SSH 等新协议 - -- 支持 Trojan, VMess, VLESS httpupgrade - -2. 解析优化 - -- 修复各类 URI 解析问题(SS, VMess, Trojan等) - -- 改进域名解析功能,支持自定义 EDNS 和 DoH - -- 优化无效节点处理逻辑 - -3. 代理与策略 - -- 新增全局代理/策略设置 - -- 支持文件和链接设置代理/策略 - -- 支持 direct 类型节点 - -#### 功能改进 - -1. 缓存与性能 - -- 默认缓存阈值调整为 1024KB - -- 默认超时调整为 8000ms - -- 优化乐观缓存逻辑 - -2. 订阅管理 - -- 支持订阅流量信息自定义 - -- 改进订阅刷新机制 - -- 支持定时处理订阅功能 - -3. 安全性 - -- 支持 JWT 和 token 管理 - -- 支持自定义 share token - -- 支持 insecure 模式不验证证书 - -#### UI/UX 改进 - -- 新增图标仓库功能 - -- 支持标签管理和排序 - -- 改进分享功能,支持二维码 - -- 优化界面样式和交互 - -#### 其他 - -- 增加更多的兼容性支持 - -- 修复各类 bug - -- 完善文档和说明 - -- 支持更多的配置选项 - -这些更新显著提升了软件的功能完整性、稳定性和用户体验。 diff --git a/src/changelogs/2025-03-02.md b/src/changelogs/2025-03-02.md deleted file mode 100644 index 58811fead..000000000 --- a/src/changelogs/2025-03-02.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -date: 2025-03-02 ---- - -### 阶段性更新汇总 - -此处的更新可能不完整不及时 - -Telegram 频道 https://t.me/cool_scripts 内有每次更新的详细说明 - -功能新增 - - • 区域过滤和协议过滤支持保留模式和过滤模式(后端需 >= 2.17.0, 前端需 >= 2.15.0) - - • 订阅管理 - - • 支持环境变量 SUB_STORE_PRODUCE_CRON 在后台定时处理订阅。 - - • 订阅支持开关 passThroughUA 透传请求的 User-Agent。 - - • 组合订阅支持手动设置流量信息,可使用链接,响应内容即为流量信息。 - - • 远程订阅支持透传请求的 User-Agent。 - - • 协议支持 - - • sing-box 及 Egern 支持 anytls 协议。 - - • Egern 和 Stash 可根据 User-Agent 自动包含官方/商店版/未续费订阅不支持的协议。 - - • Egern 正式支持 Shadowsocks 2022。 - - • Loon 正式支持 Shadowsocks 2022 和 Shadow-TLS。 - - • Surge 默认开启 Shadowsocks 2022。 - - • sing-box 及 Egern 支持 Hysteria2 端口跳跃。 - - • VLESS 支持 spx 参数;Trojan 支持 REALITY/XHTTP 结合使用。 - - • Proxy URI Scheme 支持省略端口号(HTTP 默认 80,TLS 默认 443)。 - - • Shadowrocket 的 Shadowsocks 输入支持 Shadow TLS 参数。 - - • Egern 支持 prev_hop 前置代理。 - - • Mihomo 配置 - - • Mihomo 配置支持 覆写 多次使用。 - - • Mihomo 配置的 Snell 版本 < 3 时,强制去除 udp 字段以防止内核报错。 - - • Mihomo 配置文件支持 流量信息链接 设置。 - -优化改进 - - • 解析 & 兼容性 - - • 修复 Shadowsocks URI 解析逻辑,支持 Shadow TLS plugin。 - - • UUID 仅辅助判断,不直接过滤;VMess/VLESS 校验 UUID。 - - • 兼容 v2rayN 非标 TUIC URI,并支持更多 TUIC URI 字段。 - - • Egern 增加默认 SNI。 - - • Loon 排除 XTLS。 - - • 界面优化 - - • 预览界面: - - • 复制分享链接优化,新增一键复制按钮。 - - • 订阅管理界面顶部标签栏始终显示,增加 PWA 判断。 - - • 修复宽屏设备下节点信息面板二维码样式问题。 - - • 文件管理 - - • target 名称适配大小写和别名。 - - • Mihomo 配置中订阅名称选取交互优化。 - - • 订阅流量信息去除空字段,增强兼容性。 - -修复 - - • 修复 Surge 输入的 tfo。 - - • 修复 Loon ip-mode 逻辑。 - - • 修复 Egern VMess tcp 传输层问题。 - - • 修复 TUIC URI 解析问题。 - - • 修复 组合订阅 透传 User-Agent 逻辑。 - - • 修复 Base64 解码合法性判断。 - - • 修复 Clash Pre-processor 逻辑。 - - • 修复 短 ID 正则匹配 问题。 - - • 修复 代理 App 版 target 参数为空的情况。 - -其他 - - • geo 数据更新。 - - • README 文档调整。 - - • pnpm 依赖更新,构建方式调整(使用 esbuild)。 - - • GitHub Actions 流水线优化。 - -这一版本包含了大量新增特性和修复,建议所有用户尽快更新! 🚀 \ No newline at end of file diff --git a/src/components/ArtifactsListItem.vue b/src/components/ArtifactsListItem.vue index c058de9cd..57076c036 100644 --- a/src/components/ArtifactsListItem.vue +++ b/src/components/ArtifactsListItem.vue @@ -85,7 +85,7 @@ - + {{ $t(`syncPage.syncSwitcher`) }} @@ -645,12 +645,7 @@ watch(isSyncOpen, async () => { } .sub-item-detail { - display: -webkit-box; - -webkit-box-orient: vertical; - -webkit-line-clamp: 3; word-wrap: break-word; - word-break: break-all; - // overflow: hidden; // margin-top: 3.5px; font-size: 12px; @@ -674,6 +669,9 @@ watch(isSyncOpen, async () => { // line-height: 2.8; color: var(--comment-text-color); } + .switch-label { + flex-shrink: 0; + } .my-switch { height: 22px; @@ -689,7 +687,11 @@ watch(isSyncOpen, async () => { } p { - display: block; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; + word-break: break-all; line-height: 1.8; } diff --git a/src/components/FileListItem.vue b/src/components/FileListItem.vue index 409484da1..edf7bed9b 100644 --- a/src/components/FileListItem.vue +++ b/src/components/FileListItem.vue @@ -47,9 +47,15 @@

{{ displayName || name }} + + {{ i }} +

{{ displayName || name }} + + {{ i }} +

@@ -289,6 +295,7 @@ props[props.type].displayName || props[props.type]['display-name']; const name = props[props.type].name; + const tag = props[props.type].tag; const remark = props[props.type].remark; const remarkText = computed(() => { if (remark) { @@ -587,6 +594,10 @@ overflow: hidden; font-size: 16px; color: var(--primary-text-color); + vertical-align: middle; + } + .tag { + margin: 0 2px; } .compare-sub-link, .share-sub-link, diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 7d8a1356a..d74b161ce 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -96,9 +96,10 @@ import { computed, ref, watchEffect, onMounted } from "vue"; import { useI18n } from "vue-i18n"; import { useRoute, useRouter } from "vue-router"; import { useGlobalStore } from "@/store/global"; +import { useSystemStore } from "@/store/system"; import { useSettingsStore } from '@/store/settings'; import { storeToRefs } from "pinia"; -import { Toast } from "@nutui/nutui"; +import { Toast, Dialog } from "@nutui/nutui"; import { initStores } from "@/utils/initApp"; import { useMethodStore } from '@/store/methodStore'; import { useAppNotifyStore } from "@/store/appNotify"; @@ -111,49 +112,21 @@ const router = useRouter(); const route = useRoute(); const methodStore = useMethodStore() const globalStore = useGlobalStore(); +const systemStore = useSystemStore(); const showLangSwitchPopup = ref(false); const langList = ["zh", "en"]; const settingsStore = useSettingsStore(); const { changeAppearanceSetting } = settingsStore; const { appearanceSetting } = storeToRefs(settingsStore); -// const { isSimpleMode, showFloatingRefreshButton } = storeToRefs(globalStore); -const isLandscape = ref(false); -const isSmall = ref(false); -const screenWidth = ref(window.innerWidth); -const screenHeight = ref(window.innerHeight); - -const handleResize = () => { - screenWidth.value = window.innerWidth; - screenHeight.value = window.innerHeight; -}; +// 从systemStore获取状态 +const { isPWA, isLandscape, isSmall } = storeToRefs(systemStore); onMounted(() => { - window.addEventListener("resize", handleResize); -}); -const isPWA = ref( - (window.matchMedia("(display-mode: standalone)").matches && - !/Android/.test(navigator.userAgent)) || - false -); - -// isPWA.value = true; -// isSmall.value = true; - -const navBarHeight = computed(() => { - return isPWA.value && !isLandscape.value ? (isSmall.value ? "78px" : "95px") : "56px"; + systemStore.initSystemState(); }); -const navBartop = computed(() => { - return isPWA.value && !isLandscape.value ? (isSmall.value ? "38px" : "55px") : "0px"; -}); - -const navBartopRight = computed(() => { - return isPWA.value && !isLandscape.value ? (isSmall.value ? "52px" : "65px") : "15px"; -}); - -const Pwa_top = computed(() => { - return isPWA.value ? (isSmall.value ? "20px" : "45px") : "45px"; -}); +// 使用systemStore中的计算属性 +const { navBarHeight, navBartop, navBartopRight, pwaTopPadding: Pwa_top } = storeToRefs(systemStore); const isNeedBack = computed(() => { return route.meta.needNavBack ?? false; @@ -170,18 +143,19 @@ const currentTitleWhetherAsk = computed(() => { }); const onClickNavbarIcon = () => { const metaTitle = route.meta.title; - const toastContent = + const content = t(`navBar.pagesTitle.askWhat.${metaTitle}.content`) || ""; - const toastTitle = t(`navBar.pagesTitle.askWhat.${metaTitle}.title`) || ""; - Toast.text(toastContent, { - title: toastTitle, - duration: 0, - cover: true, - "close-on-click-overlay": true, - "bg-color": "rgba(0, 0, 0, 0.8)", - "cover-color": "rgba(0, 0, 0, 0.2)", - "text-align-center": false, - }); + const title = t(`navBar.pagesTitle.askWhat.${metaTitle}.title`) || ""; + Dialog({ + title: title, + content: content, + popClass: 'auto-dialog', + textAlign: 'left', + okText: 'OK', + noCancelBtn: true, + closeOnPopstate: true, + lockScroll: false, + }); }; const changeLang = (type: string) => { @@ -245,11 +219,6 @@ const refresh = async () => { }, 1000); } }; -watchEffect(() => { - handleResize(); - isSmall.value = screenHeight.value < 750 || /iPad/.test(navigator.userAgent); - isLandscape.value = screenWidth.value > screenHeight.value; -}); diff --git a/src/views/FileEditor.vue b/src/views/FileEditor.vue index 751c67894..e62d9dcea 100644 --- a/src/views/FileEditor.vue +++ b/src/views/FileEditor.vue @@ -77,6 +77,23 @@
+ + + + + --> @@ -256,6 +273,7 @@ style="display: none" />
@@ -399,6 +417,13 @@

{{ t(`editorPage.subConfig.sourceNamePicker.emptyTips`) }}

+ + @@ -137,6 +135,7 @@ :deep(.nut-cell__value) { font-weight: normal; color: var(--primary-color); + cursor: pointer; } .bclass { @@ -166,6 +165,10 @@ margin: 0 var(--safe-area-side); border-radius: var(--item-card-radios); overflow: hidden; + a { + color: var(--primary-color); + font-weight: normal; + } } .about-wrapper { diff --git a/src/views/settings/moreSetting.vue b/src/views/settings/moreSetting.vue index ee84c430f..990adfa34 100644 --- a/src/views/settings/moreSetting.vue +++ b/src/views/settings/moreSetting.vue @@ -1,235 +1,152 @@ @@ -245,6 +162,7 @@ import { useI18n } from 'vue-i18n'; import { useAppNotifyStore } from "@/store/appNotify"; import { useSettingsApi } from "@/api/settings"; + import { useBackend } from "@/hooks/useBackend"; // import { Dialog } from '@nutui/nutui'; const { t } = useI18n(); @@ -265,10 +183,10 @@ // subProgressStyle, } = storeToRefs(globalStore); // 外观设置 - const { changeAppearanceSetting } = settingsStore; - const { appearanceSetting } = storeToRefs(settingsStore); + const { changeAppearanceSetting, changeSettings } = settingsStore; + const { appearanceSetting, gistUpload } = storeToRefs(settingsStore); const { showNotify } = useAppNotifyStore(); - + const { icon, env } = useBackend(); const InputHostApi = ref(''); const autoSwitchSync = ref(false); const SimpleSwitch = ref(false); @@ -282,18 +200,22 @@ const awShowFloatingRefreshButton = ref(false); const awShowFloatingAddButton = ref(true); const awDisplayPreviewInWebPage = ref(true); + const invalidShareFakeNode = ref(false); const awtabBar = ref(true); const awtabBar2 = ref(true); // const isEditing = ref(false); const isInit = ref(false); const subProgressStyleValue = ref(['hidden']); + const gistUploadValue = ref(['base64']); const pickerType = ref(''); const autoSwitch = ref(false); const showThemePicker = ref(false); // const isEditLoading = ref(false); const showSubProgressPicker = ref(false); - + const shareBtnVisible = computed(() => { + return env.value?.feature?.share; + }); const subProgressStyleName = computed(() => { return t(`moreSettingPage.subProgress.${subProgressStyleValue.value}`) }) @@ -305,6 +227,16 @@ } changeAppearanceSetting({ appearanceSetting: data }); }; + const showGistUploadPicker = ref(false); + + const gistUploadName = computed(() => { + return t(`moreSettingPage.gistUpload.${gistUploadValue.value}`) + }) + const gistUploadConfirm = ({ selectedValue }) => { + changeSettings({ + gistUpload: selectedValue[0] + }); + }; const setSimpleMode = (isSimpleMode: boolean) => { // globalStore.setSimpleMode(isSimpleMode); const data = { @@ -401,6 +333,13 @@ } changeAppearanceSetting({ appearanceSetting: data }); }; + const setInvalidShareFakeNode = (invalidShareFakeNode: boolean) => { + const data = { + ...appearanceSetting.value, + invalidShareFakeNode: invalidShareFakeNode + } + changeAppearanceSetting({ appearanceSetting: data }); + }; const settabBar = (istabBar: boolean) => { // globalStore.settabBar(istabBar); const data = { @@ -607,9 +546,11 @@ awShowFloatingRefreshButton.value = appearanceSetting.value.showFloatingRefreshButton; awShowFloatingAddButton.value = appearanceSetting.value.showFloatingAddButton; awDisplayPreviewInWebPage.value = appearanceSetting.value.displayPreviewInWebPage; + invalidShareFakeNode.value = appearanceSetting.value.invalidShareFakeNode; awtabBar.value = appearanceSetting.value.istabBar; awtabBar2.value = appearanceSetting.value.istabBar2; subProgressStyleValue.value = [appearanceSetting.value.subProgressStyle]; + gistUploadValue.value = [gistUpload.value]; // SimpleSwitch.value = isSimpleMode.value; // LeftRight.value = isLeftRight.value; // awIconColor.value = isIconColor.value; diff --git a/src/views/share/SharePopup.vue b/src/views/share/SharePopup.vue index 92efd0b0e..07fe29c95 100644 --- a/src/views/share/SharePopup.vue +++ b/src/views/share/SharePopup.vue @@ -229,9 +229,11 @@ input-align="left" rows="3" :autosize="{ maxHeight: 140 }" + readonly />
@@ -245,6 +247,7 @@ rows="1" :autosize="{ maxHeight: 140 }" max-length="100" + :readonly="!isUpdateShare" />
@@ -391,6 +394,7 @@ watchEffect(() => { form.name = props.data?.name; form.displayName = props.data?.displayName; form.type = props.data?.type; + form.token = props.data?.token; } else { form.expiresValue = ""; form.expiresUnit = "day"; @@ -511,6 +515,7 @@ const handleUpdateShare = async () => { console.log("form", form); console.log("props.data", props.data); isUpdateShare.value = true; + form.shareUrl = '' }, onCancel: () => { console.log("取消"); @@ -550,6 +555,12 @@ const handleCreateShare = async () => { if (res?.data?.status === "success") { isCreateShareLinkSuccess.value = true; const { token } = res.data.data; + if (!secretPath.value.startsWith('/')) { + Toast.fail(t('sharePage.magicPathErrorNotify')); + throw new Error( + t("sharePage.magicPathErrorNotify"), + ); + } const shareUrl = `${host.value.replace(new RegExp(`${secretPath.value}$`), "")}/share/${typeMap[form.type]}/${encodeURIComponent( props.data.name, )}?token=${encodeURIComponent(token)}`; @@ -565,7 +576,7 @@ const handleCreateShare = async () => { }; const confirmUpdateShare = async () => { - await subsStore.deleteShare(props.data?.token, false); + await subsStore.deleteShare(props.data?.token, props.data?.type, props.data?.name, false); await handleCreateShare(); };