added enabled/disable to styles
This commit is contained in:
@@ -30,13 +30,16 @@
|
||||
@close="currentOverlayComponent = null"
|
||||
/>
|
||||
|
||||
<div v-if="errorMessage" class="fixed bottom-4 right-4 bg-red-500 text-white p-4 rounded-lg shadow-lg z-50">
|
||||
{{ errorMessage }}
|
||||
</div>
|
||||
<StyledImageDisplay
|
||||
v-if="currentOverlayComponent === 'styledImageDisplay'"
|
||||
:image="styledImage"
|
||||
@keep="keepStyledImage"
|
||||
@delete="deleteStyledImage"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -55,6 +58,7 @@ const currentOverlayComponent = ref(null); // null, 'contextMenu', 'styleSelecto
|
||||
const contextMenuPosition = ref({ x: 0, y: 0 });
|
||||
const selectedImage = ref(null);
|
||||
const styledImage = ref(null); // To store the newly styled image
|
||||
const errorMessage = ref(null); // New ref for error messages
|
||||
let fetchInterval = null;
|
||||
|
||||
const totalPages = computed(() => {
|
||||
@@ -74,9 +78,17 @@ const fetchImages = () => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching images:', error);
|
||||
showError(error.response?.data?.error || 'An unknown error occurred.');
|
||||
});
|
||||
};
|
||||
|
||||
const showError = (message) => {
|
||||
errorMessage.value = message;
|
||||
setTimeout(() => {
|
||||
errorMessage.value = null;
|
||||
}, 5000); // Clear error after 5 seconds
|
||||
};
|
||||
|
||||
const showContextMenu = (image, event) => {
|
||||
selectedImage.value = image;
|
||||
contextMenuPosition.value = { x: event.clientX, y: event.clientY };
|
||||
@@ -113,8 +125,9 @@ const applyStyle = (style) => {
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error applying style:', error);
|
||||
// Handle error, maybe show a notification
|
||||
showError(error.response?.data?.error || 'Failed to apply style.');
|
||||
});
|
||||
currentOverlayComponent.value = null;
|
||||
};
|
||||
|
||||
const keepStyledImage = (imageToKeep) => {
|
||||
|
||||
10
resources/lang/de/api.php
Normal file
10
resources/lang/de/api.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'image_uploaded_successfully' => 'Bild erfolgreich hochgeladen.',
|
||||
'style_or_provider_not_found' => 'Stil oder API-Anbieter nicht gefunden oder nicht aktiviert.',
|
||||
'image_not_found' => 'Bild nicht gefunden.',
|
||||
'image_kept_successfully' => 'Bild erfolgreich behalten.',
|
||||
'image_deleted_successfully' => 'Bild erfolgreich gelöscht.',
|
||||
'image_or_provider_not_found' => 'Bild oder API-Anbieter nicht gefunden.',
|
||||
];
|
||||
@@ -32,6 +32,13 @@ return [
|
||||
'plugin' => 'Plugin',
|
||||
'enabled' => 'Aktiviert',
|
||||
],
|
||||
'action' => [
|
||||
'enable' => 'Aktivieren',
|
||||
'disable' => 'Deaktivieren',
|
||||
'delete' => 'Löschen',
|
||||
'enable_selected' => 'Ausgewählte aktivieren',
|
||||
'disable_selected' => 'Ausgewählte deaktivieren',
|
||||
],
|
||||
],
|
||||
'image' => [
|
||||
'form' => [
|
||||
|
||||
10
resources/lang/en/api.php
Normal file
10
resources/lang/en/api.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'image_uploaded_successfully' => 'Image uploaded successfully.',
|
||||
'style_or_provider_not_found' => 'Style or API provider not found or not enabled.',
|
||||
'image_not_found' => 'Image not found.',
|
||||
'image_kept_successfully' => 'Image kept successfully.',
|
||||
'image_deleted_successfully' => 'Image deleted successfully.',
|
||||
'image_or_provider_not_found' => 'Image or API provider not found.',
|
||||
];
|
||||
@@ -31,6 +31,13 @@ return [
|
||||
'plugin' => 'Plugin',
|
||||
'enabled' => 'Enabled',
|
||||
],
|
||||
'action' => [
|
||||
'enable' => 'Enable',
|
||||
'disable' => 'Disable',
|
||||
'delete' => 'Delete',
|
||||
'enable_selected' => 'Enable Selected',
|
||||
'disable_selected' => 'Disable Selected',
|
||||
],
|
||||
],
|
||||
'image' => [
|
||||
'form' => [
|
||||
@@ -76,28 +83,6 @@ return [
|
||||
'disable_selected' => 'Disable Selected',
|
||||
],
|
||||
],
|
||||
'plugin' => [
|
||||
'navigation' => [
|
||||
'group' => 'Plugins',
|
||||
'label' => 'Plugins',
|
||||
],
|
||||
'table' => [
|
||||
'name' => 'Name',
|
||||
'identifier' => 'Identifier',
|
||||
'enabled' => 'Enabled',
|
||||
'file_path' => 'File Path',
|
||||
],
|
||||
'action' => [
|
||||
'enable' => 'Enable',
|
||||
'disable' => 'Disable',
|
||||
'delete' => 'Delete',
|
||||
],
|
||||
],
|
||||
'styled_image_display' => [
|
||||
'title' => 'Newly Styled Image',
|
||||
'keep_button' => 'Keep',
|
||||
'delete_button' => 'Delete',
|
||||
],
|
||||
'user' => [
|
||||
'navigation' => [
|
||||
'group' => 'User Management',
|
||||
|
||||
Reference in New Issue
Block a user