Skip to content

Commit

Permalink
feat: 优化部分交互
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 16, 2023
1 parent 651ec0d commit 141732c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
4 changes: 1 addition & 3 deletions src/adaptors/api/hexo/hexoYamlConverterAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class HexoYamlConverterAdaptor extends YamlConvertAdaptor {
yamlFormatObj.yamlObj.title = post.title

// date
// yamlFormatObj.yamlObj.date = post.dateCreated
yamlFormatObj.yamlObj.date = DateUtil.formatIsoToZh(post.dateCreated.toISOString(), true)

// updated
yamlFormatObj.yamlObj.updated = DateUtil.formatIsoToZh(new Date().toISOString(), true)
Expand Down Expand Up @@ -97,8 +97,6 @@ export class HexoYamlConverterAdaptor extends YamlConvertAdaptor {

// formatter
let yaml = YamlUtil.obj2Yaml(yamlFormatObj.yamlObj)
// 修复yaml的ISO日期格式(js-yaml转换的才需要)
yaml = DateUtil.formatIsoToZhDate(yaml)
this.logger.debug("yaml=>", yaml)

yamlFormatObj.formatter = yaml
Expand Down
5 changes: 2 additions & 3 deletions src/components/publish/form/EditModeSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ const emit = defineEmits(["emitSyncEditMode"])
// methods
const onEditModeChange = (val: PageEditMode) => {
if (emit) {
emit("emitSyncEditMode", val)
}
pageModeData.etype = val
emit("emitSyncEditMode", val)
}
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/components/publish/form/SourceMode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { createAppLogger } from "~/src/utils/appLogger.ts"
import { Post } from "zhi-blog-api"
import { BrowserUtil } from "zhi-device"
import { ElMessage } from "element-plus"
import { StrUtil, YamlUtil } from "zhi-common"
import { DateUtil, StrUtil, YamlUtil } from "zhi-common"
import { CommonBlogConfig } from "~/src/adaptors/api/base/commonBlogConfig.ts"
import { YamlFormatObj } from "~/src/models/yamlFormatObj.ts"
import Adaptors from "~/src/adaptors"
Expand Down Expand Up @@ -135,7 +135,7 @@ const onYamlContentInput = (val: any) => {
logger.debug("准备emit =>", formData.siyuanPost)
emit("emitSyncPost", formData.siyuanPost)
formData.syncStatus = "success"
formData.syncMessage = "YAML已解析成功并同步。同步时间 =>" + new Date().toISOString()
formData.syncMessage = "YAML已解析成功并同步。同步时间 =>" + DateUtil.formatIsoToZh(new Date().toISOString(), true)
} catch (e) {
formData.syncStatus = "error"
formData.syncMessage = "YAML解析失败,YAML将不可用,错误如下 =>" + e
Expand Down
8 changes: 6 additions & 2 deletions src/layouts/default/DefaultFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ const goGithub = () => {
window.open("https://github.com/terwer/siyuan-plugin-publisher")
}
const goAbout = () => {
window.open("https://blog.terwer.space/about")
const goAbout = async () => {
// window.open("https://blog.terwer.space/about")
await router.push({
path: "/about",
query: { showBack: "true" },
})
}
const goToApiTest = () => {
Expand Down
36 changes: 19 additions & 17 deletions src/pages/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,30 @@ const formData = reactive({
</script>

<template>
<div id="about-box">
<div class="logo">
<img src="../../icon.png" alt="logo" />
</div>
<div class="notice">
<p class="title">发布工具 v{{ formData.v }}</p>

<div class="param slogan">
<span>{{ t("slogan.make.written.fun") }}</span>
<back-page title="关于作者">
<div id="about-box">
<div class="logo">
<img src="../../icon.png" alt="logo" />
</div>
<div class="space"></div>
<div class="param">Created by terwer</div>
<div class="notice">
<p class="title">发布工具 v{{ formData.v }}</p>

<div class="param slogan">
<span>{{ t("slogan.make.written.fun") }}</span>
</div>
<div class="space"></div>
<div class="param">Created by <a href="https://terwer.space/about.html" target="_blank">terwer</a></div>

<div class="space"></div>
<div class="third-libs">
<div class="lib-title">Thanks for third party libraries:</div>
<div class="lib-container">
<div class="lib-item" v-for="(value, key) in formData.deps">{{ key }} ({{ value }})</div>
<div class="space"></div>
<div class="third-libs">
<div class="lib-title">Thanks for third party libraries:</div>
<div class="lib-container">
<div class="lib-item" v-for="(value, key) in formData.deps">{{ key }} ({{ value }})</div>
</div>
</div>
</div>
</div>
</div>
</back-page>
</template>

<style scoped lang="stylus">
Expand Down

0 comments on commit 141732c

Please sign in to comment.