koishi-plugin-media-luna 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/README.md +558 -0
- package/client/api.ts +256 -0
- package/client/components/ChannelConfigDialog.vue +1113 -0
- package/client/components/ChannelsView.vue +698 -0
- package/client/components/ConfigRenderer.vue +164 -0
- package/client/components/EmptyState.vue +87 -0
- package/client/components/GenerateView.vue +778 -0
- package/client/components/HistoryGallery.vue +590 -0
- package/client/components/ImageLightbox.vue +510 -0
- package/client/components/ImageUpload.vue +298 -0
- package/client/components/JsonEditor.vue +68 -0
- package/client/components/LoadingState.vue +73 -0
- package/client/components/PresetsView.vue +800 -0
- package/client/components/ScrollContainer.vue +45 -0
- package/client/components/SettingsView.vue +231 -0
- package/client/components/StatusBadge.vue +55 -0
- package/client/components/TagFilter.vue +139 -0
- package/client/components/TagInput.vue +63 -0
- package/client/components/TasksView.vue +1074 -0
- package/client/components/ViewModeSwitch.vue +78 -0
- package/client/components/settings/CachePanel.vue +142 -0
- package/client/components/settings/MiddlewaresPanel.vue +480 -0
- package/client/components/settings/PluginsPanel.vue +493 -0
- package/client/index.ts +13 -0
- package/client/pages/index.vue +177 -0
- package/client/styles/shared.css +258 -0
- package/client/types.ts +158 -0
- package/client/utils/format.ts +72 -0
- package/dist/index.js +1 -0
- package/dist/style.css +1 -0
- package/lib/api/README.md +643 -0
- package/lib/api/cache-api.d.ts +6 -0
- package/lib/api/cache-api.d.ts.map +1 -0
- package/lib/api/cache-api.js +147 -0
- package/lib/api/cache-api.js.map +1 -0
- package/lib/api/channel-api.d.ts +6 -0
- package/lib/api/channel-api.d.ts.map +1 -0
- package/lib/api/channel-api.js +148 -0
- package/lib/api/channel-api.js.map +1 -0
- package/lib/api/connector-api.d.ts +6 -0
- package/lib/api/connector-api.d.ts.map +1 -0
- package/lib/api/connector-api.js +63 -0
- package/lib/api/connector-api.js.map +1 -0
- package/lib/api/generate-api.d.ts +6 -0
- package/lib/api/generate-api.d.ts.map +1 -0
- package/lib/api/generate-api.js +123 -0
- package/lib/api/generate-api.js.map +1 -0
- package/lib/api/index.d.ts +15 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/index.js +34 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/middleware-api.d.ts +6 -0
- package/lib/api/middleware-api.d.ts.map +1 -0
- package/lib/api/middleware-api.js +212 -0
- package/lib/api/middleware-api.js.map +1 -0
- package/lib/api/plugin-api.d.ts +6 -0
- package/lib/api/plugin-api.d.ts.map +1 -0
- package/lib/api/plugin-api.js +78 -0
- package/lib/api/plugin-api.js.map +1 -0
- package/lib/api/preset-api.d.ts +6 -0
- package/lib/api/preset-api.d.ts.map +1 -0
- package/lib/api/preset-api.js +256 -0
- package/lib/api/preset-api.js.map +1 -0
- package/lib/api/settings-api.d.ts +6 -0
- package/lib/api/settings-api.d.ts.map +1 -0
- package/lib/api/settings-api.js +118 -0
- package/lib/api/settings-api.js.map +1 -0
- package/lib/api/task-api.d.ts +6 -0
- package/lib/api/task-api.d.ts.map +1 -0
- package/lib/api/task-api.js +148 -0
- package/lib/api/task-api.js.map +1 -0
- package/lib/config.d.ts +6 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +8 -0
- package/lib/config.js.map +1 -0
- package/lib/connectors/builtin/chat-api.d.ts +9 -0
- package/lib/connectors/builtin/chat-api.d.ts.map +1 -0
- package/lib/connectors/builtin/chat-api.js +351 -0
- package/lib/connectors/builtin/chat-api.js.map +1 -0
- package/lib/connectors/builtin/dalle.d.ts +6 -0
- package/lib/connectors/builtin/dalle.d.ts.map +1 -0
- package/lib/connectors/builtin/dalle.js +109 -0
- package/lib/connectors/builtin/dalle.js.map +1 -0
- package/lib/connectors/builtin/flux.d.ts +7 -0
- package/lib/connectors/builtin/flux.d.ts.map +1 -0
- package/lib/connectors/builtin/flux.js +199 -0
- package/lib/connectors/builtin/flux.js.map +1 -0
- package/lib/connectors/builtin/index.d.ts +5 -0
- package/lib/connectors/builtin/index.d.ts.map +1 -0
- package/lib/connectors/builtin/index.js +6 -0
- package/lib/connectors/builtin/index.js.map +1 -0
- package/lib/connectors/builtin/sd-webui.d.ts +7 -0
- package/lib/connectors/builtin/sd-webui.d.ts.map +1 -0
- package/lib/connectors/builtin/sd-webui.js +157 -0
- package/lib/connectors/builtin/sd-webui.js.map +1 -0
- package/lib/connectors/connector-registry.d.ts +36 -0
- package/lib/connectors/connector-registry.d.ts.map +1 -0
- package/lib/connectors/connector-registry.js +66 -0
- package/lib/connectors/connector-registry.js.map +1 -0
- package/lib/connectors/index.d.ts +3 -0
- package/lib/connectors/index.d.ts.map +1 -0
- package/lib/connectors/index.js +4 -0
- package/lib/connectors/index.js.map +1 -0
- package/lib/core/api/api-utils.d.ts +46 -0
- package/lib/core/api/api-utils.d.ts.map +1 -0
- package/lib/core/api/api-utils.js +78 -0
- package/lib/core/api/api-utils.js.map +1 -0
- package/lib/core/api/cache-api.d.ts +6 -0
- package/lib/core/api/cache-api.d.ts.map +1 -0
- package/lib/core/api/cache-api.js +147 -0
- package/lib/core/api/cache-api.js.map +1 -0
- package/lib/core/api/channel-api.d.ts +6 -0
- package/lib/core/api/channel-api.d.ts.map +1 -0
- package/lib/core/api/channel-api.js +146 -0
- package/lib/core/api/channel-api.js.map +1 -0
- package/lib/core/api/connector-api.d.ts +6 -0
- package/lib/core/api/connector-api.d.ts.map +1 -0
- package/lib/core/api/connector-api.js +63 -0
- package/lib/core/api/connector-api.js.map +1 -0
- package/lib/core/api/generate-api.d.ts +6 -0
- package/lib/core/api/generate-api.d.ts.map +1 -0
- package/lib/core/api/generate-api.js +124 -0
- package/lib/core/api/generate-api.js.map +1 -0
- package/lib/core/api/index.d.ts +16 -0
- package/lib/core/api/index.d.ts.map +1 -0
- package/lib/core/api/index.js +38 -0
- package/lib/core/api/index.js.map +1 -0
- package/lib/core/api/middleware-api.d.ts +6 -0
- package/lib/core/api/middleware-api.d.ts.map +1 -0
- package/lib/core/api/middleware-api.js +196 -0
- package/lib/core/api/middleware-api.js.map +1 -0
- package/lib/core/api/plugin-api.d.ts +6 -0
- package/lib/core/api/plugin-api.d.ts.map +1 -0
- package/lib/core/api/plugin-api.js +78 -0
- package/lib/core/api/plugin-api.js.map +1 -0
- package/lib/core/api/preset-api.d.ts +6 -0
- package/lib/core/api/preset-api.d.ts.map +1 -0
- package/lib/core/api/preset-api.js +272 -0
- package/lib/core/api/preset-api.js.map +1 -0
- package/lib/core/api/settings-api.d.ts +6 -0
- package/lib/core/api/settings-api.d.ts.map +1 -0
- package/lib/core/api/settings-api.js +118 -0
- package/lib/core/api/settings-api.js.map +1 -0
- package/lib/core/api/task-api.d.ts +6 -0
- package/lib/core/api/task-api.d.ts.map +1 -0
- package/lib/core/api/task-api.js +281 -0
- package/lib/core/api/task-api.js.map +1 -0
- package/lib/core/channel.service.d.ts +44 -0
- package/lib/core/channel.service.d.ts.map +1 -0
- package/lib/core/channel.service.js +146 -0
- package/lib/core/channel.service.js.map +1 -0
- package/lib/core/config/config.service.d.ts +89 -0
- package/lib/core/config/config.service.d.ts.map +1 -0
- package/lib/core/config/config.service.js +216 -0
- package/lib/core/config/config.service.js.map +1 -0
- package/lib/core/config/index.d.ts +3 -0
- package/lib/core/config/index.d.ts.map +1 -0
- package/lib/core/config/index.js +3 -0
- package/lib/core/config/index.js.map +1 -0
- package/lib/core/error.d.ts +73 -0
- package/lib/core/error.d.ts.map +1 -0
- package/lib/core/error.js +137 -0
- package/lib/core/error.js.map +1 -0
- package/lib/core/index.d.ts +12 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +23 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/logger.d.ts +18 -0
- package/lib/core/logger.d.ts.map +1 -0
- package/lib/core/logger.js +39 -0
- package/lib/core/logger.js.map +1 -0
- package/lib/core/medialuna.service.d.ts +168 -0
- package/lib/core/medialuna.service.d.ts.map +1 -0
- package/lib/core/medialuna.service.js +423 -0
- package/lib/core/medialuna.service.js.map +1 -0
- package/lib/core/pipeline/dependency-graph.d.ts +43 -0
- package/lib/core/pipeline/dependency-graph.d.ts.map +1 -0
- package/lib/core/pipeline/dependency-graph.js +223 -0
- package/lib/core/pipeline/dependency-graph.js.map +1 -0
- package/lib/core/pipeline/generation-pipeline.d.ts +40 -0
- package/lib/core/pipeline/generation-pipeline.d.ts.map +1 -0
- package/lib/core/pipeline/generation-pipeline.js +216 -0
- package/lib/core/pipeline/generation-pipeline.js.map +1 -0
- package/lib/core/pipeline/index.d.ts +4 -0
- package/lib/core/pipeline/index.d.ts.map +1 -0
- package/lib/core/pipeline/index.js +5 -0
- package/lib/core/pipeline/index.js.map +1 -0
- package/lib/core/pipeline/middleware-registry.d.ts +33 -0
- package/lib/core/pipeline/middleware-registry.d.ts.map +1 -0
- package/lib/core/pipeline/middleware-registry.js +78 -0
- package/lib/core/pipeline/middleware-registry.js.map +1 -0
- package/lib/core/plugin-loader.d.ts +77 -0
- package/lib/core/plugin-loader.d.ts.map +1 -0
- package/lib/core/plugin-loader.js +300 -0
- package/lib/core/plugin-loader.js.map +1 -0
- package/lib/core/registry/connector.registry.d.ts +36 -0
- package/lib/core/registry/connector.registry.d.ts.map +1 -0
- package/lib/core/registry/connector.registry.js +65 -0
- package/lib/core/registry/connector.registry.js.map +1 -0
- package/lib/core/registry/index.d.ts +3 -0
- package/lib/core/registry/index.d.ts.map +1 -0
- package/lib/core/registry/index.js +4 -0
- package/lib/core/registry/index.js.map +1 -0
- package/lib/core/registry/service.registry.d.ts +27 -0
- package/lib/core/registry/service.registry.d.ts.map +1 -0
- package/lib/core/registry/service.registry.js +54 -0
- package/lib/core/registry/service.registry.js.map +1 -0
- package/lib/core/request.service.d.ts +83 -0
- package/lib/core/request.service.d.ts.map +1 -0
- package/lib/core/request.service.js +237 -0
- package/lib/core/request.service.js.map +1 -0
- package/lib/core/types.d.ts +270 -0
- package/lib/core/types.d.ts.map +1 -0
- package/lib/core/types.js +17 -0
- package/lib/core/types.js.map +1 -0
- package/lib/database.d.ts +6 -0
- package/lib/database.d.ts.map +1 -0
- package/lib/database.js +89 -0
- package/lib/database.js.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +54 -0
- package/lib/index.js.map +1 -0
- package/lib/middlewares/builtin/billing.d.ts +45 -0
- package/lib/middlewares/builtin/billing.d.ts.map +1 -0
- package/lib/middlewares/builtin/billing.js +362 -0
- package/lib/middlewares/builtin/billing.js.map +1 -0
- package/lib/middlewares/builtin/index.d.ts +6 -0
- package/lib/middlewares/builtin/index.d.ts.map +1 -0
- package/lib/middlewares/builtin/index.js +7 -0
- package/lib/middlewares/builtin/index.js.map +1 -0
- package/lib/middlewares/builtin/preset.d.ts +14 -0
- package/lib/middlewares/builtin/preset.d.ts.map +1 -0
- package/lib/middlewares/builtin/preset.js +156 -0
- package/lib/middlewares/builtin/preset.js.map +1 -0
- package/lib/middlewares/builtin/remote-preset-sync.d.ts +8 -0
- package/lib/middlewares/builtin/remote-preset-sync.d.ts.map +1 -0
- package/lib/middlewares/builtin/remote-preset-sync.js +32 -0
- package/lib/middlewares/builtin/remote-preset-sync.js.map +1 -0
- package/lib/middlewares/builtin/request.d.ts +10 -0
- package/lib/middlewares/builtin/request.d.ts.map +1 -0
- package/lib/middlewares/builtin/request.js +50 -0
- package/lib/middlewares/builtin/request.js.map +1 -0
- package/lib/middlewares/builtin/storage.d.ts +64 -0
- package/lib/middlewares/builtin/storage.d.ts.map +1 -0
- package/lib/middlewares/builtin/storage.js +715 -0
- package/lib/middlewares/builtin/storage.js.map +1 -0
- package/lib/middlewares/builtin/task-recorder.d.ts +20 -0
- package/lib/middlewares/builtin/task-recorder.d.ts.map +1 -0
- package/lib/middlewares/builtin/task-recorder.js +138 -0
- package/lib/middlewares/builtin/task-recorder.js.map +1 -0
- package/lib/middlewares/index.d.ts +2 -0
- package/lib/middlewares/index.d.ts.map +1 -0
- package/lib/middlewares/index.js +3 -0
- package/lib/middlewares/index.js.map +1 -0
- package/lib/pipeline/dependency-graph.d.ts +43 -0
- package/lib/pipeline/dependency-graph.d.ts.map +1 -0
- package/lib/pipeline/dependency-graph.js +240 -0
- package/lib/pipeline/dependency-graph.js.map +1 -0
- package/lib/pipeline/generation-pipeline.d.ts +38 -0
- package/lib/pipeline/generation-pipeline.d.ts.map +1 -0
- package/lib/pipeline/generation-pipeline.js +211 -0
- package/lib/pipeline/generation-pipeline.js.map +1 -0
- package/lib/pipeline/index.d.ts +4 -0
- package/lib/pipeline/index.d.ts.map +1 -0
- package/lib/pipeline/index.js +5 -0
- package/lib/pipeline/index.js.map +1 -0
- package/lib/pipeline/middleware-registry.d.ts +36 -0
- package/lib/pipeline/middleware-registry.d.ts.map +1 -0
- package/lib/pipeline/middleware-registry.js +83 -0
- package/lib/pipeline/middleware-registry.js.map +1 -0
- package/lib/plugins/billing/config.d.ts +19 -0
- package/lib/plugins/billing/config.d.ts.map +1 -0
- package/lib/plugins/billing/config.js +98 -0
- package/lib/plugins/billing/config.js.map +1 -0
- package/lib/plugins/billing/index.d.ts +4 -0
- package/lib/plugins/billing/index.d.ts.map +1 -0
- package/lib/plugins/billing/index.js +20 -0
- package/lib/plugins/billing/index.js.map +1 -0
- package/lib/plugins/billing/middleware.d.ts +12 -0
- package/lib/plugins/billing/middleware.d.ts.map +1 -0
- package/lib/plugins/billing/middleware.js +233 -0
- package/lib/plugins/billing/middleware.js.map +1 -0
- package/lib/plugins/cache/config.d.ts +44 -0
- package/lib/plugins/cache/config.d.ts.map +1 -0
- package/lib/plugins/cache/config.js +187 -0
- package/lib/plugins/cache/config.js.map +1 -0
- package/lib/plugins/cache/index.d.ts +6 -0
- package/lib/plugins/cache/index.d.ts.map +1 -0
- package/lib/plugins/cache/index.js +87 -0
- package/lib/plugins/cache/index.js.map +1 -0
- package/lib/plugins/cache/middleware.d.ts +12 -0
- package/lib/plugins/cache/middleware.d.ts.map +1 -0
- package/lib/plugins/cache/middleware.js +194 -0
- package/lib/plugins/cache/middleware.js.map +1 -0
- package/lib/plugins/cache/service.d.ts +106 -0
- package/lib/plugins/cache/service.d.ts.map +1 -0
- package/lib/plugins/cache/service.js +467 -0
- package/lib/plugins/cache/service.js.map +1 -0
- package/lib/plugins/cache/utils/index.d.ts +4 -0
- package/lib/plugins/cache/utils/index.d.ts.map +1 -0
- package/lib/plugins/cache/utils/index.js +5 -0
- package/lib/plugins/cache/utils/index.js.map +1 -0
- package/lib/plugins/cache/utils/mime.d.ts +9 -0
- package/lib/plugins/cache/utils/mime.d.ts.map +1 -0
- package/lib/plugins/cache/utils/mime.js +65 -0
- package/lib/plugins/cache/utils/mime.js.map +1 -0
- package/lib/plugins/cache/utils/s3.d.ts +19 -0
- package/lib/plugins/cache/utils/s3.d.ts.map +1 -0
- package/lib/plugins/cache/utils/s3.js +147 -0
- package/lib/plugins/cache/utils/s3.js.map +1 -0
- package/lib/plugins/cache/utils/webdav.d.ts +16 -0
- package/lib/plugins/cache/utils/webdav.d.ts.map +1 -0
- package/lib/plugins/cache/utils/webdav.js +69 -0
- package/lib/plugins/cache/utils/webdav.js.map +1 -0
- package/lib/plugins/connector-chat-api/index.d.ts +7 -0
- package/lib/plugins/connector-chat-api/index.d.ts.map +1 -0
- package/lib/plugins/connector-chat-api/index.js +400 -0
- package/lib/plugins/connector-chat-api/index.js.map +1 -0
- package/lib/plugins/connector-dalle/index.d.ts +7 -0
- package/lib/plugins/connector-dalle/index.d.ts.map +1 -0
- package/lib/plugins/connector-dalle/index.js +140 -0
- package/lib/plugins/connector-dalle/index.js.map +1 -0
- package/lib/plugins/connector-flux/index.d.ts +7 -0
- package/lib/plugins/connector-flux/index.d.ts.map +1 -0
- package/lib/plugins/connector-flux/index.js +232 -0
- package/lib/plugins/connector-flux/index.js.map +1 -0
- package/lib/plugins/connector-sd-webui/index.d.ts +7 -0
- package/lib/plugins/connector-sd-webui/index.d.ts.map +1 -0
- package/lib/plugins/connector-sd-webui/index.js +171 -0
- package/lib/plugins/connector-sd-webui/index.js.map +1 -0
- package/lib/plugins/index.d.ts +22 -0
- package/lib/plugins/index.d.ts.map +1 -0
- package/lib/plugins/index.js +21 -0
- package/lib/plugins/index.js.map +1 -0
- package/lib/plugins/preset/config.d.ts +37 -0
- package/lib/plugins/preset/config.d.ts.map +1 -0
- package/lib/plugins/preset/config.js +74 -0
- package/lib/plugins/preset/config.js.map +1 -0
- package/lib/plugins/preset/index.d.ts +6 -0
- package/lib/plugins/preset/index.d.ts.map +1 -0
- package/lib/plugins/preset/index.js +58 -0
- package/lib/plugins/preset/index.js.map +1 -0
- package/lib/plugins/preset/middleware.d.ts +6 -0
- package/lib/plugins/preset/middleware.d.ts.map +1 -0
- package/lib/plugins/preset/middleware.js +126 -0
- package/lib/plugins/preset/middleware.js.map +1 -0
- package/lib/plugins/preset/remote-sync.service.d.ts +84 -0
- package/lib/plugins/preset/remote-sync.service.d.ts.map +1 -0
- package/lib/plugins/preset/remote-sync.service.js +342 -0
- package/lib/plugins/preset/remote-sync.service.js.map +1 -0
- package/lib/plugins/preset/service.d.ts +64 -0
- package/lib/plugins/preset/service.d.ts.map +1 -0
- package/lib/plugins/preset/service.js +196 -0
- package/lib/plugins/preset/service.js.map +1 -0
- package/lib/plugins/prompt-encoding/config.d.ts +25 -0
- package/lib/plugins/prompt-encoding/config.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/config.js +62 -0
- package/lib/plugins/prompt-encoding/config.js.map +1 -0
- package/lib/plugins/prompt-encoding/index.d.ts +5 -0
- package/lib/plugins/prompt-encoding/index.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/index.js +21 -0
- package/lib/plugins/prompt-encoding/index.js.map +1 -0
- package/lib/plugins/prompt-encoding/middleware.d.ts +6 -0
- package/lib/plugins/prompt-encoding/middleware.d.ts.map +1 -0
- package/lib/plugins/prompt-encoding/middleware.js +151 -0
- package/lib/plugins/prompt-encoding/middleware.js.map +1 -0
- package/lib/plugins/task/config.d.ts +15 -0
- package/lib/plugins/task/config.d.ts.map +1 -0
- package/lib/plugins/task/config.js +33 -0
- package/lib/plugins/task/config.js.map +1 -0
- package/lib/plugins/task/index.d.ts +5 -0
- package/lib/plugins/task/index.d.ts.map +1 -0
- package/lib/plugins/task/index.js +58 -0
- package/lib/plugins/task/index.js.map +1 -0
- package/lib/plugins/task/middleware.d.ts +14 -0
- package/lib/plugins/task/middleware.d.ts.map +1 -0
- package/lib/plugins/task/middleware.js +123 -0
- package/lib/plugins/task/middleware.js.map +1 -0
- package/lib/plugins/task/service.d.ts +94 -0
- package/lib/plugins/task/service.d.ts.map +1 -0
- package/lib/plugins/task/service.js +226 -0
- package/lib/plugins/task/service.js.map +1 -0
- package/lib/plugins/webui-auth/config.d.ts +12 -0
- package/lib/plugins/webui-auth/config.d.ts.map +1 -0
- package/lib/plugins/webui-auth/config.js +30 -0
- package/lib/plugins/webui-auth/config.js.map +1 -0
- package/lib/plugins/webui-auth/index.d.ts +5 -0
- package/lib/plugins/webui-auth/index.d.ts.map +1 -0
- package/lib/plugins/webui-auth/index.js +99 -0
- package/lib/plugins/webui-auth/index.js.map +1 -0
- package/lib/plugins/webui-auth/service.d.ts +42 -0
- package/lib/plugins/webui-auth/service.d.ts.map +1 -0
- package/lib/plugins/webui-auth/service.js +106 -0
- package/lib/plugins/webui-auth/service.js.map +1 -0
- package/lib/services/asset-cache.service.d.ts +133 -0
- package/lib/services/asset-cache.service.d.ts.map +1 -0
- package/lib/services/asset-cache.service.js +882 -0
- package/lib/services/asset-cache.service.js.map +1 -0
- package/lib/services/cache.service.d.ts +110 -0
- package/lib/services/cache.service.d.ts.map +1 -0
- package/lib/services/cache.service.js +333 -0
- package/lib/services/cache.service.js.map +1 -0
- package/lib/services/channel.service.d.ts +44 -0
- package/lib/services/channel.service.d.ts.map +1 -0
- package/lib/services/channel.service.js +154 -0
- package/lib/services/channel.service.js.map +1 -0
- package/lib/services/config.service.d.ts +73 -0
- package/lib/services/config.service.d.ts.map +1 -0
- package/lib/services/config.service.js +171 -0
- package/lib/services/config.service.js.map +1 -0
- package/lib/services/index.d.ts +8 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +9 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/medialuna.service.d.ts +173 -0
- package/lib/services/medialuna.service.d.ts.map +1 -0
- package/lib/services/medialuna.service.js +455 -0
- package/lib/services/medialuna.service.js.map +1 -0
- package/lib/services/preset.service.d.ts +69 -0
- package/lib/services/preset.service.d.ts.map +1 -0
- package/lib/services/preset.service.js +202 -0
- package/lib/services/preset.service.js.map +1 -0
- package/lib/services/remote-preset.service.d.ts +97 -0
- package/lib/services/remote-preset.service.d.ts.map +1 -0
- package/lib/services/remote-preset.service.js +212 -0
- package/lib/services/remote-preset.service.js.map +1 -0
- package/lib/services/task.service.d.ts +57 -0
- package/lib/services/task.service.d.ts.map +1 -0
- package/lib/services/task.service.js +138 -0
- package/lib/services/task.service.js.map +1 -0
- package/lib/types/index.d.ts +357 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +21 -0
- package/lib/types/index.js.map +1 -0
- package/package.json +66 -0
- package/readme.md +326 -0
|
@@ -0,0 +1,778 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="view-container">
|
|
3
|
+
<div class="view-content">
|
|
4
|
+
<div class="generate-layout">
|
|
5
|
+
<!-- 左侧配置区 -->
|
|
6
|
+
<div class="config-panel">
|
|
7
|
+
<k-card class="config-card">
|
|
8
|
+
<div class="form-section">
|
|
9
|
+
<div class="section-title">
|
|
10
|
+
<k-icon name="settings"></k-icon> 基础配置
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
<div class="form-item">
|
|
14
|
+
<div class="label">生成渠道</div>
|
|
15
|
+
<el-select v-model="form.channel" placeholder="选择生成渠道" style="width: 100%">
|
|
16
|
+
<el-option
|
|
17
|
+
v-for="channel in channels"
|
|
18
|
+
:key="channel.id"
|
|
19
|
+
:label="channel.name"
|
|
20
|
+
:value="channel.id"
|
|
21
|
+
/>
|
|
22
|
+
</el-select>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="form-item">
|
|
26
|
+
<div class="label">预设模板</div>
|
|
27
|
+
<el-select v-model="presetId" placeholder="选择预设模板 (可选)" style="width: 100%" clearable @change="applyPreset">
|
|
28
|
+
<el-option
|
|
29
|
+
v-for="preset in presets"
|
|
30
|
+
:key="preset.id"
|
|
31
|
+
:label="preset.name"
|
|
32
|
+
:value="preset.id"
|
|
33
|
+
/>
|
|
34
|
+
</el-select>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="form-section flex-grow">
|
|
39
|
+
<div class="section-title">
|
|
40
|
+
<k-icon name="edit"></k-icon> 提示词
|
|
41
|
+
</div>
|
|
42
|
+
<el-input
|
|
43
|
+
v-model="form.prompt"
|
|
44
|
+
type="textarea"
|
|
45
|
+
:rows="8"
|
|
46
|
+
placeholder="输入提示词,支持自然语言描述..."
|
|
47
|
+
resize="none"
|
|
48
|
+
class="prompt-input"
|
|
49
|
+
></el-input>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- 文件上传区域 -->
|
|
53
|
+
<div class="form-section">
|
|
54
|
+
<div class="section-title">
|
|
55
|
+
<k-icon name="image"></k-icon> 参考图片
|
|
56
|
+
</div>
|
|
57
|
+
<div class="upload-area">
|
|
58
|
+
<!-- 已上传的图片列表 -->
|
|
59
|
+
<div class="upload-list" v-if="fileList.length > 0">
|
|
60
|
+
<div v-for="(file, index) in fileList" :key="file.uid" class="upload-item">
|
|
61
|
+
<img :src="file.url" class="upload-thumb" />
|
|
62
|
+
<div class="upload-overlay" @click="removeFile(index)">
|
|
63
|
+
<k-icon name="delete"></k-icon>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
<!-- 上传按钮 -->
|
|
68
|
+
<div
|
|
69
|
+
v-if="fileList.length < 4"
|
|
70
|
+
class="upload-trigger"
|
|
71
|
+
@click="triggerUpload"
|
|
72
|
+
@dragover.prevent
|
|
73
|
+
@drop.prevent="handleDrop"
|
|
74
|
+
>
|
|
75
|
+
<input
|
|
76
|
+
ref="fileInput"
|
|
77
|
+
type="file"
|
|
78
|
+
accept="image/*"
|
|
79
|
+
multiple
|
|
80
|
+
style="display: none"
|
|
81
|
+
@change="handleFileSelect"
|
|
82
|
+
/>
|
|
83
|
+
<k-icon name="add" class="upload-icon"></k-icon>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="upload-tip">点击或拖拽上传,最多 4 张</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="form-actions">
|
|
90
|
+
<k-button solid type="primary" :loading="generating" @click="generate" class="generate-btn">
|
|
91
|
+
<template #icon><k-icon name="magic"></k-icon></template>
|
|
92
|
+
生成图片
|
|
93
|
+
</k-button>
|
|
94
|
+
</div>
|
|
95
|
+
</k-card>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<!-- 右侧预览区 -->
|
|
99
|
+
<div class="preview-panel">
|
|
100
|
+
<div v-if="result" class="result-container">
|
|
101
|
+
<div v-if="result.success" class="success-result">
|
|
102
|
+
<div class="output-grid" v-if="result.output && result.output.length">
|
|
103
|
+
<div v-for="(asset, idx) in result.output" :key="idx" class="output-wrapper">
|
|
104
|
+
<!-- 图片 -->
|
|
105
|
+
<template v-if="asset.kind === 'image'">
|
|
106
|
+
<img :src="asset.url" @click="openImagePreview(idx)" class="clickable-image" />
|
|
107
|
+
<div class="output-actions">
|
|
108
|
+
<a :href="asset.url" target="_blank" class="action-btn" download>
|
|
109
|
+
<k-icon name="download"></k-icon>
|
|
110
|
+
</a>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
<!-- 视频 -->
|
|
114
|
+
<template v-else-if="asset.kind === 'video'">
|
|
115
|
+
<video :src="asset.url" controls class="output-video" />
|
|
116
|
+
</template>
|
|
117
|
+
<!-- 音频 -->
|
|
118
|
+
<template v-else-if="asset.kind === 'audio'">
|
|
119
|
+
<audio :src="asset.url" controls class="output-audio" />
|
|
120
|
+
</template>
|
|
121
|
+
<!-- 其他文件 -->
|
|
122
|
+
<template v-else-if="asset.kind === 'file'">
|
|
123
|
+
<a :href="asset.url" target="_blank" class="file-link">
|
|
124
|
+
<k-icon name="file"></k-icon>
|
|
125
|
+
{{ asset.meta?.filename || '下载文件' }}
|
|
126
|
+
</a>
|
|
127
|
+
</template>
|
|
128
|
+
<!-- 文本 -->
|
|
129
|
+
<template v-else-if="asset.kind === 'text'">
|
|
130
|
+
<div class="text-output">{{ asset.content }}</div>
|
|
131
|
+
</template>
|
|
132
|
+
<!-- 兜底:有 url 则显示链接 -->
|
|
133
|
+
<template v-else-if="asset.url">
|
|
134
|
+
<a :href="asset.url" target="_blank">{{ asset.url }}</a>
|
|
135
|
+
</template>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
<div class="result-meta">
|
|
139
|
+
<span class="meta-item" v-if="result.duration">
|
|
140
|
+
<k-icon name="stopwatch"></k-icon> 耗时: {{ (result.duration / 1000).toFixed(2) }}s
|
|
141
|
+
</span>
|
|
142
|
+
<span class="meta-item" v-if="result.taskId">
|
|
143
|
+
<k-icon name="list-alt"></k-icon> 任务 ID: {{ result.taskId }}
|
|
144
|
+
</span>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
<div v-else class="error-result">
|
|
148
|
+
<k-icon name="warning" class="error-icon"></k-icon>
|
|
149
|
+
<div class="error-msg">{{ result.error || '生成失败' }}</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<div v-else-if="generating" class="generating-state">
|
|
154
|
+
<div class="loader"></div>
|
|
155
|
+
<p>正在生成中,请稍候...</p>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
<div v-else class="empty-state">
|
|
159
|
+
<k-icon name="image" class="empty-icon"></k-icon>
|
|
160
|
+
<p>在左侧配置并点击生成</p>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- 右侧历史画廊 -->
|
|
165
|
+
<HistoryGallery ref="historyGalleryRef" @select="handleHistorySelect" />
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<!-- 图片预览弹窗 -->
|
|
170
|
+
<ImageLightbox
|
|
171
|
+
v-model:visible="lightboxVisible"
|
|
172
|
+
:images="lightboxImages"
|
|
173
|
+
:initial-index="lightboxIndex"
|
|
174
|
+
:prompt="lightboxPrompt"
|
|
175
|
+
:duration="result?.duration"
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
</template>
|
|
179
|
+
|
|
180
|
+
<script setup lang="ts">
|
|
181
|
+
import { ref, onMounted } from 'vue'
|
|
182
|
+
import { message } from '@koishijs/client'
|
|
183
|
+
import { ChannelConfig, PresetData, GenerationResult, ClientFileData } from '../types'
|
|
184
|
+
import { channelApi, presetApi, generateApi, taskApi } from '../api'
|
|
185
|
+
import HistoryGallery from './HistoryGallery.vue'
|
|
186
|
+
import ImageLightbox from './ImageLightbox.vue'
|
|
187
|
+
|
|
188
|
+
/** 本地文件项 */
|
|
189
|
+
interface LocalFile {
|
|
190
|
+
uid: number
|
|
191
|
+
url: string
|
|
192
|
+
raw: File
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const channels = ref<ChannelConfig[]>([])
|
|
196
|
+
const presets = ref<PresetData[]>([])
|
|
197
|
+
const generating = ref(false)
|
|
198
|
+
const result = ref<GenerationResult | null>(null)
|
|
199
|
+
const fileList = ref<LocalFile[]>([])
|
|
200
|
+
const uploadedFiles = ref<ClientFileData[]>([])
|
|
201
|
+
const fileInput = ref<HTMLInputElement>()
|
|
202
|
+
const historyGalleryRef = ref<InstanceType<typeof HistoryGallery>>()
|
|
203
|
+
let fileUid = 0
|
|
204
|
+
|
|
205
|
+
const form = ref({
|
|
206
|
+
channel: undefined as number | undefined,
|
|
207
|
+
prompt: '',
|
|
208
|
+
parameters: {}
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
const presetId = ref<number | undefined>(undefined)
|
|
212
|
+
|
|
213
|
+
// Lightbox 状态
|
|
214
|
+
const lightboxVisible = ref(false)
|
|
215
|
+
const lightboxImages = ref<string[]>([])
|
|
216
|
+
const lightboxIndex = ref(0)
|
|
217
|
+
const lightboxPrompt = ref('') // 存储最终提示词
|
|
218
|
+
|
|
219
|
+
// 打开图片预览
|
|
220
|
+
const openImagePreview = (index: number) => {
|
|
221
|
+
if (result.value?.output) {
|
|
222
|
+
// 只获取图片类型的资源
|
|
223
|
+
lightboxImages.value = result.value.output
|
|
224
|
+
.filter(a => a.kind === 'image' && a.url)
|
|
225
|
+
.map(a => a.url!)
|
|
226
|
+
lightboxIndex.value = index
|
|
227
|
+
lightboxVisible.value = true
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const fetchData = async () => {
|
|
232
|
+
try {
|
|
233
|
+
const [channelsData, presetsData] = await Promise.all([
|
|
234
|
+
channelApi.list(),
|
|
235
|
+
presetApi.list()
|
|
236
|
+
])
|
|
237
|
+
channels.value = channelsData
|
|
238
|
+
presets.value = presetsData
|
|
239
|
+
} catch (e) {
|
|
240
|
+
console.error(e)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const applyPreset = () => {
|
|
245
|
+
// Logic to pre-fill prompt or params based on preset could go here
|
|
246
|
+
// But mostly the backend handles preset logic via ID or name
|
|
247
|
+
// The API 'media-luna/generate' accepts parameters.preset name
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// 文件转 base64
|
|
251
|
+
const fileToBase64 = (file: File): Promise<string> => {
|
|
252
|
+
return new Promise((resolve, reject) => {
|
|
253
|
+
const reader = new FileReader()
|
|
254
|
+
reader.onload = () => {
|
|
255
|
+
const result = reader.result as string
|
|
256
|
+
// 提取 base64 部分 (去掉 data:xxx;base64, 前缀)
|
|
257
|
+
const base64 = result.split(',')[1]
|
|
258
|
+
resolve(base64)
|
|
259
|
+
}
|
|
260
|
+
reader.onerror = reject
|
|
261
|
+
reader.readAsDataURL(file)
|
|
262
|
+
})
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// 触发文件选择
|
|
266
|
+
const triggerUpload = () => {
|
|
267
|
+
fileInput.value?.click()
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// 处理文件选择
|
|
271
|
+
const handleFileSelect = async (e: Event) => {
|
|
272
|
+
const input = e.target as HTMLInputElement
|
|
273
|
+
if (!input.files || input.files.length === 0) return
|
|
274
|
+
await addFiles(Array.from(input.files))
|
|
275
|
+
input.value = '' // 清空以便再次选择同一文件
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// 处理拖拽
|
|
279
|
+
const handleDrop = async (e: DragEvent) => {
|
|
280
|
+
const files = e.dataTransfer?.files
|
|
281
|
+
if (!files || files.length === 0) return
|
|
282
|
+
await addFiles(Array.from(files).filter(f => f.type.startsWith('image/')))
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// 添加文件
|
|
286
|
+
const addFiles = async (files: File[]) => {
|
|
287
|
+
const remaining = 4 - fileList.value.length
|
|
288
|
+
if (remaining <= 0) {
|
|
289
|
+
message.warning('最多上传 4 张图片')
|
|
290
|
+
return
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const toAdd = files.slice(0, remaining)
|
|
294
|
+
|
|
295
|
+
for (const file of toAdd) {
|
|
296
|
+
const url = URL.createObjectURL(file)
|
|
297
|
+
fileList.value.push({
|
|
298
|
+
uid: ++fileUid,
|
|
299
|
+
url,
|
|
300
|
+
raw: file
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
try {
|
|
304
|
+
const base64 = await fileToBase64(file)
|
|
305
|
+
uploadedFiles.value.push({
|
|
306
|
+
type: 'image',
|
|
307
|
+
base64,
|
|
308
|
+
mimeType: file.type,
|
|
309
|
+
filename: file.name
|
|
310
|
+
})
|
|
311
|
+
} catch (e) {
|
|
312
|
+
console.error('Failed to read file:', file.name, e)
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// 移除文件
|
|
318
|
+
const removeFile = (index: number) => {
|
|
319
|
+
const file = fileList.value[index]
|
|
320
|
+
if (file) {
|
|
321
|
+
URL.revokeObjectURL(file.url)
|
|
322
|
+
fileList.value.splice(index, 1)
|
|
323
|
+
uploadedFiles.value.splice(index, 1)
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const generate = async () => {
|
|
328
|
+
if (!form.value.channel) {
|
|
329
|
+
message.warning('请选择渠道')
|
|
330
|
+
return
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
generating.value = true
|
|
334
|
+
result.value = null
|
|
335
|
+
|
|
336
|
+
try {
|
|
337
|
+
const params: any = {
|
|
338
|
+
channelId: form.value.channel,
|
|
339
|
+
prompt: form.value.prompt || '',
|
|
340
|
+
parameters: { ...form.value.parameters }
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// 添加文件
|
|
344
|
+
if (uploadedFiles.value.length > 0) {
|
|
345
|
+
params.files = uploadedFiles.value
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (presetId.value) {
|
|
349
|
+
const preset = presets.value.find(p => p.id === presetId.value)
|
|
350
|
+
if (preset) {
|
|
351
|
+
params.parameters.preset = preset.name
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const res = await generateApi.generate(params)
|
|
356
|
+
result.value = res
|
|
357
|
+
|
|
358
|
+
// 生成成功后刷新历史画廊,并获取最终提示词
|
|
359
|
+
if (res.success) {
|
|
360
|
+
historyGalleryRef.value?.refresh()
|
|
361
|
+
// 获取任务详情以获得最终提示词
|
|
362
|
+
if (res.taskId) {
|
|
363
|
+
try {
|
|
364
|
+
const task = await taskApi.get(res.taskId)
|
|
365
|
+
// 优先使用预设中间件处理后的最终提示词
|
|
366
|
+
lightboxPrompt.value = (task.middlewareLogs as any)?.preset?.transformedPrompt
|
|
367
|
+
|| task.requestSnapshot?.prompt
|
|
368
|
+
|| ''
|
|
369
|
+
} catch {
|
|
370
|
+
// 如果获取失败,使用输入的提示词
|
|
371
|
+
lightboxPrompt.value = form.value.prompt
|
|
372
|
+
}
|
|
373
|
+
} else {
|
|
374
|
+
lightboxPrompt.value = form.value.prompt
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
} catch (e) {
|
|
378
|
+
result.value = { success: false, error: '请求失败' }
|
|
379
|
+
} finally {
|
|
380
|
+
generating.value = false
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// 处理历史记录选择(点击历史任务时填充提示词)
|
|
385
|
+
const handleHistorySelect = (task: { prompt: string }) => {
|
|
386
|
+
if (task.prompt) {
|
|
387
|
+
form.value.prompt = task.prompt
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
onMounted(() => {
|
|
392
|
+
fetchData()
|
|
393
|
+
})
|
|
394
|
+
</script>
|
|
395
|
+
|
|
396
|
+
<style scoped>
|
|
397
|
+
.view-container {
|
|
398
|
+
height: 100%;
|
|
399
|
+
display: flex;
|
|
400
|
+
flex-direction: column;
|
|
401
|
+
min-height: 0;
|
|
402
|
+
overflow: hidden;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.view-content {
|
|
406
|
+
flex: 1 1 0;
|
|
407
|
+
min-height: 0;
|
|
408
|
+
overflow: hidden;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.generate-layout {
|
|
412
|
+
display: flex;
|
|
413
|
+
gap: 20px;
|
|
414
|
+
height: 100%;
|
|
415
|
+
min-height: 0;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.config-panel {
|
|
419
|
+
width: 380px;
|
|
420
|
+
flex-shrink: 0;
|
|
421
|
+
display: flex;
|
|
422
|
+
flex-direction: column;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.config-card {
|
|
426
|
+
padding: 1.5rem;
|
|
427
|
+
height: 100%;
|
|
428
|
+
overflow-y: auto;
|
|
429
|
+
display: flex;
|
|
430
|
+
flex-direction: column;
|
|
431
|
+
border-radius: 12px;
|
|
432
|
+
background-color: var(--k-card-bg);
|
|
433
|
+
border: 1px solid transparent;
|
|
434
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
435
|
+
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.config-card:hover {
|
|
439
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* Scrollbar styling for config card */
|
|
443
|
+
.config-card::-webkit-scrollbar {
|
|
444
|
+
width: 6px;
|
|
445
|
+
}
|
|
446
|
+
.config-card::-webkit-scrollbar-track {
|
|
447
|
+
background: transparent;
|
|
448
|
+
}
|
|
449
|
+
.config-card::-webkit-scrollbar-thumb {
|
|
450
|
+
background-color: var(--k-color-border);
|
|
451
|
+
border-radius: 3px;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
.form-section {
|
|
455
|
+
margin-bottom: 1.5rem;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.form-section.flex-grow {
|
|
459
|
+
flex-grow: 1;
|
|
460
|
+
display: flex;
|
|
461
|
+
flex-direction: column;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.form-section.flex-grow :deep(.el-textarea) {
|
|
465
|
+
flex-grow: 1;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.form-section.flex-grow :deep(.el-textarea__inner) {
|
|
469
|
+
height: 100% !important;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
.section-title {
|
|
473
|
+
font-weight: 600;
|
|
474
|
+
margin-bottom: 0.75rem;
|
|
475
|
+
color: var(--k-color-text);
|
|
476
|
+
font-size: 0.95rem;
|
|
477
|
+
display: flex;
|
|
478
|
+
align-items: center;
|
|
479
|
+
gap: 0.5rem;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.section-title .k-icon {
|
|
483
|
+
color: var(--k-color-active);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.form-item {
|
|
487
|
+
margin-bottom: 1rem;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.label {
|
|
491
|
+
font-size: 0.85rem;
|
|
492
|
+
color: var(--k-color-text-description);
|
|
493
|
+
margin-bottom: 0.35rem;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.form-actions {
|
|
497
|
+
margin-top: 1.5rem;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.generate-btn {
|
|
501
|
+
width: 100%;
|
|
502
|
+
height: 44px;
|
|
503
|
+
font-size: 1rem;
|
|
504
|
+
font-weight: 600;
|
|
505
|
+
transition: all 0.2s;
|
|
506
|
+
background: linear-gradient(135deg, var(--k-color-primary) 0%, var(--k-color-primary-dark, var(--k-color-primary)) 100%);
|
|
507
|
+
border: none;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
.generate-btn:not(:disabled):hover {
|
|
511
|
+
transform: translateY(-2px);
|
|
512
|
+
box-shadow: 0 6px 16px rgba(var(--k-color-primary-rgb), 0.4);
|
|
513
|
+
filter: brightness(1.1);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
.preview-panel {
|
|
517
|
+
flex-grow: 1;
|
|
518
|
+
background-color: var(--k-color-bg-2);
|
|
519
|
+
border-radius: 12px;
|
|
520
|
+
border: 1px dashed var(--k-color-border);
|
|
521
|
+
display: flex;
|
|
522
|
+
flex-direction: column;
|
|
523
|
+
align-items: center;
|
|
524
|
+
justify-content: center;
|
|
525
|
+
padding: 2rem;
|
|
526
|
+
position: relative;
|
|
527
|
+
overflow-y: auto;
|
|
528
|
+
transition: background-color 0.3s;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.preview-panel:hover {
|
|
532
|
+
background-color: var(--k-color-bg-1);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/* States */
|
|
536
|
+
.empty-state, .generating-state {
|
|
537
|
+
text-align: center;
|
|
538
|
+
color: var(--k-color-text-description);
|
|
539
|
+
display: flex;
|
|
540
|
+
flex-direction: column;
|
|
541
|
+
align-items: center;
|
|
542
|
+
justify-content: center;
|
|
543
|
+
height: 100%;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
.empty-icon {
|
|
547
|
+
font-size: 5rem;
|
|
548
|
+
margin-bottom: 1.5rem;
|
|
549
|
+
opacity: 0.2;
|
|
550
|
+
color: var(--k-color-text);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.loader {
|
|
554
|
+
border: 4px solid var(--k-color-bg-2);
|
|
555
|
+
border-top: 4px solid var(--k-color-active);
|
|
556
|
+
border-radius: 50%;
|
|
557
|
+
width: 40px;
|
|
558
|
+
height: 40px;
|
|
559
|
+
animation: spin 1s linear infinite;
|
|
560
|
+
margin: 0 auto 1rem;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
@keyframes spin {
|
|
564
|
+
0% { transform: rotate(0deg); }
|
|
565
|
+
100% { transform: rotate(360deg); }
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/* Result */
|
|
569
|
+
.result-container {
|
|
570
|
+
width: 100%;
|
|
571
|
+
height: 100%;
|
|
572
|
+
display: flex;
|
|
573
|
+
flex-direction: column;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.success-result {
|
|
577
|
+
flex-grow: 1;
|
|
578
|
+
display: flex;
|
|
579
|
+
flex-direction: column;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.output-grid {
|
|
583
|
+
display: grid;
|
|
584
|
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
585
|
+
gap: 1.5rem;
|
|
586
|
+
flex-grow: 1;
|
|
587
|
+
align-content: start;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.output-wrapper {
|
|
591
|
+
position: relative;
|
|
592
|
+
border-radius: 12px;
|
|
593
|
+
overflow: hidden;
|
|
594
|
+
border: 1px solid var(--k-color-border);
|
|
595
|
+
background-color: var(--k-card-bg);
|
|
596
|
+
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
597
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.output-wrapper:hover {
|
|
601
|
+
transform: translateY(-4px);
|
|
602
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
603
|
+
border-color: transparent;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
.output-wrapper img {
|
|
607
|
+
width: 100%;
|
|
608
|
+
height: 100%;
|
|
609
|
+
object-fit: contain;
|
|
610
|
+
display: block;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.output-wrapper img.clickable-image {
|
|
614
|
+
cursor: zoom-in;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.output-wrapper video,
|
|
618
|
+
.output-wrapper audio {
|
|
619
|
+
width: 100%;
|
|
620
|
+
display: block;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.output-actions {
|
|
624
|
+
position: absolute;
|
|
625
|
+
bottom: 0;
|
|
626
|
+
left: 0;
|
|
627
|
+
right: 0;
|
|
628
|
+
padding: 0.5rem;
|
|
629
|
+
background: rgba(0,0,0,0.5);
|
|
630
|
+
display: flex;
|
|
631
|
+
justify-content: flex-end;
|
|
632
|
+
opacity: 0;
|
|
633
|
+
transition: opacity 0.2s;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.output-wrapper:hover .output-actions {
|
|
637
|
+
opacity: 1;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.action-btn {
|
|
641
|
+
color: white;
|
|
642
|
+
padding: 4px;
|
|
643
|
+
cursor: pointer;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
.result-meta {
|
|
647
|
+
margin-top: 1.5rem;
|
|
648
|
+
display: flex;
|
|
649
|
+
gap: 1.5rem;
|
|
650
|
+
color: var(--k-color-text-description);
|
|
651
|
+
font-size: 0.9rem;
|
|
652
|
+
border-top: 1px solid var(--k-color-border);
|
|
653
|
+
padding-top: 1rem;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
.meta-item {
|
|
657
|
+
display: flex;
|
|
658
|
+
align-items: center;
|
|
659
|
+
gap: 0.5rem;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.error-result {
|
|
663
|
+
text-align: center;
|
|
664
|
+
color: var(--k-color-error);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.error-icon {
|
|
668
|
+
font-size: 3rem;
|
|
669
|
+
margin-bottom: 1rem;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/* Upload Area */
|
|
673
|
+
.upload-area {
|
|
674
|
+
margin-top: 0.5rem;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.upload-list {
|
|
678
|
+
display: flex;
|
|
679
|
+
flex-wrap: wrap;
|
|
680
|
+
gap: 0.5rem;
|
|
681
|
+
margin-bottom: 0.5rem;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.upload-item {
|
|
685
|
+
position: relative;
|
|
686
|
+
width: 64px;
|
|
687
|
+
height: 64px;
|
|
688
|
+
border-radius: 8px;
|
|
689
|
+
overflow: hidden;
|
|
690
|
+
border: 1px solid var(--k-color-border);
|
|
691
|
+
background-color: var(--k-color-bg-2);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.upload-thumb {
|
|
695
|
+
width: 100%;
|
|
696
|
+
height: 100%;
|
|
697
|
+
object-fit: cover;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
.upload-overlay {
|
|
701
|
+
position: absolute;
|
|
702
|
+
inset: 0;
|
|
703
|
+
background: rgba(0, 0, 0, 0.5);
|
|
704
|
+
display: flex;
|
|
705
|
+
align-items: center;
|
|
706
|
+
justify-content: center;
|
|
707
|
+
opacity: 0;
|
|
708
|
+
transition: opacity 0.2s;
|
|
709
|
+
cursor: pointer;
|
|
710
|
+
color: white;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.upload-item:hover .upload-overlay {
|
|
714
|
+
opacity: 1;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.upload-trigger {
|
|
718
|
+
width: 64px;
|
|
719
|
+
height: 64px;
|
|
720
|
+
border: 2px dashed var(--k-color-border);
|
|
721
|
+
border-radius: 8px;
|
|
722
|
+
display: flex;
|
|
723
|
+
align-items: center;
|
|
724
|
+
justify-content: center;
|
|
725
|
+
cursor: pointer;
|
|
726
|
+
transition: all 0.2s;
|
|
727
|
+
background-color: var(--k-color-bg-2);
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.upload-trigger:hover {
|
|
731
|
+
border-color: var(--k-color-active);
|
|
732
|
+
background-color: var(--k-color-bg-1);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.upload-icon {
|
|
736
|
+
font-size: 1.25rem;
|
|
737
|
+
color: var(--k-color-text-description);
|
|
738
|
+
transition: color 0.2s;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.upload-trigger:hover .upload-icon {
|
|
742
|
+
color: var(--k-color-active);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.upload-tip {
|
|
746
|
+
font-size: 0.75rem;
|
|
747
|
+
color: var(--k-color-text-description);
|
|
748
|
+
margin-top: 0.5rem;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/* Text output */
|
|
752
|
+
.text-output {
|
|
753
|
+
padding: 1rem;
|
|
754
|
+
background-color: var(--k-color-bg-2);
|
|
755
|
+
border-radius: 6px;
|
|
756
|
+
white-space: pre-wrap;
|
|
757
|
+
word-break: break-word;
|
|
758
|
+
font-family: inherit;
|
|
759
|
+
line-height: 1.6;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
/* File link */
|
|
763
|
+
.file-link {
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
gap: 0.5rem;
|
|
767
|
+
padding: 1rem;
|
|
768
|
+
background-color: var(--k-color-bg-2);
|
|
769
|
+
border-radius: 6px;
|
|
770
|
+
color: var(--k-color-active);
|
|
771
|
+
text-decoration: none;
|
|
772
|
+
transition: background-color 0.2s;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.file-link:hover {
|
|
776
|
+
background-color: var(--k-color-bg-3);
|
|
777
|
+
}
|
|
778
|
+
</style>
|