Compare commits
No commits in common. "2b4ffb68113699bbd15db51405beaead5cf9f4d9" and "36afe6ce3f4e913b7a03437b99cb59d1f557f1d6" have entirely different histories.
2b4ffb6811
...
36afe6ce3f
BIN
pkg/.DS_Store
vendored
Normal file
BIN
pkg/.DS_Store
vendored
Normal file
Binary file not shown.
@ -21,7 +21,7 @@ func NewSource() error {
|
|||||||
}, Logger: logger.New(&log.Logger, logger.Config{
|
}, Logger: logger.New(&log.Logger, logger.Config{
|
||||||
Colorful: true,
|
Colorful: true,
|
||||||
IgnoreRecordNotFoundError: true,
|
IgnoreRecordNotFoundError: true,
|
||||||
LogLevel: lo.Ternary(viper.GetBool("debug.database"), logger.Info, logger.Silent),
|
LogLevel: lo.Ternary(viper.GetBool("debug"), logger.Info, logger.Silent),
|
||||||
})})
|
})})
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
@ -29,7 +29,7 @@ func NewServer() {
|
|||||||
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
JSONEncoder: jsoniter.ConfigCompatibleWithStandardLibrary.Marshal,
|
||||||
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
JSONDecoder: jsoniter.ConfigCompatibleWithStandardLibrary.Unmarshal,
|
||||||
BodyLimit: 50 * 1024 * 1024,
|
BodyLimit: 50 * 1024 * 1024,
|
||||||
EnablePrintRoutes: viper.GetBool("debug.print_routes"),
|
EnablePrintRoutes: viper.GetBool("debug"),
|
||||||
})
|
})
|
||||||
|
|
||||||
A.Use(idempotency.New())
|
A.Use(idempotency.New())
|
||||||
|
@ -25,18 +25,37 @@
|
|||||||
You are editing a post with alias <b class="font-mono">{{ editor.related.edit_to?.alias }}</b>
|
You are editing a post with alias <b class="font-mono">{{ editor.related.edit_to?.alias }}</b>
|
||||||
</v-alert>
|
</v-alert>
|
||||||
|
|
||||||
<v-textarea required class="mb-3" variant="outlined" label="Content"
|
<v-textarea
|
||||||
hint="The content supports markdown syntax" v-model="data.content" @paste="pasteMedia" />
|
required
|
||||||
|
class="mb-3"
|
||||||
|
variant="outlined"
|
||||||
|
label="Content"
|
||||||
|
hint="The content supports markdown syntax"
|
||||||
|
v-model="data.content"
|
||||||
|
@paste="pasteMedia"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-expansion-panels>
|
<v-expansion-panels>
|
||||||
<v-expansion-panel title="Brief describe">
|
<v-expansion-panel title="Brief describe">
|
||||||
<template #text>
|
<template #text>
|
||||||
<div class="mt-1">
|
<div class="mt-1">
|
||||||
<v-text-field required variant="solo-filled" density="comfortable" label="Title" :loading="reverting"
|
<v-text-field
|
||||||
v-model="data.title" />
|
required
|
||||||
|
variant="solo-filled"
|
||||||
|
density="comfortable"
|
||||||
|
label="Title"
|
||||||
|
:loading="reverting"
|
||||||
|
v-model="data.title"
|
||||||
|
/>
|
||||||
|
|
||||||
<v-textarea required auto-grow variant="solo-filled" density="comfortable" label="Description"
|
<v-textarea
|
||||||
v-model="data.description" />
|
required
|
||||||
|
auto-grow
|
||||||
|
variant="solo-filled"
|
||||||
|
density="comfortable"
|
||||||
|
label="Description"
|
||||||
|
v-model="data.description"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</v-expansion-panel>
|
</v-expansion-panel>
|
||||||
@ -47,8 +66,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<p class="text-xs">Your content will visible for public at</p>
|
<p class="text-xs">Your content will visible for public at</p>
|
||||||
<p class="text-lg font-medium">
|
<p class="text-lg font-medium">
|
||||||
{{ data.published_at ? new Date(data.published_at).toLocaleString() : new Date().toLocaleString()
|
{{ data.published_at ? new Date(data.published_at).toLocaleString() : new Date().toLocaleString() }}
|
||||||
}}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<v-btn size="small" icon="mdi-pencil" variant="text" @click="dialogs.plan = true" />
|
<v-btn size="small" icon="mdi-pencil" variant="text" @click="dialogs.plan = true" />
|
||||||
@ -169,29 +187,16 @@ async function postArticle(evt: SubmitEvent) {
|
|||||||
})
|
})
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
|
form.reset()
|
||||||
|
router.push({ name: "posts.details.articles", params: { alias: data.alias } })
|
||||||
success.value = true
|
success.value = true
|
||||||
editor.show.article = false
|
editor.show.article = false
|
||||||
|
|
||||||
resetEditor(form)
|
|
||||||
router.push({ name: "posts.details.articles", params: { alias: data.alias } })
|
|
||||||
} else {
|
} else {
|
||||||
error.value = await res.text()
|
error.value = await res.text()
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetEditor(target: HTMLFormElement) {
|
|
||||||
target.reset()
|
|
||||||
data.value = {
|
|
||||||
title: "",
|
|
||||||
content: "",
|
|
||||||
description: "",
|
|
||||||
realm_id: null,
|
|
||||||
published_at: null,
|
|
||||||
attachments: []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const media = ref<any>(null)
|
const media = ref<any>(null)
|
||||||
|
|
||||||
function pasteMedia(evt: ClipboardEvent) {
|
function pasteMedia(evt: ClipboardEvent) {
|
||||||
|
@ -6,20 +6,40 @@
|
|||||||
You are editing a post with alias <b class="font-mono">{{ editor.related.edit_to?.alias }}</b>
|
You are editing a post with alias <b class="font-mono">{{ editor.related.edit_to?.alias }}</b>
|
||||||
</v-alert>
|
</v-alert>
|
||||||
|
|
||||||
<v-textarea required persistent-counter variant="outlined" label="What's happened?!" counter="1024"
|
<v-textarea
|
||||||
v-model="data.content" @paste="pasteMedia" />
|
required
|
||||||
|
persistent-counter
|
||||||
|
variant="outlined"
|
||||||
|
label="What's happened?!"
|
||||||
|
counter="1024"
|
||||||
|
v-model="data.content"
|
||||||
|
@paste="pasteMedia"
|
||||||
|
/>
|
||||||
|
|
||||||
<div class="flex mt-[-18px]">
|
<div class="flex mt-[-18px]">
|
||||||
<v-tooltip text="Planned publish" location="start">
|
<v-tooltip text="Planned publish" location="start">
|
||||||
<template #activator="{ props }">
|
<template #activator="{ props }">
|
||||||
<v-btn v-bind="props" type="button" variant="text" icon="mdi-calendar" size="small"
|
<v-btn
|
||||||
@click="dialogs.plan = true" />
|
v-bind="props"
|
||||||
|
type="button"
|
||||||
|
variant="text"
|
||||||
|
icon="mdi-calendar"
|
||||||
|
size="small"
|
||||||
|
@click="dialogs.plan = true"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</v-tooltip>
|
</v-tooltip>
|
||||||
<v-tooltip text="Media" location="start">
|
<v-tooltip text="Media" location="start">
|
||||||
<template #activator="{ props }">
|
<template #activator="{ props }">
|
||||||
<v-btn v-bind="props" icon class="text-none" type="button" variant="text" size="small"
|
<v-btn
|
||||||
@click="dialogs.media = true">
|
v-bind="props"
|
||||||
|
icon
|
||||||
|
class="text-none"
|
||||||
|
type="button"
|
||||||
|
variant="text"
|
||||||
|
size="small"
|
||||||
|
@click="dialogs.media = true"
|
||||||
|
>
|
||||||
<v-badge v-if="data.attachments.length > 0" :content="data.attachments.length">
|
<v-badge v-if="data.attachments.length > 0" :content="data.attachments.length">
|
||||||
<v-icon icon="mdi-camera" />
|
<v-icon icon="mdi-camera" />
|
||||||
</v-badge>
|
</v-badge>
|
||||||
@ -72,8 +92,8 @@ import { getAtk } from "@/stores/userinfo"
|
|||||||
import { reactive, ref, watch } from "vue"
|
import { reactive, ref, watch } from "vue"
|
||||||
import { useRoute, useRouter } from "vue-router"
|
import { useRoute, useRouter } from "vue-router"
|
||||||
import PlannedPublish from "@/components/publish/parts/PlannedPublish.vue"
|
import PlannedPublish from "@/components/publish/parts/PlannedPublish.vue"
|
||||||
import PublishArea from "@/components/publish/parts/PublishArea.vue"
|
|
||||||
import Media from "@/components/publish/parts/Media.vue"
|
import Media from "@/components/publish/parts/Media.vue"
|
||||||
|
import PublishArea from "@/components/publish/parts/PublishArea.vue"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const editor = useEditor()
|
const editor = useEditor()
|
||||||
@ -115,11 +135,10 @@ async function postMoment(evt: SubmitEvent) {
|
|||||||
body: JSON.stringify(payload)
|
body: JSON.stringify(payload)
|
||||||
})
|
})
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
form.reset()
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
success.value = true
|
success.value = true
|
||||||
editor.show.moment = false
|
editor.show.moment = false
|
||||||
|
|
||||||
resetEditor(form)
|
|
||||||
router.push({ name: "posts.details.moments", params: { alias: data.alias } })
|
router.push({ name: "posts.details.moments", params: { alias: data.alias } })
|
||||||
} else {
|
} else {
|
||||||
error.value = await res.text()
|
error.value = await res.text()
|
||||||
@ -127,16 +146,6 @@ async function postMoment(evt: SubmitEvent) {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetEditor(target: HTMLFormElement) {
|
|
||||||
target.reset()
|
|
||||||
data.value = {
|
|
||||||
content: "",
|
|
||||||
realm_id: null,
|
|
||||||
published_at: null,
|
|
||||||
attachments: []
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const media = ref<any>(null)
|
const media = ref<any>(null)
|
||||||
|
|
||||||
function pasteMedia(evt: ClipboardEvent) {
|
function pasteMedia(evt: ClipboardEvent) {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
debug = true
|
||||||
|
|
||||||
name = "Solarplaza"
|
name = "Solarplaza"
|
||||||
maintainer = "SmartSheep Studio"
|
maintainer = "SmartSheep Studio"
|
||||||
|
|
||||||
@ -7,10 +9,6 @@ secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi"
|
|||||||
|
|
||||||
content = "uploads"
|
content = "uploads"
|
||||||
|
|
||||||
[debug]
|
|
||||||
database = false
|
|
||||||
print_routes = false
|
|
||||||
|
|
||||||
[identity]
|
[identity]
|
||||||
client_id = "solarplaza"
|
client_id = "solarplaza"
|
||||||
client_secret = "Z9k9AFTj^p"
|
client_secret = "Z9k9AFTj^p"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user