create-lupine 1.2.0 → 1.3.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/README.md +13 -7
- package/index.js +232 -108
- package/package.json +1 -1
- package/templates/common/.agents/skills/lupine-framework/SKILL.md +3 -3
- package/templates/common/.agents/skills/lupine-framework/references/backend-api.md +16 -1
- package/templates/common/.agents/skills/lupine-framework/references/icon-handling.md +1 -1
- package/templates/common/.agents/skills/lupine-framework/references/mobile-interactions.md +17 -88
- package/templates/common/.agents/skills/lupine-framework/references/native-apps.md +47 -24
- package/templates/common/.agents/skills/lupine-framework/references/navigation-and-routing.md +1 -0
- package/templates/common/.agents/skills/lupine-framework/references/reactivity-and-state.md +2 -2
- package/templates/common/.agents/skills/lupine-framework/references/styling-and-themes.md +3 -1
- package/templates/common/.env.mobile +4 -3
- package/templates/common/_env +8 -4
- package/templates/common/apps/server/README.md +10 -0
- package/templates/common/dev/cp-folder.js +9 -4
- package/templates/lupine-template-cv-starter/README.md +33 -1
- package/templates/lupine-template-cv-starter/app/package.json +20 -0
- package/templates/lupine-template-cv-starter/app/src/app.tsx +6 -0
- package/templates/lupine-template-cv-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-cv-starter/app/src/index.test.tsx +71 -0
- package/templates/lupine-template-cv-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-cv-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-cv-starter/lupine.json +8 -7
- package/templates/lupine-template-cv-starter/web/src/index.html +9 -2
- package/templates/lupine-template-cv-starter/web/src/index.tsx +9 -14
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.html +9 -2
- package/templates/lupine-template-cv-starter/web/src/lupine-template-cv-starter/index.tsx +4 -20
- package/templates/lupine-template-doc-starter/README.md +33 -1
- package/templates/lupine-template-doc-starter/app/package.json +20 -0
- package/templates/lupine-template-doc-starter/app/src/app.tsx +6 -0
- package/templates/lupine-template-doc-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-doc-starter/app/src/index.test.tsx +78 -0
- package/templates/lupine-template-doc-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-doc-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-doc-starter/lupine.json +8 -7
- package/templates/lupine-template-doc-starter/web/src/index.html +9 -2
- package/templates/lupine-template-doc-starter/web/src/index.tsx +9 -14
- package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.html +9 -2
- package/templates/lupine-template-doc-starter/web/src/lupine-template-doc-starter/index.tsx +4 -20
- package/templates/lupine-template-fullstack-note/README.md +83 -0
- package/templates/{lupine-template-cv-starter → lupine-template-fullstack-note}/api/package.json +2 -2
- package/templates/lupine-template-fullstack-note/api/resources/install.mysql.sql +32 -0
- package/templates/lupine-template-fullstack-note/api/resources/install.sqlite.sql +27 -0
- package/templates/lupine-template-fullstack-note/api/src/service/answer.ts +39 -0
- package/templates/lupine-template-fullstack-note/api/src/service/api.ts +52 -0
- package/templates/lupine-template-fullstack-note/api/src/service/db.ts +78 -0
- package/templates/lupine-template-fullstack-note/api/src/service/notes-api.ts +86 -0
- package/templates/lupine-template-fullstack-note/api/src/service/root-api.ts +19 -0
- package/templates/lupine-template-fullstack-note/api/src/service/user-api.ts +182 -0
- package/templates/lupine-template-fullstack-note/app/package.json +19 -0
- package/templates/lupine-template-fullstack-note/app/src/app.tsx +75 -0
- package/templates/lupine-template-fullstack-note/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-fullstack-note/app/src/index.test.tsx +373 -0
- package/templates/lupine-template-fullstack-note/app/src/index.web.tsx +20 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/components.tsx +65 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/details.tsx +38 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/discover.tsx +25 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/home.tsx +76 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/inbox.tsx +49 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/login.tsx +54 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/me.tsx +32 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/notes.tsx +128 -0
- package/templates/lupine-template-fullstack-note/app/src/pages/settings.tsx +45 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/AppMenu.tsx +44 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/api.ts +159 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/data.ts +20 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/ja.ts +80 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/locales/zh-CN.ts +80 -0
- package/templates/lupine-template-fullstack-note/app/src/shell/texts.ts +14 -0
- package/templates/lupine-template-fullstack-note/app/tsconfig.json +17 -0
- package/templates/lupine-template-fullstack-note/lupine.json +25 -0
- package/templates/lupine-template-fullstack-note/web/assets/favicon.ico +0 -0
- package/templates/{lupine-template-doc-starter/api → lupine-template-fullstack-note/web}/package.json +2 -2
- package/templates/lupine-template-fullstack-note/web/src/index.html +23 -0
- package/templates/lupine-template-fullstack-note/web/src/index.tsx +15 -0
- package/templates/lupine-template-fullstack-starter/README.md +63 -14
- package/templates/lupine-template-fullstack-starter/api/src/service/user-api.ts +11 -6
- package/templates/lupine-template-fullstack-starter/app/package.json +20 -0
- package/templates/lupine-template-fullstack-starter/app/src/app.tsx +76 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.test.tsx +276 -0
- package/templates/lupine-template-fullstack-starter/app/src/index.web.tsx +28 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/about.tsx +27 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/contact.tsx +41 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/favorite.tsx +27 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/home.tsx +63 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/login.tsx +63 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/mine.tsx +44 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/profile.tsx +58 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/register.tsx +48 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/reset-password.tsx +41 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/settings.tsx +33 -0
- package/templates/lupine-template-fullstack-starter/app/src/pages/story.tsx +46 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/api.ts +127 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/parts.tsx +100 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/stories.ts +65 -0
- package/templates/lupine-template-fullstack-starter/app/src/shell/texts.ts +79 -0
- package/templates/lupine-template-fullstack-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-fullstack-starter/lupine.json +6 -7
- package/templates/lupine-template-fullstack-starter/web/src/admin/admin-patch.tsx +34 -0
- package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/home-search-component.tsx +18 -25
- package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-card.tsx +17 -8
- package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-list.tsx +1 -2
- package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.html +1 -0
- package/templates/lupine-template-fullstack-starter/web/src/{admin_dev → admin}/index.tsx +13 -28
- package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-cfg.tsx +23 -19
- package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-edit.tsx +3 -4
- package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-item-list.tsx +2 -3
- package/templates/lupine-template-fullstack-starter/web/src/{pages → admin/pages}/admin-user.tsx +15 -20
- package/templates/lupine-template-fullstack-starter/web/src/index.html +8 -2
- package/templates/lupine-template-fullstack-starter/web/src/index.tsx +11 -150
- package/templates/lupine-template-fullstack-starter/web/src/services/fetch-data.ts +7 -25
- package/templates/lupine-template-fullstack-starter/web/src/styles/base-css.ts +0 -3
- package/templates/lupine-template-fullstack-starter/web/src/styles/theme.ts +1 -2
- package/templates/lupine-template-responsive-starter/README.md +46 -2
- package/templates/lupine-template-responsive-starter/app/package.json +19 -0
- package/templates/lupine-template-responsive-starter/app/src/app.tsx +80 -0
- package/templates/lupine-template-responsive-starter/app/src/index.native.tsx +4 -0
- package/templates/lupine-template-responsive-starter/app/src/index.test.tsx +283 -0
- package/templates/lupine-template-responsive-starter/app/src/index.web.tsx +31 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/about.tsx +23 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/finance.tsx +48 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/mine.tsx +60 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/not-found.tsx +9 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-detail.tsx +43 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-edit.tsx +45 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/note-search.tsx +62 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/notes.tsx +71 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/settings.tsx +55 -0
- package/templates/lupine-template-responsive-starter/app/src/pages/tools.tsx +112 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/icons.ts +7 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/layout.ts +18 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/locales/zh-CN.ts +89 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/menu.tsx +81 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/nav.ts +12 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/store.ts +72 -0
- package/templates/lupine-template-responsive-starter/app/src/shell/texts.ts +11 -0
- package/templates/lupine-template-responsive-starter/app/tsconfig.json +17 -0
- package/templates/lupine-template-responsive-starter/lupine.json +7 -6
- package/templates/lupine-template-responsive-starter/web/src/index.html +9 -2
- package/templates/lupine-template-responsive-starter/web/src/index.tsx +9 -25
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.html +12 -6
- package/templates/lupine-template-responsive-starter/web/src/lupine-template-responsive-starter/index.tsx +12 -22
- package/templates/common/apps/server/src/app-loader.ts +0 -4
- package/templates/lupine-template-cv-starter/api/resources/config_default.json +0 -6
- package/templates/lupine-template-cv-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-cv-starter/api/src/index.ts +0 -15
- package/templates/lupine-template-cv-starter/web/src/client-env-keys.ts +0 -5
- package/templates/lupine-template-cv-starter/web/src/styles/base-css.ts +0 -15
- package/templates/lupine-template-doc-starter/api/resources/config_default.json +0 -6
- package/templates/lupine-template-doc-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-doc-starter/api/src/index.ts +0 -15
- package/templates/lupine-template-doc-starter/api/src/resources/config_default.json +0 -6
- package/templates/lupine-template-doc-starter/api/src/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-doc-starter/web/src/client-env-keys.ts +0 -5
- package/templates/lupine-template-doc-starter/web/src/styles/base-css.ts +0 -15
- package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-about.tsx +0 -16
- package/templates/lupine-template-fullstack-starter/web/src/admin_dev/admin-patch.ts +0 -22
- package/templates/lupine-template-fullstack-starter/web/src/components/footer-menu.tsx +0 -52
- package/templates/lupine-template-fullstack-starter/web/src/components/footer.tsx +0 -15
- package/templates/lupine-template-fullstack-starter/web/src/components/header.tsx +0 -75
- package/templates/lupine-template-fullstack-starter/web/src/components/login-code-zh.tsx +0 -162
- package/templates/lupine-template-fullstack-starter/web/src/components/login-code.tsx +0 -165
- package/templates/lupine-template-fullstack-starter/web/src/components/login-zh.tsx +0 -118
- package/templates/lupine-template-fullstack-starter/web/src/components/login.tsx +0 -122
- package/templates/lupine-template-fullstack-starter/web/src/components/not-found-page.tsx +0 -12
- package/templates/lupine-template-fullstack-starter/web/src/components/register-zh.tsx +0 -161
- package/templates/lupine-template-fullstack-starter/web/src/components/register.tsx +0 -163
- package/templates/lupine-template-fullstack-starter/web/src/components/reset-password-zh.tsx +0 -166
- package/templates/lupine-template-fullstack-starter/web/src/components/reset-password.tsx +0 -177
- package/templates/lupine-template-fullstack-starter/web/src/components/user-info.tsx +0 -84
- package/templates/lupine-template-fullstack-starter/web/src/frames/admin-page-frame.tsx +0 -48
- package/templates/lupine-template-fullstack-starter/web/src/frames/frame1-page-frame.tsx +0 -61
- package/templates/lupine-template-fullstack-starter/web/src/frames/frame2-page-frame.tsx +0 -61
- package/templates/lupine-template-fullstack-starter/web/src/frames/top-frame.tsx +0 -23
- package/templates/lupine-template-fullstack-starter/web/src/frames/user-page-frame.tsx +0 -90
- package/templates/lupine-template-fullstack-starter/web/src/models/index.ts +0 -15
- package/templates/lupine-template-fullstack-starter/web/src/pages/contact.tsx +0 -105
- package/templates/lupine-template-fullstack-starter/web/src/pages/page1-page.tsx +0 -38
- package/templates/lupine-template-fullstack-starter/web/src/pages/page2-page.tsx +0 -38
- package/templates/lupine-template-fullstack-starter/web/src/pages/user-favorite-page.tsx +0 -58
- package/templates/lupine-template-fullstack-starter/web/src/pages/user-home-page.tsx +0 -27
- package/templates/lupine-template-fullstack-starter/web/src/pages/user-mine-page.tsx +0 -54
- package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page-zh.tsx +0 -112
- package/templates/lupine-template-fullstack-starter/web/src/pages/user-profile-page.tsx +0 -112
- package/templates/lupine-template-fullstack-starter/web/src/pages/user1-page.tsx +0 -57
- package/templates/lupine-template-fullstack-starter/web/src/services/shared-data.ts +0 -19
- package/templates/lupine-template-fullstack-starter/web/src/styles/app.css +0 -0
- package/templates/lupine-template-responsive-starter/api/package.json +0 -6
- package/templates/lupine-template-responsive-starter/api/resources/config_default.json +0 -6
- package/templates/lupine-template-responsive-starter/api/resources/install.sqlite.sql +0 -4
- package/templates/lupine-template-responsive-starter/api/src/service/root-api.ts +0 -18
- package/templates/lupine-template-responsive-starter/web/src/app-icons.ts +0 -76
- package/templates/lupine-template-responsive-starter/web/src/components/input-history-component.tsx +0 -93
- package/templates/lupine-template-responsive-starter/web/src/components/mine-about-page.tsx +0 -87
- package/templates/lupine-template-responsive-starter/web/src/components/mine-premium-page.tsx +0 -81
- package/templates/lupine-template-responsive-starter/web/src/components/mine-settings-page.tsx +0 -211
- package/templates/lupine-template-responsive-starter/web/src/components/mobile-top-search-menu.tsx +0 -107
- package/templates/lupine-template-responsive-starter/web/src/components/note-detail.tsx +0 -110
- package/templates/lupine-template-responsive-starter/web/src/components/note-edit.tsx +0 -144
- package/templates/lupine-template-responsive-starter/web/src/components/note-search-page.tsx +0 -188
- package/templates/lupine-template-responsive-starter/web/src/components/search-input.tsx +0 -95
- package/templates/lupine-template-responsive-starter/web/src/components/side-menu-content.tsx +0 -169
- package/templates/lupine-template-responsive-starter/web/src/frames/app-responsive-frame.tsx +0 -53
- package/templates/lupine-template-responsive-starter/web/src/pages/about-page.tsx +0 -32
- package/templates/lupine-template-responsive-starter/web/src/pages/finance-page.tsx +0 -35
- package/templates/lupine-template-responsive-starter/web/src/pages/home-page.tsx +0 -444
- package/templates/lupine-template-responsive-starter/web/src/pages/mine-page.tsx +0 -318
- package/templates/lupine-template-responsive-starter/web/src/pages/tools-page.tsx +0 -35
- package/templates/lupine-template-responsive-starter/web/src/services/local-notes-service.ts +0 -87
- package/templates/lupine-template-responsive-starter/web/src/services/mine-service.ts +0 -45
- package/templates/lupine-template-responsive-starter/web/src/styles/app.css +0 -0
- package/templates/lupine-template-responsive-starter/web/src/styles/base-css.ts +0 -65
- package/templates/lupine-template-responsive-starter/web/src/styles/global.css +0 -2130
- package/templates/lupine-template-responsive-starter/web/src/styles/theme.ts +0 -17
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/01-experience/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/02-projects/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/03-skills/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/04-education/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/en/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/01-experience/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/02-projects/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/03-skills/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/04-education/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/markdown/zh/index.md +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/01-experience/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/02-projects/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/03-skills/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/04-education/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/en/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/01-experience/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/02-projects/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/03-skills/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/04-education/index.html +0 -0
- /package/templates/lupine-template-cv-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/essentials/list.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/install.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/guide/started.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/en/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/essentials/list.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/install.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/guide/started.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/markdown/zh/index.md +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/essentials/list.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/install.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/guide/started.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/en/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/markdown-config.ts +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/index.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/essentials/list.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/install.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/guide/started.html +0 -0
- /package/templates/lupine-template-doc-starter/{web → app}/src/markdown-built/zh/index.html +0 -0
- /package/templates/{lupine-template-responsive-starter → lupine-template-fullstack-note}/api/src/index.ts +0 -0
- /package/templates/lupine-template-fullstack-starter/{web/assets/images → app/assets}/sample.png +0 -0
- /package/templates/lupine-template-fullstack-starter/web/src/{components → admin/components}/story-props.ts +0 -0
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, initializePage } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
import { setCookieUser } from '../services/shared-data';
|
|
5
|
-
|
|
6
|
-
const fetchLogin = async (username: string, code: string) => {
|
|
7
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/login', {
|
|
8
|
-
u: username,
|
|
9
|
-
c: code,
|
|
10
|
-
});
|
|
11
|
-
return data.json;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const fetchCode = async (username: string) => {
|
|
15
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-code', { u: username });
|
|
16
|
-
return data.json;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const LoginCodePage = async (props: PageProps) => {
|
|
20
|
-
const css: CssProps = {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
flexDirection: 'column',
|
|
23
|
-
width: '100%',
|
|
24
|
-
minHeight: '100%',
|
|
25
|
-
overflowY: 'auto',
|
|
26
|
-
'.top-header': {
|
|
27
|
-
padding: '50px 0',
|
|
28
|
-
margin: 'auto',
|
|
29
|
-
fontSize: '200%',
|
|
30
|
-
},
|
|
31
|
-
'.top-content': {
|
|
32
|
-
flex: '1',
|
|
33
|
-
padding: '8px 16px',
|
|
34
|
-
margin: 'auto',
|
|
35
|
-
// '.login-button, .login-tip': {
|
|
36
|
-
// justifyContent: 'center',
|
|
37
|
-
// },
|
|
38
|
-
'.top-content-box': {
|
|
39
|
-
padding: '20px 40px',
|
|
40
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
41
|
-
},
|
|
42
|
-
'.login-button button': {
|
|
43
|
-
width: '100%',
|
|
44
|
-
fontSize: '150%',
|
|
45
|
-
height: '40px',
|
|
46
|
-
},
|
|
47
|
-
'.login-tip': {
|
|
48
|
-
color: 'gray',
|
|
49
|
-
fontSize: '90%',
|
|
50
|
-
},
|
|
51
|
-
'.login-tip a': {
|
|
52
|
-
paddingLeft: '10px',
|
|
53
|
-
},
|
|
54
|
-
'.label': {
|
|
55
|
-
width: '200px',
|
|
56
|
-
},
|
|
57
|
-
'.row-box': {
|
|
58
|
-
marginBottom: '16px',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'.top-footer': {
|
|
62
|
-
padding: '16px 16px 4px 16px',
|
|
63
|
-
margin: 'auto',
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const onCode = async () => {
|
|
68
|
-
const codeButton = DomUtils.bySelector('.code-button') as HTMLButtonElement;
|
|
69
|
-
if (codeButton.classList.contains('disabled')) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
74
|
-
if (!username) {
|
|
75
|
-
NotificationMessage.sendMessage('请输入用户名(邮箱)', NotificationColor.Error);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const auth = await fetchCode(username);
|
|
80
|
-
if (auth.status === 'ok') {
|
|
81
|
-
NotificationMessage.sendMessage('验证码已发送到您的邮箱,请复制到这里登录。', NotificationColor.Success);
|
|
82
|
-
|
|
83
|
-
codeButton.classList.add('disabled');
|
|
84
|
-
setTimeout(() => {
|
|
85
|
-
codeButton.classList.remove('disabled');
|
|
86
|
-
}, 60000);
|
|
87
|
-
} else {
|
|
88
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const onLogin = async () => {
|
|
93
|
-
const codeDom = DomUtils.bySelector('.u-code') as HTMLInputElement;
|
|
94
|
-
const userDom = DomUtils.bySelector('.u-name') as HTMLInputElement;
|
|
95
|
-
const username = userDom.value;
|
|
96
|
-
const code = codeDom.value;
|
|
97
|
-
if (!username || !code) {
|
|
98
|
-
NotificationMessage.sendMessage('请输入用户名和验证码', NotificationColor.Error);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const auth = await fetchLogin(username, code);
|
|
102
|
-
// console.log('====auth', auth);
|
|
103
|
-
if (auth.status === 'error') {
|
|
104
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
if (auth.result) {
|
|
109
|
-
setCookieUser(auth.user || {});
|
|
110
|
-
initializePage('/');
|
|
111
|
-
// window.location.href = '/';
|
|
112
|
-
} else {
|
|
113
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
return (
|
|
118
|
-
<div css={css} class='admin-login'>
|
|
119
|
-
<div class='top-header'>
|
|
120
|
-
<div class='top-title'>登录</div>
|
|
121
|
-
</div>
|
|
122
|
-
<div class='top-content login-form-width'>
|
|
123
|
-
<div class='top-content-box'>
|
|
124
|
-
<div class='row-box'>
|
|
125
|
-
<div class='label'>用户名(邮箱):</div>
|
|
126
|
-
<input class='input-base u-name' type='text' value={props.query['email'] || ''} />
|
|
127
|
-
</div>
|
|
128
|
-
<div class='row-box'>
|
|
129
|
-
<button onClick={() => onCode()} class='button-base button-s code-button'>
|
|
130
|
-
发送验证码
|
|
131
|
-
</button>
|
|
132
|
-
</div>
|
|
133
|
-
<div class='row-box'>
|
|
134
|
-
<div class='label'>验证码:</div>
|
|
135
|
-
<div>
|
|
136
|
-
<input class='input-base u-code' type='text' />
|
|
137
|
-
</div>
|
|
138
|
-
</div>
|
|
139
|
-
<div class='row-box login-button'>
|
|
140
|
-
<button onClick={() => onLogin()} class='button-base'>
|
|
141
|
-
登录
|
|
142
|
-
</button>
|
|
143
|
-
</div>
|
|
144
|
-
<div class='row-box login-tip'>* 登录以使用此系统。</div>
|
|
145
|
-
<div class='row-box login-tip'>
|
|
146
|
-
* 没有账号?
|
|
147
|
-
<a href='/register' class='pr-m'>
|
|
148
|
-
注册
|
|
149
|
-
</a>{' '}
|
|
150
|
-
or <a href='/'>首页</a>
|
|
151
|
-
</div>
|
|
152
|
-
<div class='row-box login-tip'>
|
|
153
|
-
* 使用密码登录?<a href='/login'>使用密码登录</a>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
<div class='top-footer'>
|
|
158
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
);
|
|
162
|
-
};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, initializePage } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
import { setCookieUser } from '../services/shared-data';
|
|
5
|
-
|
|
6
|
-
const fetchLogin = async (username: string, code: string) => {
|
|
7
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/login', {
|
|
8
|
-
u: username,
|
|
9
|
-
c: code,
|
|
10
|
-
});
|
|
11
|
-
return data.json;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const fetchCode = async (username: string) => {
|
|
15
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-code', { u: username });
|
|
16
|
-
return data.json;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const LoginCodePage = async (props: PageProps) => {
|
|
20
|
-
const css: CssProps = {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
flexDirection: 'column',
|
|
23
|
-
width: '100%',
|
|
24
|
-
minHeight: '100%',
|
|
25
|
-
overflowY: 'auto',
|
|
26
|
-
'.top-header': {
|
|
27
|
-
padding: '50px 0',
|
|
28
|
-
margin: 'auto',
|
|
29
|
-
fontSize: '200%',
|
|
30
|
-
},
|
|
31
|
-
'.top-content': {
|
|
32
|
-
flex: '1',
|
|
33
|
-
padding: '8px 16px',
|
|
34
|
-
margin: 'auto',
|
|
35
|
-
// '.login-button, .login-tip': {
|
|
36
|
-
// justifyContent: 'center',
|
|
37
|
-
// },
|
|
38
|
-
'.top-content-box': {
|
|
39
|
-
padding: '20px 40px',
|
|
40
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
41
|
-
},
|
|
42
|
-
'.login-button button': {
|
|
43
|
-
width: '100%',
|
|
44
|
-
fontSize: '150%',
|
|
45
|
-
height: '40px',
|
|
46
|
-
},
|
|
47
|
-
'.login-tip': {
|
|
48
|
-
color: 'gray',
|
|
49
|
-
fontSize: '90%',
|
|
50
|
-
},
|
|
51
|
-
'.login-tip a': {
|
|
52
|
-
paddingLeft: '10px',
|
|
53
|
-
},
|
|
54
|
-
'.label': {
|
|
55
|
-
width: '200px',
|
|
56
|
-
},
|
|
57
|
-
'.row-box': {
|
|
58
|
-
marginBottom: '16px',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'.top-footer': {
|
|
62
|
-
padding: '16px 16px 4px 16px',
|
|
63
|
-
margin: 'auto',
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const onCode = async () => {
|
|
68
|
-
const codeButton = DomUtils.bySelector('.code-button') as HTMLButtonElement;
|
|
69
|
-
if (codeButton.classList.contains('disabled')) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
74
|
-
if (!username) {
|
|
75
|
-
NotificationMessage.sendMessage('Please input username (Email)', NotificationColor.Error);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const auth = await fetchCode(username);
|
|
80
|
-
if (auth.status === 'ok') {
|
|
81
|
-
NotificationMessage.sendMessage(
|
|
82
|
-
'Authentication code is sent to your email, please copy it here to login.',
|
|
83
|
-
NotificationColor.Success
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
codeButton.classList.add('disabled');
|
|
87
|
-
setTimeout(() => {
|
|
88
|
-
codeButton.classList.remove('disabled');
|
|
89
|
-
}, 60000);
|
|
90
|
-
} else {
|
|
91
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const onLogin = async () => {
|
|
96
|
-
const codeDom = DomUtils.bySelector('.u-code') as HTMLInputElement;
|
|
97
|
-
const userDom = DomUtils.bySelector('.u-name') as HTMLInputElement;
|
|
98
|
-
const username = userDom.value;
|
|
99
|
-
const code = codeDom.value;
|
|
100
|
-
if (!username || !code) {
|
|
101
|
-
NotificationMessage.sendMessage('Please input username and authentication code', NotificationColor.Error);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const auth = await fetchLogin(username, code);
|
|
105
|
-
// console.log('====auth', auth);
|
|
106
|
-
if (auth.status === 'error') {
|
|
107
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (auth.result) {
|
|
112
|
-
setCookieUser(auth.user || {});
|
|
113
|
-
initializePage('/');
|
|
114
|
-
// window.location.href = '/';
|
|
115
|
-
} else {
|
|
116
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<div css={css} class='admin-login'>
|
|
122
|
-
<div class='top-header'>
|
|
123
|
-
<div class='top-title'>Login</div>
|
|
124
|
-
</div>
|
|
125
|
-
<div class='top-content login-form-width'>
|
|
126
|
-
<div class='top-content-box'>
|
|
127
|
-
<div class='row-box'>
|
|
128
|
-
<div class='label'>Username (Email):</div>
|
|
129
|
-
<input class='input-base u-name' type='text' value={props.query['email'] || ''} />
|
|
130
|
-
</div>
|
|
131
|
-
<div class='row-box'>
|
|
132
|
-
<button onClick={() => onCode()} class='button-base button-s code-button'>
|
|
133
|
-
Send Authentication Code
|
|
134
|
-
</button>
|
|
135
|
-
</div>
|
|
136
|
-
<div class='row-box'>
|
|
137
|
-
<div class='label'>Authentication Code:</div>
|
|
138
|
-
<div>
|
|
139
|
-
<input class='input-base u-code' type='text' />
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
<div class='row-box login-button'>
|
|
143
|
-
<button onClick={() => onLogin()} class='button-base'>
|
|
144
|
-
Login
|
|
145
|
-
</button>
|
|
146
|
-
</div>
|
|
147
|
-
<div class='row-box login-tip'>* Login to use this system.</div>
|
|
148
|
-
<div class='row-box login-tip'>
|
|
149
|
-
* Don't have an account?
|
|
150
|
-
<a href='/register' class='pr-m'>
|
|
151
|
-
Go to Register
|
|
152
|
-
</a>{' '}
|
|
153
|
-
or <a href='/'>Home</a>
|
|
154
|
-
</div>
|
|
155
|
-
<div class='row-box login-tip'>
|
|
156
|
-
* Password login?<a href='/login'>Login with password</a>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
<div class='top-footer'>
|
|
161
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
162
|
-
</div>
|
|
163
|
-
</div>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, initializePage } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
import { setCookieUser } from '../services/shared-data';
|
|
5
|
-
|
|
6
|
-
const fetchLogin = async (username: string, password: string) => {
|
|
7
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/login', { u: username, p: password });
|
|
8
|
-
return data.json;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const LoginPage = async (props: PageProps) => {
|
|
12
|
-
const css: CssProps = {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
width: '100%',
|
|
16
|
-
minHeight: '100%',
|
|
17
|
-
overflowY: 'auto',
|
|
18
|
-
'.top-header': {
|
|
19
|
-
padding: '50px 0',
|
|
20
|
-
margin: 'auto',
|
|
21
|
-
fontSize: '200%',
|
|
22
|
-
},
|
|
23
|
-
'.top-content': {
|
|
24
|
-
flex: '1',
|
|
25
|
-
padding: '8px 16px',
|
|
26
|
-
margin: 'auto',
|
|
27
|
-
'.top-content-box': {
|
|
28
|
-
padding: '20px 40px',
|
|
29
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
30
|
-
},
|
|
31
|
-
'.login-button button': {
|
|
32
|
-
width: '100%',
|
|
33
|
-
fontSize: '150%',
|
|
34
|
-
height: '40px',
|
|
35
|
-
},
|
|
36
|
-
'.login-tip': {
|
|
37
|
-
color: 'gray',
|
|
38
|
-
fontSize: '90%',
|
|
39
|
-
},
|
|
40
|
-
'.login-tip a': {
|
|
41
|
-
paddingLeft: '10px',
|
|
42
|
-
},
|
|
43
|
-
'.label': {
|
|
44
|
-
width: '200px',
|
|
45
|
-
},
|
|
46
|
-
'.row-box': {
|
|
47
|
-
marginBottom: '16px',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
'.top-footer': {
|
|
51
|
-
padding: '16px 16px 4px 16px',
|
|
52
|
-
margin: 'auto',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const onLogin = async () => {
|
|
57
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
58
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
59
|
-
if (!username || !password) {
|
|
60
|
-
NotificationMessage.sendMessage('Please input username and password', NotificationColor.Error);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const auth = await fetchLogin(username, password);
|
|
64
|
-
// console.log('====auth', auth);
|
|
65
|
-
if (auth.status === 'error' && auth.action === 'activate') {
|
|
66
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
initializePage('/login-code?email=' + username);
|
|
69
|
-
}, 1000);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (auth.result) {
|
|
74
|
-
setCookieUser(auth.user || {});
|
|
75
|
-
initializePage('/');
|
|
76
|
-
} else {
|
|
77
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div css={css} class='admin-login'>
|
|
83
|
-
<div class='top-header'>
|
|
84
|
-
<div class='top-title'>登陆</div>
|
|
85
|
-
</div>
|
|
86
|
-
<div class='top-content login-form-width'>
|
|
87
|
-
<div class='top-content-box'>
|
|
88
|
-
<div class='row-box'>
|
|
89
|
-
<div class='label'>用户名 (Email):</div>
|
|
90
|
-
<input class='input-base u-name' type='text' />
|
|
91
|
-
</div>
|
|
92
|
-
<div class='row-box'>
|
|
93
|
-
<div class='label'>密码:</div>
|
|
94
|
-
<input class='input-base u-pass' type='password' />
|
|
95
|
-
</div>
|
|
96
|
-
<div class='row-box login-button'>
|
|
97
|
-
<button onClick={() => onLogin()} class='button-base'>
|
|
98
|
-
登录
|
|
99
|
-
</button>
|
|
100
|
-
</div>
|
|
101
|
-
<div class='row-box login-tip'>* 登录系统</div>
|
|
102
|
-
<div class='row-box login-tip'>
|
|
103
|
-
* 还没有账户?<a href='/register'>去注册</a>或者<a href='/'>首页</a>
|
|
104
|
-
</div>
|
|
105
|
-
<div class='row-box login-tip'>
|
|
106
|
-
* 忘记了密码?<a href='/reset-pw'>重新设置密码</a>
|
|
107
|
-
</div>
|
|
108
|
-
<div class='row-box login-tip'>
|
|
109
|
-
* 无密码登录?<a href='/login-code'>用验证码登录</a>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
<div class='top-footer'>
|
|
114
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
);
|
|
118
|
-
};
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, initializePage } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
import { setCookieUser } from '../services/shared-data';
|
|
5
|
-
|
|
6
|
-
const fetchLogin = async (username: string, password: string) => {
|
|
7
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/login', { u: username, p: password });
|
|
8
|
-
return data.json;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const LoginPage = async (props: PageProps) => {
|
|
12
|
-
const css: CssProps = {
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flexDirection: 'column',
|
|
15
|
-
width: '100%',
|
|
16
|
-
minHeight: '100%',
|
|
17
|
-
overflowY: 'auto',
|
|
18
|
-
'.top-header': {
|
|
19
|
-
padding: '50px 0',
|
|
20
|
-
margin: 'auto',
|
|
21
|
-
fontSize: '200%',
|
|
22
|
-
},
|
|
23
|
-
'.top-content': {
|
|
24
|
-
flex: '1',
|
|
25
|
-
padding: '8px 16px',
|
|
26
|
-
margin: 'auto',
|
|
27
|
-
'.top-content-box': {
|
|
28
|
-
padding: '20px 40px',
|
|
29
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
30
|
-
},
|
|
31
|
-
'.login-button button': {
|
|
32
|
-
width: '100%',
|
|
33
|
-
fontSize: '150%',
|
|
34
|
-
height: '40px',
|
|
35
|
-
},
|
|
36
|
-
'.login-tip': {
|
|
37
|
-
color: 'gray',
|
|
38
|
-
fontSize: '90%',
|
|
39
|
-
},
|
|
40
|
-
'.login-tip a': {
|
|
41
|
-
paddingLeft: '10px',
|
|
42
|
-
},
|
|
43
|
-
'.label': {
|
|
44
|
-
width: '200px',
|
|
45
|
-
},
|
|
46
|
-
'.row-box': {
|
|
47
|
-
marginBottom: '16px',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
'.top-footer': {
|
|
51
|
-
padding: '16px 16px 4px 16px',
|
|
52
|
-
margin: 'auto',
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const onLogin = async () => {
|
|
57
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
58
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
59
|
-
if (!username || !password) {
|
|
60
|
-
NotificationMessage.sendMessage('Please input username and password', NotificationColor.Error);
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const auth = await fetchLogin(username, password);
|
|
64
|
-
// console.log('====auth', auth);
|
|
65
|
-
if (auth.status === 'error' && auth.action === 'activate') {
|
|
66
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
initializePage('/login-code?email=' + username);
|
|
69
|
-
}, 1000);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (auth.result) {
|
|
74
|
-
setCookieUser(auth.user || {});
|
|
75
|
-
initializePage('/');
|
|
76
|
-
} else {
|
|
77
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<div css={css} class='admin-login'>
|
|
83
|
-
<div class='top-header'>
|
|
84
|
-
<div class='top-title'>Login</div>
|
|
85
|
-
</div>
|
|
86
|
-
<div class='top-content login-form-width'>
|
|
87
|
-
<div class='top-content-box'>
|
|
88
|
-
<div class='row-box'>
|
|
89
|
-
<div class='label'>Username (Email):</div>
|
|
90
|
-
<input class='input-base u-name' type='text' />
|
|
91
|
-
</div>
|
|
92
|
-
<div class='row-box'>
|
|
93
|
-
<div class='label'>Password:</div>
|
|
94
|
-
<input class='input-base u-pass' type='password' />
|
|
95
|
-
</div>
|
|
96
|
-
<div class='row-box login-button'>
|
|
97
|
-
<button onClick={() => onLogin()} class='button-base'>
|
|
98
|
-
Login
|
|
99
|
-
</button>
|
|
100
|
-
</div>
|
|
101
|
-
<div class='row-box login-tip'>* Login to use this system.</div>
|
|
102
|
-
<div class='row-box login-tip'>
|
|
103
|
-
* Don't have an account?
|
|
104
|
-
<a href='/register' class='pr-m'>
|
|
105
|
-
Go to Register
|
|
106
|
-
</a>{' '}
|
|
107
|
-
or <a href='/'>Home</a>
|
|
108
|
-
</div>
|
|
109
|
-
<div class='row-box login-tip'>
|
|
110
|
-
* Forgot password?<a href='/reset-pw'>Reset Password</a>
|
|
111
|
-
</div>
|
|
112
|
-
<div class='row-box login-tip'>
|
|
113
|
-
* Passwordless login?<a href='/login-code'>Login with code</a>
|
|
114
|
-
</div>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
<div class='top-footer'>
|
|
118
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
);
|
|
122
|
-
};
|