-
+ {hostConfig.isPublic ?
:
}
-
-
-
+
+ {hostConfig.isPublic ? (
+
+
404 - Diese Funktion ist nicht verfĂŒgbar
+
Diese Funktion ist nur ĂŒber das interne Netzwerk erreichbar.
+
+ ZurĂŒck zum Upload
+
+
+ ) : (
+ <>
+
+ >
+ )}
)
}
+
export default FZF
diff --git a/frontend/src/Components/Pages/MultiUploadPage.js b/frontend/src/Components/Pages/MultiUploadPage.js
index d97ba91..46c6ed4 100644
--- a/frontend/src/Components/Pages/MultiUploadPage.js
+++ b/frontend/src/Components/Pages/MultiUploadPage.js
@@ -335,7 +335,18 @@ function MultiUploadPage() {
}}
onClick={() => {
const link = `${window.location.origin}/manage/${uploadResult.managementToken}`;
- navigator.clipboard.writeText(link);
+ // Fallback fĂŒr HTTP (wenn navigator.clipboard nicht verfĂŒgbar)
+ if (navigator.clipboard && navigator.clipboard.writeText) {
+ navigator.clipboard.writeText(link);
+ } else {
+ // Fallback: Erstelle temporÀres Input-Element
+ const input = document.createElement('input');
+ input.value = link;
+ document.body.appendChild(input);
+ input.select();
+ document.execCommand('copy');
+ document.body.removeChild(input);
+ }
}}
>
đ Kopieren
diff --git a/frontend/src/Utils/hostDetection.js b/frontend/src/Utils/hostDetection.js
new file mode 100644
index 0000000..ee6f7dc
--- /dev/null
+++ b/frontend/src/Utils/hostDetection.js
@@ -0,0 +1,94 @@
+/**
+ * Host Detection Utility
+ *
+ * Erkennt, ob App auf public oder internal Host lÀuft
+ * Basiert auf window.location.hostname + env-config
+ *
+ * @module Utils/hostDetection
+ */
+
+/**
+ * Hole Host-Konfiguration und Feature-Flags
+ * @returns {Object} Host-Config mit Feature-Flags
+ */
+export const getHostConfig = () => {
+ const hostname = window.location.hostname;
+
+ // Hole Hosts aus Runtime-Config (wird von env.sh beim Container-Start gesetzt)
+ const publicHost = window._env_?.PUBLIC_HOST || 'deinprojekt.hobbyhimmel.de';
+ const internalHost = window._env_?.INTERNAL_HOST || 'deinprojekt.lan.hobbyhimmel.de';
+
+ // Bestimme Host-Typ
+ const isPublic = hostname === publicHost;
+ const isInternal = hostname === internalHost || hostname === 'localhost' || hostname === '127.0.0.1';
+
+ // Feature Flags basierend auf Host
+ return {
+ hostname,
+ publicHost,
+ internalHost,
+ isPublic,
+ isInternal,
+
+ // Feature Flags
+ canAccessAdmin: isInternal,
+ canAccessSlideshow: isInternal,
+ canAccessGroups: isInternal,
+ canAccessModeration: isInternal,
+ canAccessReorder: isInternal,
+ canAccessBatchUpload: isInternal,
+ canAccessSocialMedia: isInternal,
+ canAccessMigration: isInternal,
+
+ // Immer erlaubt (public + internal)
+ canUpload: true,
+ canManageByUUID: true
+ };
+};
+
+/**
+ * PrĂŒft, ob App auf public Host lĂ€uft
+ * @returns {boolean} True wenn public Host
+ */
+export const isPublicHost = () => {
+ return getHostConfig().isPublic;
+};
+
+/**
+ * PrĂŒft, ob App auf internal Host lĂ€uft
+ * @returns {boolean} True wenn internal Host
+ */
+export const isInternalHost = () => {
+ return getHostConfig().isInternal;
+};
+
+/**
+ * Hole spezifisches Feature-Flag
+ * @param {string} featureName - Name des Features (z.B. 'canAccessAdmin')
+ * @returns {boolean} True wenn Feature erlaubt
+ */
+export const canAccessFeature = (featureName) => {
+ const config = getHostConfig();
+ return config[featureName] || false;
+};
+
+/**
+ * Debug-Funktion: Logge Host-Config in Console
+ * Nur in Development
+ */
+export const logHostConfig = () => {
+ if (process.env.NODE_ENV === 'development') {
+ const config = getHostConfig();
+ console.log('đ Host Configuration:', {
+ hostname: config.hostname,
+ isPublic: config.isPublic,
+ isInternal: config.isInternal,
+ features: {
+ admin: config.canAccessAdmin,
+ slideshow: config.canAccessSlideshow,
+ groups: config.canAccessGroups,
+ moderation: config.canAccessModeration
+ }
+ });
+ }
+};