Skip to content

Commit

Permalink
feat: #341 整合所有配置,提供单一统一的配置入口页面-整合思源地址配置到底部统一的偏好设置
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Feb 8, 2023
1 parent b657095 commit 7c8b3f3
Show file tree
Hide file tree
Showing 31 changed files with 420 additions and 219 deletions.
35 changes: 33 additions & 2 deletions assets/style.css
Expand Up @@ -141,12 +141,43 @@ code {
margin-top: 10px !important;
}

.el-card__body {
text-align: left !important;
--el-card-padding: 10px;
}

.el-dialog {
--el-dialog-width: 88% !important;
--el-dialog-margin-top: 10vh;
margin: var(--el-dialog-margin-top, 15vh) auto 0 5.5%;
text-align: left !important;
}

.el-card__body {
--el-card-padding: 10px;
.el-dialog__header {
text-align: left !important;
}

.el-dialog__body {
padding-bottom: 10px !important;
}

.dialog-action {
margin: calc(var(--el-dialog-padding-primary) + 16px)
var(--el-dialog-padding-primary);
margin-bottom: 0;
padding-bottom: 0;
padding-right: 0;
margin-right: 0;
}

.dialog-action .el-form-item {
margin-bottom: 0 !important;
}

.dialog-action .el-form-item__content {
justify-content: flex-end;
}

.dialog-action .el-form-item__content .el-button {
margin-left: 10px;
}
4 changes: 2 additions & 2 deletions components/blog/BlogMain.vue
Expand Up @@ -185,7 +185,7 @@ import { onMounted, ref } from "vue"
import { LogFactory } from "~/utils/logUtil"
import { Post } from "~/utils/models/post"
import { goToPage } from "~/utils/otherlib/ChromeUtil"
import { getPageId, isInSiyuan } from "~/utils/platform/siyuan/siyuanUtil"
import { getPageId, isInSiyuanWidget } from "~/utils/platform/siyuan/siyuanUtil"
import { SiYuanApiAdaptor } from "~/utils/platform/siyuan/siYuanApiAdaptor"
import { mdToHtml, removeTitleNumber } from "~/utils/htmlUtil"
import { getByLength } from "~/utils/strUtil"
Expand Down Expand Up @@ -447,7 +447,7 @@ const handleNewWinPicgo = (index, row) => {
}
const initPage = async () => {
isInSiyuanEnv.value = isInSiyuan()
isInSiyuanEnv.value = isInSiyuanWidget()
const publishCfg = getPublishCfg()
isNewWin.value = parseBoolean(publishCfg.newWin)
Expand Down
20 changes: 11 additions & 9 deletions components/picgo/PicgoSetting.vue
Expand Up @@ -29,7 +29,9 @@
<div>
{{ $t("picgo.siyuan.tip") }} 。 从 0.7.0+
开始,支持多个配置文件切换,当前系统默认的 PicGO 配置文件为:
<pre style="display: inline-block"><code>{{ picgoCfg }}</code></pre>
<pre
style="display: inline-block"
><code>{{ picgoUtil.getPicgoCfgPath() }}</code></pre>
{{ $t("setting.picgo.refer.to") }}
<a
Expand Down Expand Up @@ -58,8 +60,10 @@
</el-tabs>
</div>
<div v-else>
<p>{{ $t("picgo.chrome.tip") }} 。</p>
<p>{{ $t("picgo.pic.setting.no.tip") }} 。</p>
<div class="picgo-browser-tip">
<p>{{ $t("picgo.chrome.tip") }} 。</p>
<p>{{ $t("picgo.pic.setting.no.tip") }} 。</p>
</div>
</div>
</template>
<script setup lang="ts">
Expand All @@ -70,7 +74,6 @@ import { ref } from "vue"
import picgoUtil from "~/utils/otherlib/picgoUtil"
const isReload = ref(false)
const picgoCfg = picgoUtil.getPicgoCfgPath()
const picgoSettingTabChange = () => {
isReload.value = !isReload.value
Expand All @@ -86,12 +89,11 @@ const picgoSettingTabChange = () => {
margin-inline-start: 0;
margin-inline-end: 0;
margin: 0 0 10px;
padding: 16px 16px 0;
padding: 16px 16px 16px;
}
@media only screen and (max-width: 900px) {
.picgo-setting-tip {
padding-bottom: 16px;
}
.picgo-browser-tip {
margin-left: 10px;
margin-right: 10px;
}
</style>
2 changes: 1 addition & 1 deletion components/publish/PublishService.vue
Expand Up @@ -71,7 +71,7 @@ import ServiceSwitch from "~/components/publish/tab/ServiceSwitch.vue"
import PostBind from "~/components/publish/tab/PostBind.vue"
import PlatformSetting from "~/components/publish/tab/PlatformSetting.vue"
import PlatformMain from "~/components/publish/tab/PlatformMain.vue"
import GeneralSetting from "~/components/publish/tab/GeneralSetting.vue"
import GeneralSetting from "~/components/set/GeneralSetting.vue"
import PicgoSetting from "~/components/picgo/PicgoSetting.vue"
const logger = LogFactory.getLogger("components/publish/PublishService.vue")
Expand Down
4 changes: 2 additions & 2 deletions components/publish/tab/DynamicPlatform.vue
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2022, Terwer . All rights reserved.
- Copyright (c) 2022-2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -184,7 +184,7 @@ import {
} from "~/utils/platform/dynamicConfig"
import { LogFactory } from "~/utils/logUtil"
import { checkKeyExists } from "~/utils/configUtil"
import { importPreDefinedPlatform } from "~/utils/import/importUtil"
import { importPreDefinedPlatform } from "~/utils/platform/import/platformImportUtil"
const logger = LogFactory.getLogger(
"components/publish/tab/DynamicPlatform.vue"
Expand Down
2 changes: 1 addition & 1 deletion components/publish/tab/PlatformSetting.vue
Expand Up @@ -162,7 +162,7 @@ import YuqueSetting from "~/components/publish/tab/setting/common/YuqueSetting.v
import KmsSetting from "~/components/publish/tab/setting/common/KmsSetting.vue"
import GithubSetting from "~/components/publish/tab/setting/GithubSetting.vue"
import MetaweblogSetting from "~/components/publish/tab/setting/MetaweblogSetting.vue"
import { PRE_DEFINED_PLATFORM_KEY_CONSTANTS } from "~/utils/import/PRE_DEFINED_PLATFORM_CONSTANTS"
import { PRE_DEFINED_PLATFORM_KEY_CONSTANTS } from "~/utils/platform/import/PRE_DEFINED_PLATFORM_CONSTANTS"
import { MetaweblogPlaceholder } from "~/utils/platform/metaweblog/metaweblogPlaceholder"
import { useI18n } from "vue-i18n"
Expand Down
4 changes: 2 additions & 2 deletions components/publish/tab/ServiceSwitch.vue
Expand Up @@ -24,7 +24,7 @@
-->

<template>
<el-form class="switch-form" inline>
<el-form class="switch-form" inline label-width="150px">
<!-- Github -->
<el-form-item :label="$t('service.switch.vuepress')">
<el-switch v-model="vuepressEnabled" @change="vuepressOnChange" />
Expand Down Expand Up @@ -216,6 +216,6 @@ onMounted(() => {

<style scoped>
.switch-form {
margin: 16px 10px;
margin: 0 10px 16px;
}
</style>
@@ -1,23 +1,23 @@
<!--
- Copyright (c) 2022, Terwer . All rights reserved.
- Copyright (c) 2022-2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
-
- This code is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License version 2 only, as
- published by the Free Software Foundation. Terwer designates this
- particular file as subject to the "Classpath" exception as provided
- by Terwer in the LICENSE file that accompanied this code.
-
-
- This code is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- version 2 for more details (a copy is included in the LICENSE file that
- accompanied this code).
-
-
- You should have received a copy of the GNU General Public License version
- 2 along with this work; if not, write to the Free Software Foundation,
- Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-
-
- Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
- or visit www.terwer.space if you need additional information or have any
- questions.
Expand All @@ -31,8 +31,8 @@
</template>

<script lang="ts" setup>
import ChangeLocal from "~/components/publish/tab/preference/ChangeLocal.vue"
import PreferenceSetting from "~/components/publish/tab/preference/PreferenceSetting.vue"
import ChangeLocal from "~/components/set/preference/ChangeLocal.vue"
import PreferenceSetting from "~/components/set/preference/PreferenceSetting.vue"
const props = defineProps({
isReload: {
Expand Down
14 changes: 9 additions & 5 deletions components/set/SetIndex.vue
Expand Up @@ -25,14 +25,17 @@

<template>
<el-tabs tab-position="left">
<el-tab-pane :label="$t('service.tab.publish.setting')">
<platform-setting />
<el-tab-pane :label="$t('blog.change.siyuan.api')">
<siyuan-api-setting :show-cancel="false" />
</el-tab-pane>
<el-tab-pane :label="$t('dynamic.platform.new')">
<dynamic-platform />
</el-tab-pane>
<el-tab-pane :label="$t('service.tab.service.switch')">
<service-switch />
</el-tab-pane>
<el-tab-pane :label="$t('dynamic.platform.new')">
<dynamic-platform />
<el-tab-pane :label="$t('service.tab.publish.setting')">
<platform-setting />
</el-tab-pane>
<el-tab-pane :label="$t('picgo.pic.setting')">
<picgo-setting />
Expand All @@ -48,5 +51,6 @@ import PlatformSetting from "~/components/publish/tab/PlatformSetting.vue"
import ServiceSwitch from "~/components/publish/tab/ServiceSwitch.vue"
import DynamicPlatform from "~/components/publish/tab/DynamicPlatform.vue"
import PicgoSetting from "~/components/picgo/PicgoSetting.vue"
import GeneralSetting from "~/components/publish/tab/GeneralSetting.vue"
import GeneralSetting from "~/components/set/GeneralSetting.vue"
import SiyuanApiSetting from "~/components/set/siyuanApiSetting.vue"
</script>
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2022, Terwer . All rights reserved.
- Copyright (c) 2022-2023, Terwer . All rights reserved.
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-
- This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,7 +25,7 @@

<template>
<div class="locale-changer">
<el-form label-width="100px">
<el-form label-width="150px">
<!-- 语言选项 -->
<el-form-item :label="$t('lang.choose')">
<el-select
Expand Down
Expand Up @@ -25,7 +25,7 @@

<template>
<div class="preference-setting">
<el-form label-width="100px">
<el-form label-width="150px" inline>
<el-form-item :label="$t('preference.setting.fixTitle')">
<el-switch
v-model="formData.fixTitle"
Expand Down

0 comments on commit 7c8b3f3

Please sign in to comment.