()
| 125 | } |
| 126 | |
| 127 | export 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 | |
| 164 | export function useWorkspaceResourceName() { |
| 165 | return useServerState().workspaceResourceName; |
no test coverage detected