refactor(desktop): organize lib modules by domain

This commit is contained in:
t8y2 committed 2026-07-04 13:53:52 +08:00
1 parent 90f0594e93
commit 7e7c4944e9
700 files changed
+1292 -1264

No files matched your search

@@ -1,8 +1,8 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { ref, watch, onMounted, onUnmounted } from "vue";
import type { ClusterInfo } from "@/types/mq";
import { mqGetClusterInfo } from "@/lib/api";
import { mqGetClusterInfo } from "@/lib/backend/api";
interface Props {
connectionId: string;
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, ref, watch, onMounted, onUnmounted } from "vue";
import { use } from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
@@ -8,7 +8,7 @@ import { GridComponent, LegendComponent, TooltipComponent } from "echarts/compon
import VChart from "vue-echarts";
import { Activity, AlertTriangle, BarChart3, Boxes, CheckCircle2, Database, Download, Gauge, Hash, HardDrive, Layers3, Loader2, Package, RadioTower, RefreshCw, Send, ShieldCheck, Table2, Upload, Users } from "@lucide/vue";
import type { TopicRef, TopicInfo, TopicStats, BacklogStats } from "@/types/mq";
import { mqGetTopicStats, mqGetBacklog } from "@/lib/api";
import { mqGetTopicStats, mqGetBacklog } from "@/lib/backend/api";
use([CanvasRenderer, LineChart, GridComponent, LegendComponent, TooltipComponent]);
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { ref, computed, onMounted, watch } from "vue";
import type { MqClusterInfo, TopicInfo } from "@/types/mq";
import { mqTestConnection } from "@/lib/api";
import { mqTestConnection } from "@/lib/backend/api";
import { useConnectionStore } from "@/stores/connectionStore";
import { mqClusterOptionsFromExtra } from "@/lib/mqTenantForm";
import { mqClusterOptionsFromExtra } from "@/lib/mq/mqTenantForm";
import TenantsPanel from "./TenantsPanel.vue";
import NamespacesPanel from "./NamespacesPanel.vue";
import TopicsPanel from "./TopicsPanel.vue";
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { ref, watch } from "vue";
import type { NamespaceRef, NamespaceInfo, NamespaceConfig } from "@/types/mq";
import { mqListNamespaces, mqCreateNamespace, mqDeleteNamespace } from "@/lib/api";
import { mqListNamespaces, mqCreateNamespace, mqDeleteNamespace } from "@/lib/backend/api";
interface Props {
connectionId: string;
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, nextTick, ref, watch } from "vue";
import type { AuthAction, MqIssuedToken, MqTokenRecord, PermissionMap, PolicyScope, TopicInfo } from "@/types/mq";
import { mqGrantPermission, mqIssueToken, mqListPermissions, mqListTokenRecords, mqRevokePermission } from "@/lib/api";
import { formatMqTokenIssueError, type MqTokenIssueErrorView } from "@/lib/mqTokenErrors";
import { mqGrantPermission, mqIssueToken, mqListPermissions, mqListTokenRecords, mqRevokePermission } from "@/lib/backend/api";
import { formatMqTokenIssueError, type MqTokenIssueErrorView } from "@/lib/mq/mqTokenErrors";
interface Props {
connectionId: string;
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, ref, watch } from "vue";
import type { BacklogQuota, DispatchRate, PolicyScope, PublishRate, RetentionPolicy, SubscribeRate, TopicInfo } from "@/types/mq";
import { mqGetEffectivePolicies, mqSetBacklogQuota, mqSetDispatchRate, mqSetPublishRate, mqSetRetention, mqSetSubscribeRate } from "@/lib/api";
import { defaultMqPolicyForms, policyFormsFromEffectivePolicies } from "@/lib/mqPolicyForms";
import { mqGetEffectivePolicies, mqSetBacklogQuota, mqSetDispatchRate, mqSetPublishRate, mqSetRetention, mqSetSubscribeRate } from "@/lib/backend/api";
import { defaultMqPolicyForms, policyFormsFromEffectivePolicies } from "@/lib/mq/mqPolicyForms";
interface Props {
connectionId: string;
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, ref, watch } from "vue";
import type { ConsumerInfo, ProducerInfo, SubscriptionInfo, TopicInfo, TopicRef, TopicStats } from "@/types/mq";
import { mqGetTopicStats, mqListConsumers, mqListProducers, mqListSubscriptions, mqUnloadTopic } from "@/lib/api";
import { mqGetTopicStats, mqListConsumers, mqListProducers, mqListSubscriptions, mqUnloadTopic } from "@/lib/backend/api";
interface Props {
connectionId: string;
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, ref } from "vue";
import type { MqRawResponse, TopicInfo } from "@/types/mq";
import { mqRawRequest } from "@/lib/api";
import { mqRawRequest } from "@/lib/backend/api";
interface Props {
connectionId: string;
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed, onUnmounted, ref, watch } from "vue";
import type { PeekedMessage, TopicInfo, TopicRef, SendMessageRequest, SendMessageResponse } from "@/types/mq";
import { mqSendMessage, mqListTopics, mqPeekMessages } from "@/lib/api";
import { formatError } from "@/lib/errorUtils";
import { mqSendMessage, mqListTopics, mqPeekMessages } from "@/lib/backend/api";
import { formatError } from "@/lib/backend/errorUtils";
interface Props {
connectionId: string;
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { ref, watch } from "vue";
import type { TopicRef, TopicInfo, SubscriptionInfo, ResetPosition, SkipCount, PeekedMessage } from "@/types/mq";
import { mqListSubscriptions, mqCreateSubscription, mqDeleteSubscription, mqResetCursor, mqSkipMessages, mqClearBacklog, mqPeekMessages, mqExpireMessages } from "@/lib/api";
import { mqListSubscriptions, mqCreateSubscription, mqDeleteSubscription, mqResetCursor, mqSkipMessages, mqClearBacklog, mqPeekMessages, mqExpireMessages } from "@/lib/backend/api";
interface Props {
connectionId: string;
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { formatError } from "@/lib/errorUtils";
import { formatError } from "@/lib/backend/errorUtils";
import { computed, ref, onBeforeUnmount, onMounted, watch } from "vue";
import type { TenantInfo, TenantConfig } from "@/types/mq";
import { mqListTenants, mqCreateTenant, mqUpdateTenant, mqDeleteTenant } from "@/lib/api";
import { defaultTenantConfig, normalizeClusterOptions, validateTenantForm } from "@/lib/mqTenantForm";
import { mqListTenants, mqCreateTenant, mqUpdateTenant, mqDeleteTenant } from "@/lib/backend/api";
import { defaultTenantConfig, normalizeClusterOptions, validateTenantForm } from "@/lib/mq/mqTenantForm";
interface Props {
connectionId: string;
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { ref, watch, computed } from "vue";
import type { NamespaceRef, TopicRef, TopicInfo, ListTopicsOpts } from "@/types/mq";
import { mqListTopics, mqCreateTopic, mqDeleteTopic, mqUpdatePartitions } from "@/lib/api";
import { formatError } from "@/lib/errorUtils";
import { mqListTopics, mqCreateTopic, mqDeleteTopic, mqUpdatePartitions } from "@/lib/backend/api";
import { formatError } from "@/lib/backend/errorUtils";
interface Props {
connectionId: string;