MCPcopy Index your code
hub / github.com/dataease/SQLBot / loadXpackStatic

Function loadXpackStatic

frontend/src/router/watch.ts:80–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 return wsAdminRouterList.some((item: string) => to?.path?.startsWith(item))
79}
80const loadXpackStatic = () => {
81 if (document.getElementById('sqlbot_xpack_static')) {
82 return Promise.resolve()
83 }
84 const url = `/xpack_static/license-generator.umd.js?t=${Date.now()}`
85 return new Promise((resolve, reject) => {
86 request
87 .loadRemoteScript(url, 'sqlbot_xpack_static', () => {
88 LicenseGenerator?.init(import.meta.env.VITE_API_BASE_URL).then(() => {
89 resolve(true)
90 })
91 })
92 .catch((error) => {
93 console.error('Failed to load xpack_static script:', error)
94 ElMessage.error('Failed to load license generator script')
95 reject(error)
96 })
97 })
98}

Callers 1

watchRouterFunction · 0.85

Calls 6

resolveFunction · 0.85
resolveMethod · 0.80
loadRemoteScriptMethod · 0.80
errorMethod · 0.80
initMethod · 0.65
thenMethod · 0.45

Tested by

no test coverage detected