@lovrabet/cli 1.3.3 → 1.3.4-beta.0
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/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -0
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +4 -1
- package/templates/README.md +10 -55
- package/lib/add-page/input-page-router.js +0 -1
- package/lib/add-page/main.js +0 -1
- package/lib/add-page/select-page-template.js +0 -1
- package/lib/utils/router-updater.js +0 -1
- package/templates/pages/blank/index.tsx.tpl +0 -13
- package/templates/pages/sdk-fetch/index.tsx.tpl +0 -80
package/lib/add-page/main.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a1_0x4b77a3=a1_0xc82b;(function(_0x366c47,_0x2657c9){const _0x20ce0e=a1_0xc82b,_0xd252d6=_0x366c47();while(!![]){try{const _0x25dc94=-parseInt(_0x20ce0e(0xc9))/0x1+-parseInt(_0x20ce0e(0xb9))/0x2*(parseInt(_0x20ce0e(0xa8))/0x3)+-parseInt(_0x20ce0e(0xc4))/0x4*(parseInt(_0x20ce0e(0xb3))/0x5)+parseInt(_0x20ce0e(0xbb))/0x6*(-parseInt(_0x20ce0e(0xca))/0x7)+-parseInt(_0x20ce0e(0xa6))/0x8+-parseInt(_0x20ce0e(0xaa))/0x9+parseInt(_0x20ce0e(0xb7))/0xa;if(_0x25dc94===_0x2657c9)break;else _0xd252d6['push'](_0xd252d6['shift']());}catch(_0x2d292e){_0xd252d6['push'](_0xd252d6['shift']());}}}(a1_0x5ac3,0x3cf14));import{jsx as a1_0x1cdb30,jsxs as a1_0x257c40,Fragment as a1_0x1dbb2e}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x5c7928 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';function a1_0xc82b(_0x478e9d,_0x1090e5){_0x478e9d=_0x478e9d-0xa3;const _0x5ac35f=a1_0x5ac3();let _0xc82baa=_0x5ac35f[_0x478e9d];return _0xc82baa;}import{TemplateReplacer}from'../utils/template-replacer.js';function a1_0x5ac3(){const _0x39591f=['join','cyan','addPage.display.routeEntered','415lrIwWG','now','setLogPath','cwd','17526540rBkzTS','finally','14ShrYyQ','error','6FfCSqg','addPage.display.route','addPage.success','addPage.display.path','message','addPage.steps.step2','processTemplate','info','../../templates/pages','6700PWFOoZ','src','gray','green','dirname','382489FpPiLV','2105047NrvWeD','页面添加成功:\x20','addPage.steps.step1','then','addPage.display.templateSelected','pages','3476824nLuiVZ','resolve','62523ncIBtT','add-page','902781OvTVkx','success','addPage.creating','addPage.successHint','column','页面添加失败:\x20'];a1_0x5ac3=function(){return _0x39591f;};return a1_0x5ac3();}import{useI18n}from'../i18n/hooks.js';const __dirname=a1_0x5c7928[a1_0x4b77a3(0xc8)](fileURLToPath(import.meta.url)),pageTemplateDir=a1_0x5c7928[a1_0x4b77a3(0xa7)](__dirname,a1_0x4b77a3(0xc3)),projectDir=process[a1_0x4b77a3(0xb6)]();export const AddPage=()=>{const _0x3d9b0b=a1_0x4b77a3,{exit:_0x374dba}=useApp(),{t:_0x3e92df}=useI18n(),[_0x12d901,_0x4c1566]=useState(''),[_0x97cf51,_0x30d95f]=useState(''),[_0x1be24c,_0x34a38f]=useState(![]),[_0x20f2d4,_0x546928]=useState(![]),_0x396606=a1_0x5c7928['join'](projectDir,'src',_0x3d9b0b(0xa5)),_0x5020ea=a1_0x5c7928[_0x3d9b0b(0xb0)](_0x396606,_0x97cf51),_0x390d0c=a1_0x5c7928[_0x3d9b0b(0xb0)](_0x3d9b0b(0xc5),_0x3d9b0b(0xa5),_0x97cf51);useEffect(()=>{const _0x3447e6=_0x3d9b0b,_0x21b889=a1_0x5c7928[_0x3447e6(0xa7)](pageTemplateDir,_0x12d901);if(_0x12d901&&_0x97cf51){_0x34a38f(!![]),logger[_0x3447e6(0xb5)](process[_0x3447e6(0xb6)]());const _0x2e3b8d=Date[_0x3447e6(0xb4)]();logger[_0x3447e6(0xc2)](_0x3447e6(0xa9),'开始添加页面:\x20'+_0x97cf51,{'template':_0x12d901,'targetPath':_0x390d0c}),TemplateReplacer[_0x3447e6(0xc1)](_0x21b889,a1_0x5c7928[_0x3447e6(0xb0)](_0x396606,_0x97cf51),_0x97cf51,_0x12d901)[_0x3447e6(0xa3)](()=>{const _0x5ec700=_0x3447e6,_0x466818=Date[_0x5ec700(0xb4)]()-_0x2e3b8d;logger[_0x5ec700(0xab)](_0x5ec700(0xa9),_0x5ec700(0xcb)+_0x97cf51,_0x466818,{'template':_0x12d901,'targetPath':_0x390d0c,'routePath':_0x97cf51}),_0x546928(!![]);})['catch'](_0x466251=>{const _0x52e607=_0x3447e6,_0x1d0fad=Date[_0x52e607(0xb4)]()-_0x2e3b8d;logger[_0x52e607(0xba)](_0x52e607(0xa9),_0x52e607(0xaf)+_0x97cf51,{'template':_0x12d901,'targetPath':_0x390d0c,'error':_0x466251 instanceof Error?_0x466251[_0x52e607(0xbf)]:String(_0x466251),'duration':_0x1d0fad});})[_0x3447e6(0xb8)](()=>{_0x34a38f(![]);});}},[_0x12d901,_0x97cf51]),useEffect(()=>{_0x20f2d4&&setTimeout(()=>{_0x374dba();});},[_0x20f2d4]);if(_0x12d901)return a1_0x257c40(Box,{'flexDirection':_0x3d9b0b(0xae),'paddingY':0x1,'children':[a1_0x257c40(Box,{'children':[a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc6),'children':_0x3e92df(_0x3d9b0b(0xcc))}),a1_0x1cdb30(Text,{'children':_0x3e92df(_0x3d9b0b(0xa4))}),a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc7),'children':_0x12d901})]}),_0x97cf51?a1_0x257c40(Box,{'children':[a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc6),'children':_0x3e92df(_0x3d9b0b(0xc0))}),a1_0x1cdb30(Text,{'children':_0x3e92df(_0x3d9b0b(0xb2))}),a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc7),'children':_0x97cf51})]}):a1_0x1cdb30(InputProjectCode,{'pagePath':_0x5020ea,'onSubmit':_0x30d95f}),_0x97cf51&&_0x1be24c?a1_0x257c40(Box,{'marginTop':0x1,'children':[a1_0x1cdb30(Box,{'width':'4'}),a1_0x1cdb30(Text,{'children':_0x3e92df(_0x3d9b0b(0xac))})]}):null,_0x20f2d4?a1_0x257c40(a1_0x1dbb2e,{'children':[a1_0x1cdb30(Box,{'marginTop':0x1,'children':a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc6),'children':_0x3e92df(_0x3d9b0b(0xbd))})}),a1_0x257c40(Box,{'children':[a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc6),'children':_0x3e92df(_0x3d9b0b(0xbe))}),a1_0x1cdb30(Text,{'color':'green','children':_0x390d0c})]}),a1_0x257c40(Box,{'children':[a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xc6),'children':_0x3e92df(_0x3d9b0b(0xbc))}),a1_0x257c40(Text,{'color':_0x3d9b0b(0xc7),'children':['/',_0x97cf51]})]}),a1_0x1cdb30(Box,{'marginTop':0x1,'children':a1_0x1cdb30(Text,{'color':_0x3d9b0b(0xb1),'children':_0x3e92df(_0x3d9b0b(0xad))})})]}):null]});return a1_0x1cdb30(SelectPageTemplate,{'onSelect':_0x4c1566});};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a2_0x33c2d0=a2_0x41d0;(function(_0x2e5b85,_0x3fcea2){const _0x42cb48=a2_0x41d0,_0x5239f8=_0x2e5b85();while(!![]){try{const _0x22b8f7=parseInt(_0x42cb48(0x1cb))/0x1+-parseInt(_0x42cb48(0x1d1))/0x2*(-parseInt(_0x42cb48(0x1c6))/0x3)+-parseInt(_0x42cb48(0x1d0))/0x4+-parseInt(_0x42cb48(0x1dd))/0x5*(-parseInt(_0x42cb48(0x1d5))/0x6)+parseInt(_0x42cb48(0x1d6))/0x7+-parseInt(_0x42cb48(0x1ce))/0x8*(-parseInt(_0x42cb48(0x1d4))/0x9)+-parseInt(_0x42cb48(0x1cd))/0xa;if(_0x22b8f7===_0x3fcea2)break;else _0x5239f8['push'](_0x5239f8['shift']());}catch(_0x5d2bad){_0x5239f8['push'](_0x5239f8['shift']());}}}(a2_0x3548,0x8bb07));function a2_0x3548(){const _0x503096=['183016iRWgrg','label','2315072nYxqQC','133526mSbSJp','sort','addPage.loading.templates','171cMxhRO','11418pCBSkh','6805225BKtqCV','dirname','bind','addPage.steps.step1','\x20\x20\x20\x20\x20\x20\x20\x20','resolve','\x20\x20\x20\x20\x20\x20>\x20','2575WenetT','localeCompare','templates/pages','addPage.select.template.title','onSelect','length','error','isDirectory','map','addPage.error.templateListFailed','name','../..','filter','48ndcCOD','downArrow','gray','column','upArrow','225950lwVzyr','return','25301060iarNXe'];a2_0x3548=function(){return _0x503096;};return a2_0x3548();}import{jsx as a2_0x4173ff,jsxs as a2_0x1f8c95}from'react/jsx-runtime';function a2_0x41d0(_0x3fa83a,_0x2a2cde){_0x3fa83a=_0x3fa83a-0x1bb;const _0x3548ee=a2_0x3548();let _0x41d040=_0x3548ee[_0x3fa83a];return _0x41d040;}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x1f02f2 from'node:path';import{fileURLToPath}from'node:url';import{useI18n}from'../i18n/hooks.js';import a2_0x5fc0b2 from'../i18n/index.js';const t=a2_0x5fc0b2['t'][a2_0x33c2d0(0x1d8)](a2_0x5fc0b2);async function getTemplateList(){const _0xc85b83=a2_0x33c2d0;try{const _0x3849d5=fileURLToPath(import.meta.url),_0x42726c=a2_0x1f02f2[_0xc85b83(0x1db)](a2_0x1f02f2[_0xc85b83(0x1d7)](_0x3849d5),_0xc85b83(0x1c4)),_0x3aea03=a2_0x1f02f2['join'](_0x42726c,_0xc85b83(0x1bb)),_0x5d632=await readdir(_0x3aea03,{'withFileTypes':!![]}),_0x363d1f=_0x5d632[_0xc85b83(0x1c5)](_0x99be9a=>_0x99be9a[_0xc85b83(0x1c0)]())[_0xc85b83(0x1c1)](_0xcac055=>({'label':_0xcac055[_0xc85b83(0x1c3)]}))[_0xc85b83(0x1d2)]((_0x134c3b,_0x57d6c7)=>_0x134c3b[_0xc85b83(0x1cf)][_0xc85b83(0x1de)](_0x57d6c7[_0xc85b83(0x1cf)]));return _0x363d1f;}catch(_0x3b4907){return console[_0xc85b83(0x1bf)](t(_0xc85b83(0x1c2)),_0x3b4907),[{'label':'blank'},{'label':'sdk-fetch'}];}}export function SelectPageTemplate(_0x311726){const _0x1de4cb=a2_0x33c2d0,{t:_0x5366fa}=useI18n(),[_0x190ebd,_0x3e9b37]=useState(0x0),[_0x1b7bb5,_0x27d654]=useState([]),[_0x4efc46,_0x565ff6]=useState(!![]);useEffect(()=>{async function _0x24a76a(){const _0x3bc3e6=await getTemplateList();_0x27d654(_0x3bc3e6),_0x565ff6(![]);}_0x24a76a();},[]),useInput((_0xfcfcd6,_0x4dae08)=>{const _0x54fcab=a2_0x41d0;if(_0x4efc46)return;if(_0x4dae08[_0x54fcab(0x1cc)]){const _0x161fa4=_0x1b7bb5[_0x190ebd];_0x161fa4&&_0x311726[_0x54fcab(0x1bd)](_0x161fa4[_0x54fcab(0x1cf)]);}_0x4dae08[_0x54fcab(0x1ca)]&&_0x3e9b37(_0xe8de2d=>_0xe8de2d===0x0?_0x1b7bb5[_0x54fcab(0x1be)]-0x1:_0xe8de2d-0x1),_0x4dae08[_0x54fcab(0x1c7)]&&_0x3e9b37(_0x5c8b1f=>_0x5c8b1f===_0x1b7bb5[_0x54fcab(0x1be)]-0x1?0x0:_0x5c8b1f+0x1);});if(_0x4efc46)return a2_0x4173ff(Box,{'flexDirection':_0x1de4cb(0x1c9),'paddingY':0x1,'children':a2_0x1f8c95(Box,{'children':[a2_0x4173ff(Text,{'color':'gray','children':_0x5366fa(_0x1de4cb(0x1d9))}),a2_0x4173ff(Text,{'children':_0x5366fa(_0x1de4cb(0x1d3))})]})});return a2_0x1f8c95(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x1f8c95(Box,{'children':[a2_0x4173ff(Text,{'color':_0x1de4cb(0x1c8),'children':_0x5366fa(_0x1de4cb(0x1d9))}),a2_0x4173ff(Text,{'children':_0x5366fa(_0x1de4cb(0x1bc))})]}),_0x1b7bb5[_0x1de4cb(0x1c1)]((_0x26f12c,_0x449750)=>{const _0x48d5cf=_0x1de4cb,_0x2c1caa=_0x449750===_0x190ebd,_0x3f104f=_0x2c1caa?_0x48d5cf(0x1dc)+_0x26f12c[_0x48d5cf(0x1cf)]:_0x48d5cf(0x1da)+_0x26f12c[_0x48d5cf(0x1cf)];return a2_0x4173ff(Box,{'children':a2_0x4173ff(Text,{'color':_0x2c1caa?'green':undefined,'children':_0x3f104f})},_0x3f104f);})]});}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a83_0x56eb(_0x212c13,_0x1e816d){_0x212c13=_0x212c13-0x1ec;const _0x2f0ba4=a83_0x2f0b();let _0x56eb4f=_0x2f0ba4[_0x212c13];return _0x56eb4f;}function a83_0x2f0b(){const _0x3bf121=['addPageRoute','path:\x20\x22','4514496UKUkXI','success','split','indexOf','map','index','lastIndexOf','\x20from\x20\x22../pages/','3qFvGiG','writeFile','4951062vRbtlp','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','match','路由文件不存在:\x20','25022630VyWjLP','router','includes','路由配置更新完成','charAt','error','info','previewChanges','toComponentName','src','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','771146BzfZEm','开始更新路由配置','3553890kExsBv','addRoute','length','routerFilePath','4mpKKqL','join','readFile','143507TyyXlL','now','existsSync','371889hxlOMj','import\x20','slice','路由配置更新失败','6GKXpbY','toLowerCase','toUpperCase','message','utf8','addImport'];a83_0x2f0b=function(){return _0x3bf121;};return a83_0x2f0b();}const a83_0x2680c8=a83_0x56eb;(function(_0x1d3f46,_0x5cc71c){const _0x4a862c=a83_0x56eb,_0x42348f=_0x1d3f46();while(!![]){try{const _0x4c235e=parseInt(_0x4a862c(0x1fd))/0x1+parseInt(_0x4a862c(0x1f4))/0x2*(-parseInt(_0x4a862c(0x214))/0x3)+parseInt(_0x4a862c(0x1fa))/0x4*(-parseInt(_0x4a862c(0x1f6))/0x5)+-parseInt(_0x4a862c(0x204))/0x6*(-parseInt(_0x4a862c(0x200))/0x7)+-parseInt(_0x4a862c(0x20c))/0x8+-parseInt(_0x4a862c(0x216))/0x9+parseInt(_0x4a862c(0x21a))/0xa;if(_0x4c235e===_0x5cc71c)break;else _0x42348f['push'](_0x42348f['shift']());}catch(_0x4957f7){_0x42348f['push'](_0x42348f['shift']());}}}(a83_0x2f0b,0x772b4));import a83_0x288469 from'node:fs';import a83_0x34e871 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a83_0x2680c8(0x1f9)];constructor(_0x347441){const _0x1a5b75=a83_0x2680c8;this[_0x1a5b75(0x1f9)]=a83_0x34e871[_0x1a5b75(0x1fb)](_0x347441,_0x1a5b75(0x1f2),_0x1a5b75(0x21b),'index.tsx');}async[a83_0x2680c8(0x20a)](_0x4bc333,_0x5aa689){const _0x28efb7=a83_0x2680c8;if(!a83_0x288469[_0x28efb7(0x1ff)](this[_0x28efb7(0x1f9)]))throw new Error('路由文件不存在:\x20'+this[_0x28efb7(0x1f9)]);const _0x332d04=Date[_0x28efb7(0x1fe)]();logger[_0x28efb7(0x1ef)](_0x28efb7(0x21b),_0x28efb7(0x1f5),{'pageName':_0x4bc333,'routePath':_0x5aa689,'file':this[_0x28efb7(0x1f9)]});try{const _0xe6f719=await a83_0x288469['promises'][_0x28efb7(0x1fc)](this[_0x28efb7(0x1f9)],_0x28efb7(0x208)),_0x334f3f=this[_0x28efb7(0x1f1)](_0x4bc333),_0x5b90b1=this[_0x28efb7(0x209)](_0xe6f719,_0x334f3f,_0x4bc333),_0x1a3be8=this[_0x28efb7(0x1f7)](_0x5b90b1,_0x5aa689,_0x334f3f);await a83_0x288469['promises'][_0x28efb7(0x215)](this[_0x28efb7(0x1f9)],_0x1a3be8,_0x28efb7(0x208));const _0x3becb7=Date[_0x28efb7(0x1fe)]()-_0x332d04;logger[_0x28efb7(0x20d)](_0x28efb7(0x21b),_0x28efb7(0x1ec),_0x3becb7,{'pageName':_0x4bc333,'routePath':_0x5aa689,'componentName':_0x334f3f});}catch(_0x572655){const _0x3aab99=Date[_0x28efb7(0x1fe)]()-_0x332d04;logger[_0x28efb7(0x1ee)](_0x28efb7(0x21b),_0x28efb7(0x203),{'pageName':_0x4bc333,'routePath':_0x5aa689,'error':_0x572655 instanceof Error?_0x572655[_0x28efb7(0x207)]:String(_0x572655),'duration':_0x3aab99});throw _0x572655;}}['toComponentName'](_0xb145de){const _0x33e1e6=a83_0x2680c8;return _0xb145de[_0x33e1e6(0x20e)]('-')[_0x33e1e6(0x210)](_0x3d3e42=>_0x3d3e42[_0x33e1e6(0x1ed)](0x0)[_0x33e1e6(0x206)]()+_0x3d3e42['slice'](0x1)[_0x33e1e6(0x205)]())[_0x33e1e6(0x1fb)]('');}[a83_0x2680c8(0x209)](_0x4cd345,_0x270b3d,_0x144499){const _0x2e2ebf=a83_0x2680c8,_0x3c6297=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x32179a=_0x4cd345[_0x2e2ebf(0x218)](_0x3c6297)||[],_0x2b8c96=_0x2e2ebf(0x201)+_0x270b3d+_0x2e2ebf(0x213)+_0x144499+'\x22;';if(_0x4cd345[_0x2e2ebf(0x21c)](_0x2b8c96))return _0x4cd345;if(_0x32179a[_0x2e2ebf(0x1f8)]>0x0){const _0x1e375d=_0x32179a[_0x32179a[_0x2e2ebf(0x1f8)]-0x1];if(_0x1e375d){const _0x5eabef=_0x4cd345['lastIndexOf'](_0x1e375d),_0x52b36c=_0x5eabef+_0x1e375d[_0x2e2ebf(0x1f8)];return _0x4cd345['slice'](0x0,_0x52b36c)+_0x2b8c96+'\x0a'+_0x4cd345[_0x2e2ebf(0x202)](_0x52b36c);}}const _0x3b8cf2=_0x4cd345[_0x2e2ebf(0x218)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x3b8cf2&&_0x3b8cf2['index']!==undefined){const _0x33c653=_0x3b8cf2['index']+_0x3b8cf2[0x0][_0x2e2ebf(0x1f8)];return _0x4cd345['slice'](0x0,_0x33c653)+_0x2b8c96+'\x0a'+_0x4cd345['slice'](_0x33c653);}return _0x4cd345;}['addRoute'](_0x4d48a3,_0x4ddea2,_0x18bd85){const _0x56240b=a83_0x2680c8,_0x471fe1=_0x56240b(0x1f3)+_0x4ddea2+_0x56240b(0x217)+_0x18bd85+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x4d48a3[_0x56240b(0x21c)](_0x56240b(0x20b)+_0x4ddea2+'\x22'))return _0x4d48a3;const _0x5d3449=/children:\s*\[([\s\S]*?)\]/,_0x870d86=_0x4d48a3[_0x56240b(0x218)](_0x5d3449);if(!_0x870d86||_0x870d86['index']===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x23b177=_0x870d86[0x1],_0x516bd0=_0x870d86[_0x56240b(0x211)]+_0x870d86[0x0][_0x56240b(0x20f)]('[')+0x1,_0x15dd83=_0x23b177?.[_0x56240b(0x218)](/\{[\s\S]*?\},/g)||[];if(_0x15dd83[_0x56240b(0x1f8)]>0x0){const _0x20d6e4=_0x15dd83[_0x15dd83[_0x56240b(0x1f8)]-0x1];if(_0x20d6e4){const _0x53fafa=_0x4d48a3[_0x56240b(0x212)](_0x20d6e4),_0x9e22fa=_0x53fafa+_0x20d6e4[_0x56240b(0x1f8)];return _0x4d48a3['slice'](0x0,_0x9e22fa)+'\x0a'+_0x471fe1+_0x4d48a3['slice'](_0x9e22fa);}}return _0x4d48a3[_0x56240b(0x202)](0x0,_0x516bd0)+'\x0a'+_0x471fe1+_0x4d48a3[_0x56240b(0x202)](_0x516bd0);}async[a83_0x2680c8(0x1f0)](_0x3e8167,_0x4f3314){const _0x20ccd6=a83_0x2680c8;if(!a83_0x288469[_0x20ccd6(0x1ff)](this[_0x20ccd6(0x1f9)]))throw new Error(_0x20ccd6(0x219)+this['routerFilePath']);const _0x342282=await a83_0x288469['promises'][_0x20ccd6(0x1fc)](this[_0x20ccd6(0x1f9)],_0x20ccd6(0x208)),_0x746d90=this[_0x20ccd6(0x1f1)](_0x3e8167);let _0x4da995=this[_0x20ccd6(0x209)](_0x342282,_0x746d90,_0x3e8167);return _0x4da995=this[_0x20ccd6(0x1f7)](_0x4da995,_0x4f3314,_0x746d90),_0x4da995;}}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by Lovrabet CLI v{CliVersion}
|
|
3
|
-
* Created: {CreatedAt}
|
|
4
|
-
* Page: {PageName}
|
|
5
|
-
* Title: {ComponentName}
|
|
6
|
-
*/
|
|
7
|
-
import React from "react";
|
|
8
|
-
|
|
9
|
-
function {ComponentName}() {
|
|
10
|
-
return <div style={{ padding: "24px" }}>{DisplayTitle} 页面</div>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default {ComponentName};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by Lovrabet CLI v{CliVersion}
|
|
3
|
-
* Created: {CreatedAt}
|
|
4
|
-
* Page: {PageName}
|
|
5
|
-
* Title: {ComponentName}
|
|
6
|
-
*/
|
|
7
|
-
import React, { useState } from "react";
|
|
8
|
-
import { Button, Typography, Table, message } from "antd";
|
|
9
|
-
import { ApiOutlined } from "@ant-design/icons";
|
|
10
|
-
import { lovrabetClient } from "../../api/client";
|
|
11
|
-
import { SortOrder } from "@lovrabet/sdk";
|
|
12
|
-
|
|
13
|
-
const { Title, Paragraph, Text } = Typography;
|
|
14
|
-
|
|
15
|
-
function {ComponentName}() {
|
|
16
|
-
const [loading, setLoading] = useState(false);
|
|
17
|
-
const [data, setData] = useState<any>({});
|
|
18
|
-
const [columns, setColumns] = useState<any[]>([]);
|
|
19
|
-
|
|
20
|
-
// SDK 调用示例
|
|
21
|
-
const fetchData = async () => {
|
|
22
|
-
setLoading(true);
|
|
23
|
-
try {
|
|
24
|
-
// 动态获取第一个模型,请以实际业务诉求自行修改
|
|
25
|
-
const firstModel = lovrabetClient.getModel(0);
|
|
26
|
-
const data = await firstModel.getList(
|
|
27
|
-
{
|
|
28
|
-
currentPage: 1,
|
|
29
|
-
pageSize: 10,
|
|
30
|
-
},
|
|
31
|
-
// 排序,请以实际业务字段自行修改
|
|
32
|
-
[{ id: SortOrder.ASC }],
|
|
33
|
-
);
|
|
34
|
-
processResponse(data, "获取数据成功");
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("获取数据失败:", error);
|
|
37
|
-
} finally {
|
|
38
|
-
setLoading(false);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* 处理响应数据
|
|
43
|
-
*/
|
|
44
|
-
const processResponse = (response: any, successMessage: string) => {
|
|
45
|
-
// 处理返回的数据
|
|
46
|
-
setData(response.tableData || []);
|
|
47
|
-
|
|
48
|
-
// 动态生成表格列
|
|
49
|
-
if (response.tableColumns) {
|
|
50
|
-
const tableColumns = response.tableColumns.map((column: any) => ({
|
|
51
|
-
title: column.title || column.dataIndex,
|
|
52
|
-
dataIndex: column.dataIndex,
|
|
53
|
-
key: column.dataIndex,
|
|
54
|
-
}));
|
|
55
|
-
setColumns(tableColumns);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
message.success(successMessage);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<div style={{ padding: "24px" }}>
|
|
63
|
-
<Title level={2}>
|
|
64
|
-
<ApiOutlined /> Fetch Data - {PageName}
|
|
65
|
-
</Title>
|
|
66
|
-
<Paragraph style={{ color: "#666", marginBottom: 24 }}>
|
|
67
|
-
使用 lovrabetClient 调用 SDK 的示例页面
|
|
68
|
-
</Paragraph>
|
|
69
|
-
|
|
70
|
-
<p>
|
|
71
|
-
<Button onClick={fetchData} type="primary">
|
|
72
|
-
Fetch Data
|
|
73
|
-
</Button>
|
|
74
|
-
</p>
|
|
75
|
-
{data.length > 0 && <Table dataSource={data} columns={columns} />}
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export default {ComponentName};
|