[ui] add admin in mobile / fix #63
This commit is contained in:
@@ -62,6 +62,10 @@ pre {
|
|||||||
font-family: unset;
|
font-family: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-message-box {
|
||||||
|
max-width: 95%;
|
||||||
|
}
|
||||||
|
|
||||||
.el-popover {
|
.el-popover {
|
||||||
word-break: normal;
|
word-break: normal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,13 @@
|
|||||||
|
|
||||||
hr
|
hr
|
||||||
.d-block.d-lg-none
|
.d-block.d-lg-none
|
||||||
|
el-dropdown
|
||||||
|
el-button.mr-1.mb-1(type='' icon='el-icon-arrow-down' size='mini') {{$t('common.admin')}}
|
||||||
|
el-dropdown-menu(slot='dropdown')
|
||||||
|
el-dropdown-item(@click.native='toggle') {{$t(event.is_visible?'common.hide':'common.confirm')}}
|
||||||
|
el-dropdown-item(@click.native='$router.replace(`/add/${event.id}`)') {{$t('common.edit')}}
|
||||||
|
el-dropdown-item(@click.native='remove') {{$t('common.remove')}}
|
||||||
|
|
||||||
el-button(plain size='mini' type='primary' v-clipboard:success='copyLink'
|
el-button(plain size='mini' type='primary' v-clipboard:success='copyLink'
|
||||||
v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') <i class='el-icon-paperclip'></i> {{$t('common.copy_link')}}
|
v-clipboard:copy='`${settings.baseurl}/event/${event.id}`') <i class='el-icon-paperclip'></i> {{$t('common.copy_link')}}
|
||||||
a.el-button.el-button--success.el-button--mini.is-plain(role='button' plain size='mini' type='success'
|
a.el-button.el-button--success.el-button--mini.is-plain(role='button' plain size='mini' type='success'
|
||||||
@@ -258,6 +265,32 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async remove () {
|
||||||
|
try {
|
||||||
|
await MessageBox.confirm(this.$t('event.remove_confirmation'), this.$t('common.confirm'), {
|
||||||
|
confirmButtonText: this.$t('common.ok'),
|
||||||
|
cancelButtonText: this.$t('common.cancel'),
|
||||||
|
type: 'error' })
|
||||||
|
await this.$axios.delete(`/user/event/${this.event.id}`)
|
||||||
|
this.delEvent(Number(this.event.id))
|
||||||
|
this.$router.replace('/')
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async toggle () {
|
||||||
|
try {
|
||||||
|
if (this.event.is_visible) {
|
||||||
|
await this.$axios.$get(`/event/unconfirm/${this.event.id}`)
|
||||||
|
this.event.is_visible = false
|
||||||
|
} else {
|
||||||
|
await this.$axios.$get(`/event/confirm/${this.event.id}`)
|
||||||
|
this.event.is_visible = true
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
async hideResource (resource, hidden) {
|
async hideResource (resource, hidden) {
|
||||||
await this.$axios.$put(`/resources/${resource.id}`, { hidden })
|
await this.$axios.$put(`/resources/${resource.id}`, { hidden })
|
||||||
resource.hidden = hidden
|
resource.hidden = hidden
|
||||||
|
|||||||
@@ -38,14 +38,15 @@ const Helpers = {
|
|||||||
const header = `keyId="${config.baseurl}/federation/u/${settingsController.settings.instance_name}",headers="(request-target) host date",signature="${signature_b64}"`
|
const header = `keyId="${config.baseurl}/federation/u/${settingsController.settings.instance_name}",headers="(request-target) host date",signature="${signature_b64}"`
|
||||||
const ret = await fetch(inbox, {
|
const ret = await fetch(inbox, {
|
||||||
headers: {
|
headers: {
|
||||||
'Host': inboxUrl.hostname,
|
Host: inboxUrl.hostname,
|
||||||
'Date': d.toUTCString(),
|
Date: d.toUTCString(),
|
||||||
'Signature': header,
|
Signature: header,
|
||||||
'Content-Type': 'application/activity+json; charset=utf-8',
|
'Content-Type': 'application/activity+json; charset=utf-8',
|
||||||
'Accept': 'application/activity+json, application/json; chartset=utf-8'
|
Accept: 'application/activity+json, application/json; chartset=utf-8'
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: JSON.stringify(message) })
|
body: JSON.stringify(message)
|
||||||
|
})
|
||||||
debug('sign %s => %s', ret.status, await ret.text())
|
debug('sign %s => %s', ret.status, await ret.text())
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ const Helpers = {
|
|||||||
})
|
})
|
||||||
|
|
||||||
for (const sharedInbox in recipients) {
|
for (const sharedInbox in recipients) {
|
||||||
debug('Notify %s with event %s cc => %d', sharedInbox, event.title , recipients[sharedInbox].length)
|
debug('Notify %s with event %s cc => %d', sharedInbox, event.title, recipients[sharedInbox].length)
|
||||||
const body = {
|
const body = {
|
||||||
id: `${config.baseurl}/federation/m/${event.id}#create`,
|
id: `${config.baseurl}/federation/m/${event.id}#create`,
|
||||||
type,
|
type,
|
||||||
@@ -78,7 +79,7 @@ const Helpers = {
|
|||||||
body['@context'] = [
|
body['@context'] = [
|
||||||
'https://www.w3.org/ns/activitystreams',
|
'https://www.w3.org/ns/activitystreams',
|
||||||
'https://w3id.org/security/v1',
|
'https://w3id.org/security/v1',
|
||||||
{ Hashtag: 'as:Hashtag' } ]
|
{ Hashtag: 'as:Hashtag' }]
|
||||||
Helpers.signAndSend(body, sharedInbox)
|
Helpers.signAndSend(body, sharedInbox)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const version = require('../../package.json').version
|
|||||||
|
|
||||||
router.use(cors())
|
router.use(cors())
|
||||||
|
|
||||||
router.get('/', async (req, res) => {
|
router.get('/', (req, res) => {
|
||||||
const ret = {
|
const ret = {
|
||||||
version: '1.0',
|
version: '1.0',
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async outbox (req, res) {
|
async outbox (req, res) {
|
||||||
|
// TODO
|
||||||
const name = req.params.name
|
const name = req.params.name
|
||||||
const page = req.query.page
|
const page = req.query.page
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user