Skip to content

Commit e2d4b33

Browse files
committed
feat: 更多设置中增加在网页中预览的开关
1 parent c0ad385 commit e2d4b33

File tree

7 files changed

+31
-2
lines changed

7 files changed

+31
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store-front-end",
3-
"version": "2.14.334",
3+
"version": "2.14.335",
44
"private": true,
55
"scripts": {
66
"dev": "vite --host",

src/components/PreviewPanel.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<div class="actions">
2222
<a
23-
:href="getUrl(platform.path, true)"
23+
:href="getUrl(platform.path, appearanceSetting.displayPreviewInWebPage)"
2424
target="_blank"
2525
>
2626
<svg-icon
@@ -65,6 +65,12 @@
6565
import { useAppNotifyStore } from '@/store/appNotify';
6666
import SvgIcon from '@/components/SvgIcon.vue';
6767
import { useHostAPI } from '@/hooks/useHostAPI';
68+
import { storeToRefs } from "pinia";
69+
import { useSettingsStore } from '@/store/settings';
70+
71+
const settingsStore = useSettingsStore();
72+
const { changeAppearanceSetting } = settingsStore;
73+
const { appearanceSetting } = storeToRefs(settingsStore);
6874
6975
const includeUnsupportedProxy = ref(false);
7076
const { copy, isSupported } = useClipboard();

src/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,7 @@ export default {
897897
isSimpleShowRemarks: "Simple Mode Show items remarks",
898898
showFloatingRefreshButton: "Show floating refresh button",
899899
showFloatingAddButton: "Show floating add button",
900+
displayPreviewInWebPage: 'Display preview in web page',
900901
tabBar: 'Hide "Sync" Page',
901902
tabBar2: 'Hide "File" Page',
902903
auto2: "MoreSetting Key",

src/locales/zh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ export default {
886886
isSimpleShowRemarks: '简洁模式列表展示备注',
887887
showFloatingRefreshButton: '显示悬浮刷新按钮',
888888
showFloatingAddButton: '显示悬浮添加按钮',
889+
displayPreviewInWebPage: '在网页中预览',
889890
tabBar: '隐藏 "Gist 同步" 页',
890891
tabBar2: '隐藏 "文件" 页',
891892
auto2: '自定义设置 Key',

src/store/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export const useSettingsStore = defineStore("settingsStore", {
3939
isSubItemMenuFold: true,
4040
showFloatingRefreshButton: false,
4141
showFloatingAddButton: false,
42+
displayPreviewInWebPage: true,
4243
istabBar: false,
4344
istabBar2: false,
4445
subProgressStyle: "hidden",

src/types/store/settings.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface SettingsPostData {
3434
isSubItemMenuFold?: boolean; // 订阅项菜单折叠
3535
showFloatingRefreshButton?: boolean; // 显示悬浮刷新按钮
3636
showFloatingAddButton?: boolean; // 显示悬浮添加按钮
37+
displayPreviewInWebPage?: boolean; // 在网页中预览
3738
istabBar?: boolean; // 隐藏 "Gist 同步" 页
3839
istabBar2?: boolean; // 隐藏 "文件" 页
3940
subProgressStyle?: string; // 订阅进度样式

src/views/settings/moreSetting.vue

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,16 @@
123123
/>
124124
</template>
125125
</nut-cell>
126+
<nut-cell :title="$t(`moreSettingPage.displayPreviewInWebPage`)" class="cell-item">
127+
<template v-slot:link>
128+
<nut-switch
129+
class="my-switch"
130+
v-model="awDisplayPreviewInWebPage"
131+
size="mini"
132+
@change="setDisplayPreviewInWebPage"
133+
/>
134+
</template>
135+
</nut-cell>
126136

127137
<nut-cell :title="$t(`moreSettingPage.tabBar2`)" class="cell-item">
128138
<template v-slot:link>
@@ -282,6 +292,7 @@
282292
const awSimpleShowRemark = ref(false);
283293
const awShowFloatingRefreshButton = ref(false);
284294
const awShowFloatingAddButton = ref(true);
295+
const awDisplayPreviewInWebPage = ref(true);
285296
const awtabBar = ref(true);
286297
const awtabBar2 = ref(true);
287298
// const isEditing = ref(false);
@@ -402,6 +413,13 @@
402413
changeAppearanceSetting({ appearanceSetting: data });
403414
};
404415
416+
const setDisplayPreviewInWebPage = (displayPreviewInWebPage: boolean) => {
417+
const data = {
418+
...appearanceSetting.value,
419+
displayPreviewInWebPage: displayPreviewInWebPage
420+
}
421+
changeAppearanceSetting({ appearanceSetting: data });
422+
};
405423
const settabBar = (istabBar: boolean) => {
406424
// globalStore.settabBar(istabBar);
407425
const data = {
@@ -604,6 +622,7 @@
604622
awSimpleShowRemark.value = appearanceSetting.value.isSimpleShowRemark;
605623
awShowFloatingRefreshButton.value = appearanceSetting.value.showFloatingRefreshButton;
606624
awShowFloatingAddButton.value = appearanceSetting.value.showFloatingAddButton;
625+
awDisplayPreviewInWebPage.value = appearanceSetting.value.displayPreviewInWebPage;
607626
awtabBar.value = appearanceSetting.value.istabBar;
608627
awtabBar2.value = appearanceSetting.value.istabBar2;
609628
subProgressStyleValue.value = [appearanceSetting.value.subProgressStyle];

0 commit comments

Comments
 (0)