Skip to content

Commit

Permalink
feat: 更多设置中增加在网页中预览的开关
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 12, 2025
1 parent c0ad385 commit e2d4b33
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.14.334",
"version": "2.14.335",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
8 changes: 7 additions & 1 deletion src/components/PreviewPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<div class="actions">
<a
:href="getUrl(platform.path, true)"
:href="getUrl(platform.path, appearanceSetting.displayPreviewInWebPage)"
target="_blank"
>
<svg-icon
Expand Down Expand Up @@ -65,6 +65,12 @@
import { useAppNotifyStore } from '@/store/appNotify';
import SvgIcon from '@/components/SvgIcon.vue';
import { useHostAPI } from '@/hooks/useHostAPI';
import { storeToRefs } from "pinia";
import { useSettingsStore } from '@/store/settings';
const settingsStore = useSettingsStore();
const { changeAppearanceSetting } = settingsStore;
const { appearanceSetting } = storeToRefs(settingsStore);
const includeUnsupportedProxy = ref(false);
const { copy, isSupported } = useClipboard();
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ export default {
isSimpleShowRemarks: "Simple Mode Show items remarks",
showFloatingRefreshButton: "Show floating refresh button",
showFloatingAddButton: "Show floating add button",
displayPreviewInWebPage: 'Display preview in web page',
tabBar: 'Hide "Sync" Page',
tabBar2: 'Hide "File" Page',
auto2: "MoreSetting Key",
Expand Down
1 change: 1 addition & 0 deletions src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,7 @@ export default {
isSimpleShowRemarks: '简洁模式列表展示备注',
showFloatingRefreshButton: '显示悬浮刷新按钮',
showFloatingAddButton: '显示悬浮添加按钮',
displayPreviewInWebPage: '在网页中预览',
tabBar: '隐藏 "Gist 同步" 页',
tabBar2: '隐藏 "文件" 页',
auto2: '自定义设置 Key',
Expand Down
1 change: 1 addition & 0 deletions src/store/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const useSettingsStore = defineStore("settingsStore", {
isSubItemMenuFold: true,
showFloatingRefreshButton: false,
showFloatingAddButton: false,
displayPreviewInWebPage: true,
istabBar: false,
istabBar2: false,
subProgressStyle: "hidden",
Expand Down
1 change: 1 addition & 0 deletions src/types/store/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ interface SettingsPostData {
isSubItemMenuFold?: boolean; // 订阅项菜单折叠
showFloatingRefreshButton?: boolean; // 显示悬浮刷新按钮
showFloatingAddButton?: boolean; // 显示悬浮添加按钮
displayPreviewInWebPage?: boolean; // 在网页中预览
istabBar?: boolean; // 隐藏 "Gist 同步" 页
istabBar2?: boolean; // 隐藏 "文件" 页
subProgressStyle?: string; // 订阅进度样式
Expand Down
19 changes: 19 additions & 0 deletions src/views/settings/moreSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@
/>
</template>
</nut-cell>
<nut-cell :title="$t(`moreSettingPage.displayPreviewInWebPage`)" class="cell-item">
<template v-slot:link>
<nut-switch
class="my-switch"
v-model="awDisplayPreviewInWebPage"
size="mini"
@change="setDisplayPreviewInWebPage"
/>
</template>
</nut-cell>

<nut-cell :title="$t(`moreSettingPage.tabBar2`)" class="cell-item">
<template v-slot:link>
Expand Down Expand Up @@ -282,6 +292,7 @@
const awSimpleShowRemark = ref(false);
const awShowFloatingRefreshButton = ref(false);
const awShowFloatingAddButton = ref(true);
const awDisplayPreviewInWebPage = ref(true);
const awtabBar = ref(true);
const awtabBar2 = ref(true);
// const isEditing = ref(false);
Expand Down Expand Up @@ -402,6 +413,13 @@
changeAppearanceSetting({ appearanceSetting: data });
};
const setDisplayPreviewInWebPage = (displayPreviewInWebPage: boolean) => {
const data = {
...appearanceSetting.value,
displayPreviewInWebPage: displayPreviewInWebPage
}
changeAppearanceSetting({ appearanceSetting: data });
};
const settabBar = (istabBar: boolean) => {
// globalStore.settabBar(istabBar);
const data = {
Expand Down Expand Up @@ -604,6 +622,7 @@
awSimpleShowRemark.value = appearanceSetting.value.isSimpleShowRemark;
awShowFloatingRefreshButton.value = appearanceSetting.value.showFloatingRefreshButton;
awShowFloatingAddButton.value = appearanceSetting.value.showFloatingAddButton;
awDisplayPreviewInWebPage.value = appearanceSetting.value.displayPreviewInWebPage;
awtabBar.value = appearanceSetting.value.istabBar;
awtabBar2.value = appearanceSetting.value.istabBar2;
subProgressStyleValue.value = [appearanceSetting.value.subProgressStyle];
Expand Down

0 comments on commit e2d4b33

Please sign in to comment.