chore: Use globalConfig in NetworkNotification (#3871)
This commit is contained in:
parent
b1e1d7e423
commit
e0d24e0a73
4 changed files with 37 additions and 12 deletions
|
@ -4,7 +4,12 @@
|
||||||
<div class="ui-notification">
|
<div class="ui-notification">
|
||||||
<fluent-icon icon="wifi-off" />
|
<fluent-icon icon="wifi-off" />
|
||||||
<p class="ui-notification-text">
|
<p class="ui-notification-text">
|
||||||
{{ $t('NETWORK.NOTIFICATION.TEXT') }}
|
{{
|
||||||
|
useInstallationName(
|
||||||
|
$t('NETWORK.NOTIFICATION.TEXT'),
|
||||||
|
globalConfig.installationName
|
||||||
|
)
|
||||||
|
}}
|
||||||
</p>
|
</p>
|
||||||
<woot-button variant="clear" size="small" @click="refreshPage">
|
<woot-button variant="clear" size="small" @click="refreshPage">
|
||||||
{{ $t('NETWORK.BUTTON.REFRESH') }}
|
{{ $t('NETWORK.BUTTON.REFRESH') }}
|
||||||
|
@ -23,13 +28,22 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import globalConfigMixin from 'shared/mixins/globalConfigMixin';
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [globalConfigMixin],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showNotification: !navigator.onLine,
|
showNotification: !navigator.onLine,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
...mapGetters({ globalConfig: 'globalConfig/get' }),
|
||||||
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
window.addEventListener('offline', this.updateOnlineStatus);
|
window.addEventListener('offline', this.updateOnlineStatus);
|
||||||
},
|
},
|
||||||
|
|
|
@ -19,7 +19,10 @@
|
||||||
:multiple="enableMultipleFileUpload"
|
:multiple="enableMultipleFileUpload"
|
||||||
:drop="true"
|
:drop="true"
|
||||||
:drop-directory="false"
|
:drop-directory="false"
|
||||||
:data="{ direct_upload_url: '/rails/active_storage/direct_uploads', direct_upload: true }"
|
:data="{
|
||||||
|
direct_upload_url: '/rails/active_storage/direct_uploads',
|
||||||
|
direct_upload: true,
|
||||||
|
}"
|
||||||
@input-file="onDirectFileUpload"
|
@input-file="onDirectFileUpload"
|
||||||
>
|
>
|
||||||
<woot-button
|
<woot-button
|
||||||
|
@ -81,7 +84,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import FileUpload from 'vue-upload-component';
|
import FileUpload from 'vue-upload-component';
|
||||||
import * as ActiveStorage from "activestorage";
|
import * as ActiveStorage from 'activestorage';
|
||||||
import {
|
import {
|
||||||
hasPressedAltAndWKey,
|
hasPressedAltAndWKey,
|
||||||
hasPressedAltAndAKey,
|
hasPressedAltAndAKey,
|
||||||
|
@ -152,9 +155,6 @@ export default {
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
ActiveStorage.start();
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
isNote() {
|
isNote() {
|
||||||
return this.mode === REPLY_EDITOR_MODES.NOTE;
|
return this.mode === REPLY_EDITOR_MODES.NOTE;
|
||||||
|
@ -176,6 +176,9 @@ export default {
|
||||||
return ALLOWED_FILE_TYPES;
|
return ALLOWED_FILE_TYPES;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
ActiveStorage.start();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleKeyEvents(e) {
|
handleKeyEvents(e) {
|
||||||
if (hasPressedAltAndWKey(e)) {
|
if (hasPressedAltAndWKey(e)) {
|
||||||
|
|
|
@ -456,12 +456,15 @@ export default {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (checkFileSizeLimit(file, MAXIMUM_FILE_UPLOAD_SIZE)) {
|
if (checkFileSizeLimit(file, MAXIMUM_FILE_UPLOAD_SIZE)) {
|
||||||
const upload = new DirectUpload(file.file, '/rails/active_storage/direct_uploads', null, file.file.name);
|
const upload = new DirectUpload(
|
||||||
|
file.file,
|
||||||
|
'/rails/active_storage/direct_uploads',
|
||||||
|
null,
|
||||||
|
file.file.name
|
||||||
|
);
|
||||||
upload.create((error, blob) => {
|
upload.create((error, blob) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
this.showAlert(
|
this.showAlert(error);
|
||||||
error
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
this.attachedFiles.push({
|
this.attachedFiles.push({
|
||||||
currentChatId: this.currentChat.id,
|
currentChatId: this.currentChat.id,
|
||||||
|
|
|
@ -54,7 +54,12 @@ export default {
|
||||||
this.isUploading = true;
|
this.isUploading = true;
|
||||||
try {
|
try {
|
||||||
if (checkFileSizeLimit(file, MAXIMUM_FILE_UPLOAD_SIZE)) {
|
if (checkFileSizeLimit(file, MAXIMUM_FILE_UPLOAD_SIZE)) {
|
||||||
const upload = new DirectUpload(file.file, '/rails/active_storage/direct_uploads', null, file.file.name);
|
const upload = new DirectUpload(
|
||||||
|
file.file,
|
||||||
|
'/rails/active_storage/direct_uploads',
|
||||||
|
null,
|
||||||
|
file.file.name
|
||||||
|
);
|
||||||
|
|
||||||
upload.create((error, blob) => {
|
upload.create((error, blob) => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -64,7 +69,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.onAttach({
|
this.onAttach({
|
||||||
fileType: blob.content_type,
|
fileType: blob.content_type,
|
||||||
file: blob.signed_id
|
file: blob.signed_id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue