mirror of https://github.com/requarks/wiki
parent
f8bc9e8c24
commit
291fe26272
@ -0,0 +1,31 @@
|
||||
---
|
||||
title: Home
|
||||
description: Welcome to your wiki!
|
||||
published: true
|
||||
---
|
||||
|
||||
Feel free to modify this page (or delete it!).
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Configure your wiki in the [Administration Area](/_admin).
|
||||
- [Modify your profile](/_profile) to set preferences or change your password.
|
||||
- Create new pages by clicking the <kbd>+</kbd> button in the upper right corner.
|
||||
- Edit the navigation by clicking the <kbd>Edit Nav</kbd> button in the lower left corner.
|
||||
|
||||
## Read the documentation
|
||||
|
||||
How do permissions work? How can I make my wiki publicly accessible?
|
||||
|
||||
It's all [in the docs](https://beta.js.wiki/docs/admin/groups)!
|
||||
|
||||
## Example Blocks
|
||||
|
||||
Did you know that you can insert dynamic [blocks](https://beta.js.wiki/docs/editor/blocks)?
|
||||
|
||||
For example, here are the 5 most recently updated pages on your wiki:
|
||||
|
||||
::block-index{orderBy="updatedAt" orderByDirection="desc" limit="5"}
|
||||
::
|
||||
|
||||
This list will automatically update as you create / edit pages.
|
After Width: | Height: | Size: 454 B |
@ -0,0 +1,109 @@
|
||||
<template lang='pug'>
|
||||
q-dialog(ref='dialogRef', @hide='onDialogHide')
|
||||
q-card(style='min-width: 550px; max-width: 850px;')
|
||||
q-card-section.card-header
|
||||
q-icon(name='img:/_assets/icons/fluent-delete-bin.svg', left, size='sm')
|
||||
span {{ t(`fileman.assetDelete`) }}
|
||||
q-card-section
|
||||
.text-body2
|
||||
i18n-t(keypath='fileman.assetDeleteConfirm')
|
||||
template(#name)
|
||||
strong {{assetName}}
|
||||
.text-caption.text-grey.q-mt-sm {{ t('fileman.assetDeleteId', { id: assetId }) }}
|
||||
q-card-actions.card-actions
|
||||
q-space
|
||||
q-btn.acrylic-btn(
|
||||
flat
|
||||
:label='t(`common.actions.cancel`)'
|
||||
color='grey'
|
||||
padding='xs md'
|
||||
@click='onDialogCancel'
|
||||
)
|
||||
q-btn(
|
||||
unelevated
|
||||
:label='t(`common.actions.delete`)'
|
||||
color='negative'
|
||||
padding='xs md'
|
||||
@click='confirm'
|
||||
:loading='state.isLoading'
|
||||
)
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import gql from 'graphql-tag'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useDialogPluginComponent, useQuasar } from 'quasar'
|
||||
import { reactive } from 'vue'
|
||||
|
||||
// PROPS
|
||||
|
||||
const props = defineProps({
|
||||
assetId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
assetName: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
// EMITS
|
||||
|
||||
defineEmits([
|
||||
...useDialogPluginComponent.emits
|
||||
])
|
||||
|
||||
// QUASAR
|
||||
|
||||
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
||||
const $q = useQuasar()
|
||||
|
||||
// I18N
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
// DATA
|
||||
|
||||
const state = reactive({
|
||||
isLoading: false
|
||||
})
|
||||
|
||||
// METHODS
|
||||
|
||||
async function confirm () {
|
||||
state.isLoading = true
|
||||
try {
|
||||
const resp = await APOLLO_CLIENT.mutate({
|
||||
mutation: gql`
|
||||
mutation deleteAsset ($id: UUID!) {
|
||||
deleteAsset(id: $id) {
|
||||
operation {
|
||||
succeeded
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
id: props.assetId
|
||||
}
|
||||
})
|
||||
if (resp?.data?.deleteAsset?.operation?.succeeded) {
|
||||
$q.notify({
|
||||
type: 'positive',
|
||||
message: t('fileman.assetDeleteSuccess')
|
||||
})
|
||||
onDialogOK()
|
||||
} else {
|
||||
throw new Error(resp?.data?.deleteAsset?.operation?.message || 'An unexpected error occured.')
|
||||
}
|
||||
} catch (err) {
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: err.message
|
||||
})
|
||||
}
|
||||
state.isLoading = false
|
||||
}
|
||||
</script>
|
@ -0,0 +1,165 @@
|
||||
<template lang='pug'>
|
||||
q-dialog(ref='dialogRef', @hide='onDialogHide')
|
||||
q-card(style='min-width: 650px;')
|
||||
q-card-section.card-header
|
||||
q-icon(name='img:/_assets/icons/fluent-rename.svg', left, size='sm')
|
||||
span {{ t(`fileman.assetRename`) }}
|
||||
q-form.q-py-sm(@submit='rename')
|
||||
q-item
|
||||
blueprint-icon.self-start(icon='image')
|
||||
q-item-section
|
||||
q-input(
|
||||
autofocus
|
||||
outlined
|
||||
v-model='state.path'
|
||||
dense
|
||||
hide-bottom-space
|
||||
:label='t(`fileman.assetFileName`)'
|
||||
:aria-label='t(`fileman.assetFileName`)'
|
||||
:hint='t(`fileman.assetFileNameHint`)'
|
||||
lazy-rules='ondemand'
|
||||
@keyup.enter='rename'
|
||||
)
|
||||
q-card-actions.card-actions
|
||||
q-space
|
||||
q-btn.acrylic-btn(
|
||||
flat
|
||||
:label='t(`common.actions.cancel`)'
|
||||
color='grey'
|
||||
padding='xs md'
|
||||
@click='onDialogCancel'
|
||||
)
|
||||
q-btn(
|
||||
unelevated
|
||||
:label='t(`common.actions.rename`)'
|
||||
color='primary'
|
||||
padding='xs md'
|
||||
@click='rename'
|
||||
:loading='state.loading > 0'
|
||||
)
|
||||
q-inner-loading(:showing='state.loading > 0')
|
||||
q-spinner(color='accent', size='lg')
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import gql from 'graphql-tag'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useDialogPluginComponent, useQuasar } from 'quasar'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
|
||||
// PROPS
|
||||
|
||||
const props = defineProps({
|
||||
assetId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
// EMITS
|
||||
|
||||
defineEmits([
|
||||
...useDialogPluginComponent.emits
|
||||
])
|
||||
|
||||
// QUASAR
|
||||
|
||||
const { dialogRef, onDialogHide, onDialogOK, onDialogCancel } = useDialogPluginComponent()
|
||||
const $q = useQuasar()
|
||||
|
||||
// I18N
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
// DATA
|
||||
|
||||
const state = reactive({
|
||||
path: '',
|
||||
loading: false
|
||||
})
|
||||
|
||||
// METHODS
|
||||
|
||||
async function rename () {
|
||||
state.loading++
|
||||
try {
|
||||
if (state.path?.length < 2 || !state.path?.includes('.')) {
|
||||
throw new Error(t('fileman.renameAssetInvalid'))
|
||||
}
|
||||
const resp = await APOLLO_CLIENT.mutate({
|
||||
mutation: gql`
|
||||
mutation renameAsset (
|
||||
$id: UUID!
|
||||
$fileName: String!
|
||||
) {
|
||||
renameAsset (
|
||||
id: $id
|
||||
fileName: $fileName
|
||||
) {
|
||||
operation {
|
||||
succeeded
|
||||
message
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
id: props.assetId,
|
||||
fileName: state.path
|
||||
}
|
||||
})
|
||||
if (resp?.data?.renameAsset?.operation?.succeeded) {
|
||||
$q.notify({
|
||||
type: 'positive',
|
||||
message: t('fileman.renameAssetSuccess')
|
||||
})
|
||||
onDialogOK()
|
||||
} else {
|
||||
throw new Error(resp?.data?.renameAsset?.operation?.message || 'An unexpected error occured.')
|
||||
}
|
||||
} catch (err) {
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: err.message
|
||||
})
|
||||
}
|
||||
state.loading--
|
||||
}
|
||||
|
||||
// MOUNTED
|
||||
|
||||
onMounted(async () => {
|
||||
state.loading++
|
||||
try {
|
||||
const resp = await APOLLO_CLIENT.query({
|
||||
query: gql`
|
||||
query fetchAssetForRename (
|
||||
$id: UUID!
|
||||
) {
|
||||
assetById (
|
||||
id: $id
|
||||
) {
|
||||
id
|
||||
fileName
|
||||
}
|
||||
}
|
||||
`,
|
||||
fetchPolicy: 'network-only',
|
||||
variables: {
|
||||
id: props.assetId
|
||||
}
|
||||
})
|
||||
if (resp?.data?.assetById?.id !== props.assetId) {
|
||||
throw new Error('Failed to fetch asset data.')
|
||||
}
|
||||
state.path = resp.data.assetById.fileName
|
||||
} catch (err) {
|
||||
$q.notify({
|
||||
type: 'negative',
|
||||
message: err.message
|
||||
})
|
||||
onDialogCancel()
|
||||
}
|
||||
state.loading--
|
||||
})
|
||||
</script>
|
Loading…
Reference in new issue