MCPcopy Create free account
hub / github.com/bytebase/bytebase / useServerState

Function useServerState

frontend/src/react/hooks/useAppState.ts:127–162  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125}
126
127export function useServerState() {
128 const serverInfo = useAppStore((state) => state.serverInfo);
129 const loadServerInfo = useAppStore((state) => state.loadServerInfo);
130 const isSaaSMode = useAppStore((state) => state.isSaaSMode());
131 const workspaceResourceName = useAppStore((state) =>
132 state.workspaceResourceName()
133 );
134 const externalUrl = useAppStore((state) => state.externalUrl());
135 const needConfigureExternalUrl = useAppStore((state) =>
136 state.needConfigureExternalUrl()
137 );
138 const version = useAppStore((state) => state.version());
139 const changelogURL = useAppStore((state) => state.changelogURL());
140 const activatedInstanceCount = useAppStore((state) =>
141 state.activatedInstanceCount()
142 );
143 const totalInstanceCount = useAppStore((state) => state.totalInstanceCount());
144 const userCountInIam = useAppStore((state) => state.userCountInIam());
145 const activeVcsUserCount = useAppStore((state) => state.activeVcsUserCount());
146 useEffect(() => {
147 void loadServerInfo();
148 }, [loadServerInfo]);
149 return {
150 serverInfo,
151 isSaaSMode,
152 workspaceResourceName,
153 externalUrl,
154 needConfigureExternalUrl,
155 version,
156 changelogURL,
157 activatedInstanceCount,
158 totalInstanceCount,
159 userCountInIam,
160 activeVcsUserCount,
161 };
162}
163
164export function useWorkspaceResourceName() {
165 return useServerState().workspaceResourceName;

Callers 14

FeatureAttentionFunction · 0.90
InstanceAssignmentSheetFunction · 0.90
BannersWrapperFunction · 0.90
CredentialSourceFormFunction · 0.90
MCPPageFunction · 0.90
SubscriptionPageFunction · 0.90
useFullQuickLinkListFunction · 0.90
LandingPageFunction · 0.90
AccountSection.tsxFile · 0.90
GeneralSection.tsxFile · 0.90
GeneralPageFunction · 0.90

Calls 1

useAppStoreFunction · 0.50

Tested by

no test coverage detected