forked from AkkomaGang/admin-fe
Create new translation section for emoji and add success messages
This commit is contained in:
parent
abd4ec5867
commit
7e48a33c4b
5 changed files with 131 additions and 109 deletions
101
src/lang/en.js
101
src/lang/en.js
|
@ -350,56 +350,8 @@ export default {
|
||||||
followRelay: 'Follow new relay',
|
followRelay: 'Follow new relay',
|
||||||
instanceUrl: 'Instance URL',
|
instanceUrl: 'Instance URL',
|
||||||
success: 'Settings changed successfully!',
|
success: 'Settings changed successfully!',
|
||||||
emojiPacks: 'Emoji packs',
|
|
||||||
reloadEmoji: 'Reload emoji',
|
|
||||||
importPacks: 'Import packs from the server filesystem',
|
|
||||||
importEmojiTooltip: 'Importing from the filesystem will scan the directories and import those without pack.json but with emoji.txt or without neither',
|
|
||||||
localPacks: 'Local packs',
|
|
||||||
refreshLocalPacks: 'Refresh local packs',
|
|
||||||
createLocalPack: 'Create a new local pack',
|
|
||||||
packs: 'Packs',
|
|
||||||
remotePacks: 'Remote packs',
|
|
||||||
remoteInstanceAddress: 'Remote instance address',
|
|
||||||
refreshRemote: 'Refresh remote packs',
|
|
||||||
sharePack: 'Share pack',
|
|
||||||
homepage: 'Homepage',
|
|
||||||
description: 'Description',
|
description: 'Description',
|
||||||
license: 'License',
|
|
||||||
fallbackSrc: 'Fallback source',
|
|
||||||
fallbackSrcSha: 'Fallback source SHA',
|
|
||||||
savePackMetadata: 'Save pack metadata',
|
|
||||||
addNewEmoji: 'Add new emoji to the pack',
|
|
||||||
shortcode: 'Shortcode',
|
|
||||||
uploadFile: 'Upload a file',
|
|
||||||
customFilename: 'Custom filename',
|
|
||||||
optional: 'optional',
|
|
||||||
customFilenameDesc: 'Custom file name (optional)',
|
|
||||||
url: 'URL',
|
|
||||||
required: 'required',
|
|
||||||
clickToUpload: 'Click to upload',
|
|
||||||
showPackContents: 'Show pack contents',
|
|
||||||
manageEmoji: 'Manage existing emoji',
|
|
||||||
file: 'File',
|
|
||||||
update: 'Update',
|
|
||||||
remove: 'Remove',
|
|
||||||
removeFromDB: 'Remove setting from the DB',
|
removeFromDB: 'Remove setting from the DB',
|
||||||
selectLocalPack: 'Select the local pack to copy to',
|
|
||||||
localPack: 'Local pack',
|
|
||||||
specifyShortcode: 'Specify a custom shortcode',
|
|
||||||
specifyFilename: 'Specify a custom filename',
|
|
||||||
leaveEmptyShortcode: 'leave empty to use the same shortcode',
|
|
||||||
leaveEmptyFilename: 'leave empty to use the same filename',
|
|
||||||
copy: 'Copy',
|
|
||||||
copyToLocalPack: 'Copy to local pack',
|
|
||||||
thisWillDownload: 'This will download the',
|
|
||||||
downloadToCurrentInstance: 'pack to the current instance under the name',
|
|
||||||
canBeChanged: 'can be changed below',
|
|
||||||
willBeUsable: 'It will then be usable and shareable from the current instance',
|
|
||||||
downloadPack: 'Download pack',
|
|
||||||
deletePack: 'Delete pack',
|
|
||||||
downloadSharedPack: 'Download shared pack to current instance',
|
|
||||||
downloadAsOptional: 'Download as (optional)',
|
|
||||||
downloadPackArchive: 'Download pack archive',
|
|
||||||
successfullyDownloaded: 'Successfully downloaded',
|
successfullyDownloaded: 'Successfully downloaded',
|
||||||
successfullyImported: 'Successfully imported',
|
successfullyImported: 'Successfully imported',
|
||||||
nowNewPacksToImport: 'No new packs to import',
|
nowNewPacksToImport: 'No new packs to import',
|
||||||
|
@ -433,5 +385,58 @@ export default {
|
||||||
emailSent: 'Invite was sent',
|
emailSent: 'Invite was sent',
|
||||||
submitFormError: 'There are invalid values in the form. Please fix them before continuing.',
|
submitFormError: 'There are invalid values in the form. Please fix them before continuing.',
|
||||||
inviteViaEmailAlert: 'To send invite via email make sure to enable `invites_enabled` and disable `registrations_open`'
|
inviteViaEmailAlert: 'To send invite via email make sure to enable `invites_enabled` and disable `registrations_open`'
|
||||||
|
},
|
||||||
|
emoji: {
|
||||||
|
emojiPacks: 'Emoji packs',
|
||||||
|
reloaded: 'Emoji reloaded successfully!',
|
||||||
|
refreshed: 'Emoji refreshed successfully!',
|
||||||
|
importEmojiTooltip: 'Importing from the filesystem will scan the directories and import those without pack.json but with emoji.txt or without neither',
|
||||||
|
reloadEmoji: 'Reload emoji',
|
||||||
|
importPacks: 'Import packs from the server filesystem',
|
||||||
|
localPacks: 'Local packs',
|
||||||
|
refreshLocalPacks: 'Refresh local packs',
|
||||||
|
createLocalPack: 'Create a new local pack',
|
||||||
|
remotePacks: 'Remote packs',
|
||||||
|
remoteInstanceAddress: 'Remote instance address',
|
||||||
|
refreshRemote: 'Refresh remote packs',
|
||||||
|
sharePack: 'Share pack',
|
||||||
|
required: 'required',
|
||||||
|
homepage: 'Homepage',
|
||||||
|
description: 'Description',
|
||||||
|
packs: 'Packs',
|
||||||
|
license: 'License',
|
||||||
|
shortcode: 'Shortcode',
|
||||||
|
fallbackSrc: 'Fallback source',
|
||||||
|
fallbackSrcSha: 'Fallback source SHA',
|
||||||
|
savePackMetadata: 'Save pack metadata',
|
||||||
|
deletePack: 'Delete pack',
|
||||||
|
downloadPack: 'Download pack',
|
||||||
|
downloadPackArchive: 'Download pack archive',
|
||||||
|
addNewEmoji: 'Add new emoji to the pack',
|
||||||
|
manageEmoji: 'Manage existing emoji',
|
||||||
|
thisWillDownload: 'This will download the',
|
||||||
|
downloadToCurrentInstance: 'pack to the current instance under the name',
|
||||||
|
canBeChanged: 'can be changed below',
|
||||||
|
willBeUsable: 'It will then be usable and shareable from the current instance',
|
||||||
|
downloadAsOptional: 'Download as (optional)',
|
||||||
|
downloadSharedPack: 'Download shared pack to current instance',
|
||||||
|
optional: 'optional',
|
||||||
|
uploadFile: 'Upload a file',
|
||||||
|
url: 'URL',
|
||||||
|
clickToUpload: 'Click to upload',
|
||||||
|
upload: 'Upload',
|
||||||
|
customFilename: 'Custom filename',
|
||||||
|
customFilenameDesc: 'Custom file name (optional)',
|
||||||
|
file: 'File',
|
||||||
|
localPack: 'Local pack',
|
||||||
|
leaveEmptyShortcode: 'leave empty to use the same shortcode',
|
||||||
|
leaveEmptyFilename: 'leave empty to use the same filename',
|
||||||
|
update: 'Update',
|
||||||
|
remove: 'Remove',
|
||||||
|
selectLocalPack: 'Select the local pack to copy to',
|
||||||
|
specifyShortcode: 'Specify a custom shortcode',
|
||||||
|
specifyFilename: 'Specify a custom filename',
|
||||||
|
copy: 'Copy',
|
||||||
|
copyToLocalPack: 'Copy to local pack'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
<template>
|
<template>
|
||||||
<el-collapse-item :title="name" :name="name" class="has-background">
|
<el-collapse-item :title="name" :name="name" class="has-background">
|
||||||
<el-form v-if="isLocal" label-width="120px" label-position="left" size="small" class="emoji-pack-metadata">
|
<el-form v-if="isLocal" label-width="120px" label-position="left" size="small" class="emoji-pack-metadata">
|
||||||
<el-form-item :label="$t('settings.sharePack')">
|
<el-form-item :label=" $t('emoji.sharePack')">
|
||||||
<el-switch v-model="share" />
|
<el-switch v-model="share" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.homepage')">
|
<el-form-item :label=" $t('emoji.homepage')">
|
||||||
<el-input v-model="homepage" />
|
<el-input v-model="homepage" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.description')">
|
<el-form-item :label=" $t('emoji.description')">
|
||||||
<el-input v-model="description" type="textarea" />
|
<el-input v-model="description" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.license')">
|
<el-form-item :label=" $t('emoji.license')">
|
||||||
<el-input v-model="license" />
|
<el-input v-model="license" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.fallbackSrc')">
|
<el-form-item :label=" $t('emoji.fallbackSrc')">
|
||||||
<el-input v-model="fallbackSrc" />
|
<el-input v-model="fallbackSrc" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="fallbackSrc && fallbackSrc.trim() !== ''"
|
v-if="fallbackSrc && fallbackSrc.trim() !== ''"
|
||||||
:label="$t('settings.fallbackSrcSha')">
|
:label=" $t('emoji.fallbackSrcSha')">
|
||||||
{{ pack.pack["fallback-src-sha256"] }}
|
{{ pack.pack["fallback-src-sha256"] }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item class="save-pack-button">
|
<el-form-item class="save-pack-button">
|
||||||
<el-button type="primary" @click="savePackMetadata">{{ $t('settings.savePackMetadata') }}</el-button>
|
<el-button type="primary" @click="savePackMetadata">{{ $t('emoji.savePackMetadata') }}</el-button>
|
||||||
<el-button @click="deletePack">{{ $t('settings.deletePack') }}</el-button>
|
<el-button @click="deletePack">{{ $t('emoji.deletePack') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-link
|
<el-link
|
||||||
|
@ -32,29 +32,29 @@
|
||||||
:underline="false"
|
:underline="false"
|
||||||
type="primary"
|
type="primary"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<el-button class="download-archive">{{ $t('settings.downloadPackArchive') }}</el-button>
|
<el-button class="download-archive">{{ $t('emoji.downloadPackArchive') }}</el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-form v-if="!isLocal" label-width="120px" label-position="left" size="small" class="emoji-pack-metadata">
|
<el-form v-if="!isLocal" label-width="120px" label-position="left" size="small" class="emoji-pack-metadata">
|
||||||
<el-form-item :label="$t('settings.sharePack')">
|
<el-form-item :label=" $t('emoji.sharePack')">
|
||||||
<el-switch v-model="share" disabled />
|
<el-switch v-model="share" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="homepage" :label="$t('settings.homepage')">
|
<el-form-item v-if="homepage" :label=" $t('emoji.homepage')">
|
||||||
<span>{{ homepage }}</span>
|
<span>{{ homepage }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="description" :label="$t('settings.description')">
|
<el-form-item v-if="description" :label=" $t('emoji.description')">
|
||||||
<span>{{ description }}</span>
|
<span>{{ description }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="license" :label="$t('settings.license')">
|
<el-form-item v-if="license" :label=" $t('emoji.license')">
|
||||||
<span>{{ license }}</span>
|
<span>{{ license }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="fallbackSrc" :label="$t('settings.fallbackSrc')">
|
<el-form-item v-if="fallbackSrc" :label=" $t('emoji.fallbackSrc')">
|
||||||
<span>{{ fallbackSrc }}</span>
|
<span>{{ fallbackSrc }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="fallbackSrc && fallbackSrc.trim() !== ''"
|
v-if="fallbackSrc && fallbackSrc.trim() !== ''"
|
||||||
:label="$t('settings.fallbackSrcSha')">
|
:label=" $t('emoji.fallbackSrcSha')">
|
||||||
{{ pack.pack["fallback-src-sha256"] }}
|
{{ pack.pack["fallback-src-sha256"] }}
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
|
@ -64,15 +64,15 @@
|
||||||
:underline="false"
|
:underline="false"
|
||||||
type="primary"
|
type="primary"
|
||||||
target="_blank">
|
target="_blank">
|
||||||
<el-button class="download-archive">{{ $t('settings.downloadPackArchive') }}</el-button>
|
<el-button class="download-archive">{{ $t('emoji.downloadPackArchive') }}</el-button>
|
||||||
</el-link>
|
</el-link>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-collapse v-model="showPackContent" class="contents-collapse">
|
<el-collapse v-model="showPackContent" class="contents-collapse">
|
||||||
<el-collapse-item v-if="isLocal" :title="$t('settings.addNewEmoji')" name="addEmoji" class="no-background">
|
<el-collapse-item v-if="isLocal" :title=" $t('emoji.addNewEmoji')" name="addEmoji" class="no-background">
|
||||||
<new-emoji-uploader :pack-name="name"/>
|
<new-emoji-uploader :pack-name="name"/>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item v-if="Object.keys(pack.files).length > 0" :title="$t('settings.manageEmoji')" name="manageEmoji" class="no-background">
|
<el-collapse-item v-if="Object.keys(pack.files).length > 0" :title=" $t('emoji.manageEmoji')" name="manageEmoji" class="no-background">
|
||||||
<single-emoji-editor
|
<single-emoji-editor
|
||||||
v-for="(file, ename) in pack.files"
|
v-for="(file, ename) in pack.files"
|
||||||
:key="ename"
|
:key="ename"
|
||||||
|
@ -82,16 +82,16 @@
|
||||||
:file="file"
|
:file="file"
|
||||||
:is-local="isLocal" />
|
:is-local="isLocal" />
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
<el-collapse-item v-if="!isLocal" :title="$t('settings.downloadPack')" name="downloadPack" class="no-background">
|
<el-collapse-item v-if="!isLocal" :title=" $t('emoji.downloadPack')" name="downloadPack" class="no-background">
|
||||||
<p>
|
<p>
|
||||||
{{ $t('settings.thisWillDownload') }} "{{ name }}" {{ $t('settings.downloadToCurrentInstance') }}
|
{{ $t('emoji.thisWillDownload') }} "{{ name }}" {{ $t('emoji.downloadToCurrentInstance') }}
|
||||||
"{{ downloadSharedAs.trim() === '' ? name : downloadSharedAs }}" ({{ $t('settings.canBeChanged') }}).
|
"{{ downloadSharedAs.trim() === '' ? name : downloadSharedAs }}" ({{ $t('emoji.canBeChanged') }}).
|
||||||
{{ $t('settings.willBeUsable') }}.
|
{{ $t('emoji.willBeUsable') }}.
|
||||||
</p>
|
</p>
|
||||||
<div class="download-shared-pack">
|
<div class="download-shared-pack">
|
||||||
<el-input v-model="downloadSharedAs" :placeholder="$t('settings.downloadAsOptional')"/>
|
<el-input v-model="downloadSharedAs" :placeholder=" $t('emoji.downloadAsOptional')"/>
|
||||||
<el-button type="primary" class="download-shared-pack-button" @click="downloadFromInstance">
|
<el-button type="primary" class="download-shared-pack-button" @click="downloadFromInstance">
|
||||||
{{ $t('settings.downloadSharedPack') }}
|
{{ $t('emoji.downloadSharedPack') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-collapse-item>
|
</el-collapse-item>
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<el-form label-width="130px" label-position="left" size="small">
|
<el-form label-width="130px" label-position="left" size="small">
|
||||||
<el-form-item :label="$t('settings.shortcode')">
|
<el-form-item :label="$t('emoji.shortcode')">
|
||||||
<el-input v-model="shortcode" :placeholder="$t('settings.required')"/>
|
<el-input v-model="shortcode" :placeholder="$t('emoji.required')"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.customFilename')">
|
<el-form-item :label="$t('emoji.customFilename')">
|
||||||
<el-input v-model="customFileName" :placeholder="$t('settings.optional')"/>
|
<el-input v-model="customFileName" :placeholder="$t('emoji.optional')"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.uploadFile')">
|
<el-form-item :label="$t('emoji.uploadFile')">
|
||||||
<div class="upload-file-url">
|
<div class="upload-file-url">
|
||||||
<el-input v-model="imageUploadURL" :placeholder="$t('settings.url')"/>
|
<el-input v-model="imageUploadURL" :placeholder="$t('emoji.url')"/>
|
||||||
<el-button :disabled="shortcodePresent" type="primary" class="upload-button" @click="uploadEmoji">{{ $t('settings.upload') }}</el-button>
|
<el-button :disabled="shortcodePresent" type="primary" class="upload-button" @click="uploadEmoji">{{ $t('emoji.upload') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="upload-container">
|
<div class="upload-container">
|
||||||
<p class="text">or</p>
|
<p class="text">or</p>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
:multiple="false"
|
:multiple="false"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
action="add">
|
action="add">
|
||||||
<el-button :disabled="shortcodePresent" type="primary">{{ $t('settings.clickToUpload') }}</el-button>
|
<el-button :disabled="shortcodePresent" type="primary">{{ $t('emoji.clickToUpload') }}</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
<img
|
<img
|
||||||
:src="addressOfEmojiInPack(host, packName, file)"
|
:src="addressOfEmojiInPack(host, packName, file)"
|
||||||
class="emoji-preview-img">
|
class="emoji-preview-img">
|
||||||
<el-input v-model="emojiName" :placeholder="$t('settings.shortcode')" class="emoji-info"/>
|
<el-input v-model="emojiName" :placeholder="$t('emoji.shortcode')" class="emoji-info"/>
|
||||||
<el-input v-model="emojiFile" :placeholder="$t('settings.file')" class="emoji-info"/>
|
<el-input v-model="emojiFile" :placeholder="$t('emoji.file')" class="emoji-info"/>
|
||||||
<div class="emoji-buttons">
|
<div class="emoji-buttons">
|
||||||
<el-button type="primary" @click="update">{{ $t('settings.update') }}</el-button>
|
<el-button type="primary" @click="update">{{ $t('emoji.update') }}</el-button>
|
||||||
<el-button @click="remove">{{ $t('settings.remove') }}</el-button>
|
<el-button @click="remove">{{ $t('emoji.remove') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -16,27 +16,27 @@
|
||||||
<img
|
<img
|
||||||
:src="addressOfEmojiInPack(host, packName, file)"
|
:src="addressOfEmojiInPack(host, packName, file)"
|
||||||
class="emoji-preview-img">
|
class="emoji-preview-img">
|
||||||
<el-input :value="emojiName" :placeholder="$t('settings.shortcode')" class="emoji-info"/>
|
<el-input :value="emojiName" :placeholder="$t('emoji.shortcode')" class="emoji-info"/>
|
||||||
<el-input :value="emojiFile" :placeholder="$t('settings.file')" class="emoji-info"/>
|
<el-input :value="emojiFile" :placeholder="$t('emoji.file')" class="emoji-info"/>
|
||||||
<el-popover v-model="copyPopoverVisible" placement="left-start" popper-class="copy-popover">
|
<el-popover v-model="copyPopoverVisible" placement="left-start" popper-class="copy-popover">
|
||||||
<p>{{ $t('settings.selectLocalPack') }}</p>
|
<p>{{ $t('emoji.selectLocalPack') }}</p>
|
||||||
<el-select v-model="copyToLocalPackName" :placeholder="$t('settings.localPack')">
|
<el-select v-model="copyToLocalPackName" :placeholder="$t('emoji.localPack')">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(_pack, name) in localPacks"
|
v-for="(_pack, name) in localPacks"
|
||||||
:key="name"
|
:key="name"
|
||||||
:label="name"
|
:label="name"
|
||||||
:value="name" />
|
:value="name" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<p>{{ $t('settings.specifyShortcode') }}</p>
|
<p>{{ $t('emoji.specifyShortcode') }}</p>
|
||||||
<el-input v-model="copyToShortcode" :placeholder="$t('settings.leaveEmptyShortcode')"/>
|
<el-input v-model="copyToShortcode" :placeholder="$t('emoji.leaveEmptyShortcode')"/>
|
||||||
<p>{{ $t('settings.specifyFilename') }}</p>
|
<p>{{ $t('emoji.specifyFilename') }}</p>
|
||||||
<el-input v-model="copyToFilename" :placeholder="$t('settings.leaveEmptyFilename')"/>
|
<el-input v-model="copyToFilename" :placeholder="$t('emoji.leaveEmptyFilename')"/>
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="!copyToLocalPackName"
|
:disabled="!copyToLocalPackName"
|
||||||
type="primary"
|
type="primary"
|
||||||
class="copy-to-local-button"
|
class="copy-to-local-button"
|
||||||
@click="copyToLocal">{{ $t('settings.copy') }}</el-button>
|
@click="copyToLocal">{{ $t('emoji.copy') }}</el-button>
|
||||||
<el-button slot="reference" type="primary" class="emoji-button">{{ $t('settings.copyToLocalPack') }}</el-button>
|
<el-button slot="reference" type="primary" class="emoji-button">{{ $t('emoji.copyToLocalPack') }}</el-button>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="emoji-packs">
|
<div class="emoji-packs">
|
||||||
<h1 class="emoji-packs-header">{{ $t('settings.emojiPacks') }}</h1>
|
<h1 class="emoji-packs-header">{{ $t('emoji.emojiPacks') }}</h1>
|
||||||
<div class="button-container">
|
<div class="button-container">
|
||||||
<el-button type="primary" @click="reloadEmoji">{{ $t('settings.reloadEmoji') }}</el-button>
|
<el-button type="primary" @click="reloadEmoji">{{ $t('emoji.reloadEmoji') }}</el-button>
|
||||||
<el-tooltip :content="$t('settings.importEmojiTooltip')" effects="dark" placement="bottom">
|
<el-tooltip :content="$t('emoji.importEmojiTooltip')" effects="dark" placement="bottom">
|
||||||
<el-button type="primary" @click="importFromFS">
|
<el-button type="primary" @click="importFromFS">
|
||||||
{{ $t('settings.importPacks') }}
|
{{ $t('emoji.importPacks') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<div class="line"/>
|
<div class="line"/>
|
||||||
<el-form label-width="180px" class="emoji-packs-form">
|
<el-form label-width="180px" class="emoji-packs-form">
|
||||||
<el-form-item :label="$t('settings.localPacks')">
|
<el-form-item :label="$t('emoji.localPacks')">
|
||||||
<el-button type="primary" @click="refreshLocalPacks">{{ $t('settings.refreshLocalPacks') }}</el-button>
|
<el-button type="primary" @click="refreshLocalPacks">{{ $t('emoji.refreshLocalPacks') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('settings.createLocalPack')">
|
<el-form-item :label="$t('emoji.createLocalPack')">
|
||||||
<div class="create-pack">
|
<div class="create-pack">
|
||||||
<el-input v-model="newPackName" :placeholder="$t('users.name')" />
|
<el-input v-model="newPackName" :placeholder="$t('users.name')" />
|
||||||
<el-button
|
<el-button
|
||||||
|
@ -25,26 +25,26 @@
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="Object.keys(localPacks).length > 0" :label="$t('settings.packs')">
|
<el-form-item v-if="Object.keys(localPacks).length > 0" :label="$t('emoji.packs')">
|
||||||
<el-collapse v-for="(pack, name) in localPacks" :key="name" v-model="activeLocalPack">
|
<el-collapse v-for="(pack, name) in localPacks" :key="name" v-model="activeLocalPack">
|
||||||
<emoji-pack :name="name" :pack="pack" :host="$store.getters.authHost" :is-local="true" />
|
<emoji-pack :name="name" :pack="pack" :host="$store.getters.authHost" :is-local="true" />
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="line"/>
|
<div class="line"/>
|
||||||
<el-form-item :label="$t('settings.remotePacks')">
|
<el-form-item :label="$t('emoji.remotePacks')">
|
||||||
<div class="create-pack">
|
<div class="create-pack">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="remoteInstanceAddress"
|
v-model="remoteInstanceAddress"
|
||||||
:placeholder="$t('settings.remoteInstanceAddress')" />
|
:placeholder="$t('emoji.remoteInstanceAddress')" />
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="remoteInstanceAddress.trim() === ''"
|
:disabled="remoteInstanceAddress.trim() === ''"
|
||||||
class="create-pack-button"
|
class="create-pack-button"
|
||||||
@click="refreshRemotePacks">
|
@click="refreshRemotePacks">
|
||||||
{{ $t('settings.refreshRemote') }}
|
{{ $t('emoji.refreshRemote') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="Object.keys(remotePacks).length > 0" :label="$t('settings.packs')">
|
<el-form-item v-if="Object.keys(remotePacks).length > 0" :label="$t('emoji.packs')">
|
||||||
<el-collapse v-for="(pack, name) in remotePacks" :key="name" v-model="activeRemotePack">
|
<el-collapse v-for="(pack, name) in remotePacks" :key="name" v-model="activeRemotePack">
|
||||||
<emoji-pack :name="name" :pack="pack" :host="$store.getters.authHost" :is-local="false" />
|
<emoji-pack :name="name" :pack="pack" :host="$store.getters.authHost" :is-local="false" />
|
||||||
</el-collapse>
|
</el-collapse>
|
||||||
|
@ -55,6 +55,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import EmojiPack from './components/EmojiPack'
|
import EmojiPack from './components/EmojiPack'
|
||||||
|
import i18n from '@/lang'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { EmojiPack },
|
components: { EmojiPack },
|
||||||
|
@ -94,13 +95,29 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
refreshLocalPacks() {
|
refreshLocalPacks() {
|
||||||
|
try {
|
||||||
this.$store.dispatch('SetLocalEmojiPacks')
|
this.$store.dispatch('SetLocalEmojiPacks')
|
||||||
|
} catch (e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: i18n.t('emoji.refreshed')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
refreshRemotePacks() {
|
refreshRemotePacks() {
|
||||||
this.$store.dispatch('SetRemoteEmojiPacks', { remoteInstance: this.remoteInstanceAddress })
|
this.$store.dispatch('SetRemoteEmojiPacks', { remoteInstance: this.remoteInstanceAddress })
|
||||||
},
|
},
|
||||||
reloadEmoji() {
|
async reloadEmoji() {
|
||||||
|
try {
|
||||||
this.$store.dispatch('ReloadEmoji')
|
this.$store.dispatch('ReloadEmoji')
|
||||||
|
} catch (e) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: i18n.t('emoji.reloaded')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
importFromFS() {
|
importFromFS() {
|
||||||
this.$store.dispatch('ImportFromFS')
|
this.$store.dispatch('ImportFromFS')
|
||||||
|
|
Loading…
Reference in a new issue