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,161 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, WebConfig, refreshPage } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage, HtmlLoad } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
|
|
5
|
-
const fetchReg = async (body: any) => {
|
|
6
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/register', body);
|
|
7
|
-
return data.json;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const RegisterPage = async (props: PageProps) => {
|
|
11
|
-
const css: CssProps = {
|
|
12
|
-
display: 'flex',
|
|
13
|
-
flexDirection: 'column',
|
|
14
|
-
width: '100%',
|
|
15
|
-
minHeight: '100%',
|
|
16
|
-
overflowY: 'auto',
|
|
17
|
-
'.top-header': {
|
|
18
|
-
padding: '50px 0',
|
|
19
|
-
margin: 'auto',
|
|
20
|
-
fontSize: '200%',
|
|
21
|
-
},
|
|
22
|
-
'.top-content': {
|
|
23
|
-
flex: '1',
|
|
24
|
-
padding: '8px 16px',
|
|
25
|
-
margin: 'auto',
|
|
26
|
-
// '.login-button, .login-tip': {
|
|
27
|
-
// justifyContent: 'center',
|
|
28
|
-
// },
|
|
29
|
-
'.top-content-box': {
|
|
30
|
-
padding: '20px 40px',
|
|
31
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
32
|
-
},
|
|
33
|
-
'.login-button button': {
|
|
34
|
-
width: '100%',
|
|
35
|
-
fontSize: '150%',
|
|
36
|
-
height: '40px',
|
|
37
|
-
},
|
|
38
|
-
'.login-tip': {
|
|
39
|
-
color: 'gray',
|
|
40
|
-
fontSize: '90%',
|
|
41
|
-
},
|
|
42
|
-
'.login-tip a': {
|
|
43
|
-
padding: '0 10px',
|
|
44
|
-
},
|
|
45
|
-
'.label': {
|
|
46
|
-
width: '200px',
|
|
47
|
-
},
|
|
48
|
-
'.row-box': {
|
|
49
|
-
marginBottom: '16px',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
'.top-footer': {
|
|
53
|
-
padding: '16px 16px 4px 16px',
|
|
54
|
-
margin: 'auto',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const onSubmit = async () => {
|
|
59
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
60
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
61
|
-
if (!username || !password) {
|
|
62
|
-
NotificationMessage.sendMessage('请输入用户名和密码', NotificationColor.Error);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// check username is email?
|
|
66
|
-
const re =
|
|
67
|
-
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
68
|
-
if (!re.test(username)) {
|
|
69
|
-
NotificationMessage.sendMessage('请输入一个正确的邮箱地址作为用户名', NotificationColor.Error);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (password.length < 6) {
|
|
73
|
-
NotificationMessage.sendMessage('密码长度至少为6位', NotificationColor.Error);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const preferredName = DomUtils.getValue('.u-pname')!;
|
|
78
|
-
if (!preferredName) {
|
|
79
|
-
NotificationMessage.sendMessage('请输入网名', NotificationColor.Error);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const isMale = DomUtils.getChecked('.u-male');
|
|
84
|
-
const isFemale = DomUtils.getChecked('.u-female');
|
|
85
|
-
if (!isMale && !isFemale) {
|
|
86
|
-
NotificationMessage.sendMessage('请选择性别', NotificationColor.Error);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const body = {
|
|
91
|
-
u: username,
|
|
92
|
-
p: password,
|
|
93
|
-
preferredName,
|
|
94
|
-
sex: isMale ? 'male' : 'female',
|
|
95
|
-
};
|
|
96
|
-
const data = await fetchReg(body);
|
|
97
|
-
if (data.status === 'ok') {
|
|
98
|
-
NotificationMessage.sendMessage(data.message, NotificationColor.Success);
|
|
99
|
-
setTimeout(async () => {
|
|
100
|
-
await refreshPage('/login');
|
|
101
|
-
}, 1000);
|
|
102
|
-
} else {
|
|
103
|
-
NotificationMessage.sendMessage(data.message, NotificationColor.Error);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
return (
|
|
107
|
-
<div css={css} class='admin-login'>
|
|
108
|
-
<div class='top-header'>
|
|
109
|
-
<div class='top-title'>注册账号</div>
|
|
110
|
-
</div>
|
|
111
|
-
<div class='top-content login-form-width'>
|
|
112
|
-
<div class='top-content-box'>
|
|
113
|
-
<div class='row-box'>
|
|
114
|
-
<div class='label'>用户名 (Email):</div>
|
|
115
|
-
<div>
|
|
116
|
-
<input class='input-base u-name' type='text' maxLength={50} />
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
<HtmlLoad
|
|
120
|
-
html={async () =>
|
|
121
|
-
(await WebConfig.get('verifyEmail', `1`)) ? (
|
|
122
|
-
<div class='row-box login-tip'>* 请仔细确认您的邮箱,您的邮箱将用于接收验证码。</div>
|
|
123
|
-
) : null
|
|
124
|
-
}
|
|
125
|
-
></HtmlLoad>
|
|
126
|
-
<div class='row-box'>
|
|
127
|
-
<div class='label'>密码:</div>
|
|
128
|
-
<div>
|
|
129
|
-
<input class='input-base u-pass' type='password' maxLength={50} />
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
<div class='row-box'>
|
|
133
|
-
<div class='label'>网名:</div>
|
|
134
|
-
<div>
|
|
135
|
-
<input class='input-base u-pname' type='text' maxLength={50} />
|
|
136
|
-
</div>
|
|
137
|
-
</div>
|
|
138
|
-
<div class='row-box'>
|
|
139
|
-
<div class='label'>性别:</div>
|
|
140
|
-
<div>
|
|
141
|
-
<input class='u-male' type='radio' name='sex' id='male' /> <label for='male'>男</label>
|
|
142
|
-
<input class='u-female ml-l' type='radio' name='sex' id='female' /> <label for='female'>女</label>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
<div class='row-box login-button'>
|
|
146
|
-
<button onClick={() => onSubmit()} class='button-base'>
|
|
147
|
-
注册
|
|
148
|
-
</button>
|
|
149
|
-
</div>
|
|
150
|
-
<div class='row-box login-tip'>
|
|
151
|
-
* 已经有一个账号了? <a href='/login'>登录</a>或者
|
|
152
|
-
<a href='/'>首页</a>
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
<div class='top-footer'>
|
|
157
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
);
|
|
161
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps, WebConfig } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage, HtmlLoad } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
|
|
5
|
-
const fetchReg = async (body: any) => {
|
|
6
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/register', body);
|
|
7
|
-
return data.json;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const RegisterPage = async (props: PageProps) => {
|
|
11
|
-
const css: CssProps = {
|
|
12
|
-
display: 'flex',
|
|
13
|
-
flexDirection: 'column',
|
|
14
|
-
width: '100%',
|
|
15
|
-
minHeight: '100%',
|
|
16
|
-
overflowY: 'auto',
|
|
17
|
-
'.top-header': {
|
|
18
|
-
padding: '50px 0',
|
|
19
|
-
margin: 'auto',
|
|
20
|
-
fontSize: '200%',
|
|
21
|
-
},
|
|
22
|
-
'.top-content': {
|
|
23
|
-
flex: '1',
|
|
24
|
-
padding: '8px 16px',
|
|
25
|
-
margin: 'auto',
|
|
26
|
-
// '.login-button, .login-tip': {
|
|
27
|
-
// justifyContent: 'center',
|
|
28
|
-
// },
|
|
29
|
-
'.top-content-box': {
|
|
30
|
-
padding: '20px 40px',
|
|
31
|
-
boxShadow: 'var(--cover-box-shadow)',
|
|
32
|
-
},
|
|
33
|
-
'.login-button button': {
|
|
34
|
-
width: '100%',
|
|
35
|
-
fontSize: '150%',
|
|
36
|
-
height: '40px',
|
|
37
|
-
},
|
|
38
|
-
'.login-tip': {
|
|
39
|
-
color: 'gray',
|
|
40
|
-
fontSize: '90%',
|
|
41
|
-
},
|
|
42
|
-
'.login-tip a': {
|
|
43
|
-
padding: '0 10px',
|
|
44
|
-
},
|
|
45
|
-
'.label': {
|
|
46
|
-
width: '200px',
|
|
47
|
-
},
|
|
48
|
-
'.row-box': {
|
|
49
|
-
marginBottom: '16px',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
'.top-footer': {
|
|
53
|
-
padding: '16px 16px 4px 16px',
|
|
54
|
-
margin: 'auto',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const onSubmit = async () => {
|
|
59
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
60
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
61
|
-
if (!username || !password) {
|
|
62
|
-
NotificationMessage.sendMessage('请输入用户名和密码', NotificationColor.Error);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// check username is email?
|
|
66
|
-
const re =
|
|
67
|
-
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
68
|
-
if (!re.test(username)) {
|
|
69
|
-
NotificationMessage.sendMessage('请输入一个正确的邮箱地址作为用户名', NotificationColor.Error);
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
if (password.length < 6) {
|
|
73
|
-
NotificationMessage.sendMessage('密码长度至少为6位', NotificationColor.Error);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
const preferredName = DomUtils.getValue('.u-pname')!;
|
|
78
|
-
if (!preferredName) {
|
|
79
|
-
NotificationMessage.sendMessage('请输入网名', NotificationColor.Error);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const isMale = DomUtils.getChecked('.u-male');
|
|
84
|
-
const isFemale = DomUtils.getChecked('.u-female');
|
|
85
|
-
if (!isMale && !isFemale) {
|
|
86
|
-
NotificationMessage.sendMessage('请选择性别', NotificationColor.Error);
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const body = {
|
|
91
|
-
u: username,
|
|
92
|
-
p: password,
|
|
93
|
-
preferredName,
|
|
94
|
-
sex: isMale ? 'male' : 'female',
|
|
95
|
-
};
|
|
96
|
-
const data = await fetchReg(body);
|
|
97
|
-
if (data.status === 'ok') {
|
|
98
|
-
NotificationMessage.sendMessage(data.message, NotificationColor.Success);
|
|
99
|
-
setTimeout(() => {
|
|
100
|
-
window.location.href = '/login';
|
|
101
|
-
}, 1000);
|
|
102
|
-
} else {
|
|
103
|
-
NotificationMessage.sendMessage(data.message, NotificationColor.Error);
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
return (
|
|
107
|
-
<div css={css} class='admin-login'>
|
|
108
|
-
<div class='top-header'>
|
|
109
|
-
<div class='top-title'>Register</div>
|
|
110
|
-
</div>
|
|
111
|
-
<div class='top-content login-form-width'>
|
|
112
|
-
<div class='top-content-box'>
|
|
113
|
-
<div class='row-box'>
|
|
114
|
-
<div class='label'>Username (Email):</div>
|
|
115
|
-
<div>
|
|
116
|
-
<input class='input-base u-name' type='text' maxLength={50} />
|
|
117
|
-
</div>
|
|
118
|
-
</div>
|
|
119
|
-
<HtmlLoad
|
|
120
|
-
html={async () =>
|
|
121
|
-
(await WebConfig.get('verifyEmail', `1`)) ? (
|
|
122
|
-
<div class='row-box login-tip'>
|
|
123
|
-
* Confirm you email carefully and your email is used to receive authentication code.
|
|
124
|
-
</div>
|
|
125
|
-
) : null
|
|
126
|
-
}
|
|
127
|
-
></HtmlLoad>
|
|
128
|
-
<div class='row-box'>
|
|
129
|
-
<div class='label'>Password:</div>
|
|
130
|
-
<div>
|
|
131
|
-
<input class='input-base u-pass' type='password' maxLength={50} />
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
134
|
-
<div class='row-box'>
|
|
135
|
-
<div class='label'>Preferred Name:</div>
|
|
136
|
-
<div>
|
|
137
|
-
<input class='input-base u-pname' type='text' maxLength={50} />
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
<div class='row-box'>
|
|
141
|
-
<div class='label'>Gender:</div>
|
|
142
|
-
<div>
|
|
143
|
-
<input class='u-male' type='radio' name='sex' id='male' /> <label for='male'>Male</label>
|
|
144
|
-
<input class='u-female ml-l' type='radio' name='sex' id='female' /> <label for='female'>Female</label>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
<div class='row-box login-button'>
|
|
148
|
-
<button onClick={() => onSubmit()} class='button-base'>
|
|
149
|
-
Register
|
|
150
|
-
</button>
|
|
151
|
-
</div>
|
|
152
|
-
<div class='row-box login-tip'>
|
|
153
|
-
* Already have an account? <a href='/login'>Login</a> or
|
|
154
|
-
<a href='/'>Home</a>
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
<div class='top-footer'>
|
|
159
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
160
|
-
</div>
|
|
161
|
-
</div>
|
|
162
|
-
);
|
|
163
|
-
};
|
package/templates/lupine-template-fullstack-starter/web/src/components/reset-password-zh.tsx
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { CssProps, PageProps, getRenderPageProps } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
|
|
5
|
-
const fetchCode = async (username: string) => {
|
|
6
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-code', { u: username });
|
|
7
|
-
return data.json;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const fetchReset = async (username: string, password: string, authCode: string) => {
|
|
11
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-pw', {
|
|
12
|
-
u: username,
|
|
13
|
-
p: password,
|
|
14
|
-
a: authCode,
|
|
15
|
-
});
|
|
16
|
-
return data.json;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const ResetPasswordPage = 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
|
-
const auth = await fetchCode(username);
|
|
79
|
-
if (auth.status === 'ok') {
|
|
80
|
-
NotificationMessage.sendMessage('验证码已发送到您的邮箱,请复制并粘贴到此处', NotificationColor.Success);
|
|
81
|
-
|
|
82
|
-
codeButton.classList.add('disabled');
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
codeButton.classList.remove('disabled');
|
|
85
|
-
}, 60000);
|
|
86
|
-
} else {
|
|
87
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
const onReset = async () => {
|
|
91
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
92
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
93
|
-
const password2 = DomUtils.getValue('.u-pass2')!;
|
|
94
|
-
const authCode = DomUtils.getValue('.u-code')!;
|
|
95
|
-
if (!username || !password || !password2 || !authCode) {
|
|
96
|
-
NotificationMessage.sendMessage('请输入用户名、密码和验证码', NotificationColor.Error);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (password !== password2) {
|
|
100
|
-
NotificationMessage.sendMessage('两次输入的密码不一致', NotificationColor.Error);
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (password.length < 6) {
|
|
104
|
-
NotificationMessage.sendMessage('密码长度至少为6位', NotificationColor.Error);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
const auth = await fetchReset(username, password, authCode);
|
|
108
|
-
if (auth.status === 'ok') {
|
|
109
|
-
NotificationMessage.sendMessage('密码重置成功,请登录', NotificationColor.Success);
|
|
110
|
-
} else {
|
|
111
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<div css={css} class='admin-login'>
|
|
117
|
-
<div class='top-header'>
|
|
118
|
-
<div class='top-title'>重置密码</div>
|
|
119
|
-
</div>
|
|
120
|
-
<div class='top-content login-form-width'>
|
|
121
|
-
<div class='top-content-box'>
|
|
122
|
-
<div class='row-box'>
|
|
123
|
-
<div class='label'>用户名 (邮箱):</div>
|
|
124
|
-
<div>
|
|
125
|
-
<input class='input-base u-name' type='text' />
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
<div class='row-box code-button'>
|
|
129
|
-
<button onClick={() => onCode()} class='button-base'>
|
|
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'>
|
|
140
|
-
<div class='label'>新密码:</div>
|
|
141
|
-
<div>
|
|
142
|
-
<input class='input-base u-pass' type='password' />
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
<div class='row-box'>
|
|
146
|
-
<div class='label'>确认密码:</div>
|
|
147
|
-
<div>
|
|
148
|
-
<input class='input-base u-pass2' type='password' />
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
<div class='row-box login-button'>
|
|
152
|
-
<button onClick={() => onReset()} class='button-base'>
|
|
153
|
-
重置密码
|
|
154
|
-
</button>
|
|
155
|
-
</div>
|
|
156
|
-
<div class='row-box login-tip'>
|
|
157
|
-
* 用密码登录?<a href='/login'>去登录</a>或者<a href='/'>首页</a>
|
|
158
|
-
</div>
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
<div class='top-footer'>
|
|
162
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
);
|
|
166
|
-
};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { createSignal, CssProps, getRenderPageProps, PageProps } from 'lupine.web';
|
|
2
|
-
import { DomUtils, NotificationColor, NotificationMessage } from 'lupine.web.components';
|
|
3
|
-
import { Footer } from './footer';
|
|
4
|
-
|
|
5
|
-
const fetchCode = async (username: string) => {
|
|
6
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-code', { u: username });
|
|
7
|
-
return data.json;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
const fetchReset = async (username: string, password: string, authCode: string) => {
|
|
11
|
-
const data = await getRenderPageProps().renderPageFunctions.fetchData('/api/reset-pw', {
|
|
12
|
-
u: username,
|
|
13
|
-
p: password,
|
|
14
|
-
a: authCode,
|
|
15
|
-
});
|
|
16
|
-
return data.json;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const ResetPasswordPage = 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 and paste it here.',
|
|
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
|
-
const onReset = async () => {
|
|
95
|
-
const username = DomUtils.getValue('.u-name')!;
|
|
96
|
-
const password = DomUtils.getValue('.u-pass')!;
|
|
97
|
-
const password2 = DomUtils.getValue('.u-pass2')!;
|
|
98
|
-
const authCode = DomUtils.getValue('.u-code')!;
|
|
99
|
-
if (!username || !password || !password2 || !authCode) {
|
|
100
|
-
NotificationMessage.sendMessage(
|
|
101
|
-
'Please input username, password and authentication code',
|
|
102
|
-
NotificationColor.Error
|
|
103
|
-
);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (password !== password2) {
|
|
107
|
-
NotificationMessage.sendMessage('The two passwords do not match', NotificationColor.Error);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (password.length < 6) {
|
|
111
|
-
NotificationMessage.sendMessage('Password length must be at least 6 characters', NotificationColor.Error);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const auth = await fetchReset(username, password, authCode);
|
|
115
|
-
if (auth.status === 'ok') {
|
|
116
|
-
NotificationMessage.sendMessage('Your password is reset, please go to Login page', NotificationColor.Success);
|
|
117
|
-
} else {
|
|
118
|
-
NotificationMessage.sendMessage(auth.message, NotificationColor.Error);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
return (
|
|
123
|
-
<div css={css} class='admin-login'>
|
|
124
|
-
<div class='top-header'>
|
|
125
|
-
<div class='top-title'>Reset Password</div>
|
|
126
|
-
</div>
|
|
127
|
-
<div class='top-content login-form-width'>
|
|
128
|
-
<div class='top-content-box'>
|
|
129
|
-
<div class='row-box'>
|
|
130
|
-
<div class='label'>Username (Email):</div>
|
|
131
|
-
<div>
|
|
132
|
-
<input class='input-base u-name' type='text' />
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
<div class='row-box'>
|
|
136
|
-
<button onClick={() => onCode()} class='button-base code-button'>
|
|
137
|
-
Send Authentication Code
|
|
138
|
-
</button>
|
|
139
|
-
</div>
|
|
140
|
-
<div class='row-box'>
|
|
141
|
-
<div class='label'>Authentication Code:</div>
|
|
142
|
-
<div>
|
|
143
|
-
<input class='input-base u-code' type='text' />
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
<div class='row-box'>
|
|
147
|
-
<div class='label'>New Password:</div>
|
|
148
|
-
<div>
|
|
149
|
-
<input class='input-base u-pass' type='password' />
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
<div class='row-box'>
|
|
153
|
-
<div class='label'>Confirm Password:</div>
|
|
154
|
-
<div>
|
|
155
|
-
<input class='input-base u-pass2' type='password' />
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
<div class='row-box login-button'>
|
|
159
|
-
<button onClick={() => onReset()} class='button-base'>
|
|
160
|
-
Reset Password
|
|
161
|
-
</button>
|
|
162
|
-
</div>
|
|
163
|
-
<div class='row-box login-tip'>
|
|
164
|
-
* Login with your password?
|
|
165
|
-
<a href='/login' class='pr-m'>
|
|
166
|
-
Go to Login
|
|
167
|
-
</a>{' '}
|
|
168
|
-
or <a href='/'>Home</a>
|
|
169
|
-
</div>
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
<div class='top-footer'>
|
|
173
|
-
<Footer title="Copyright© 2025 <a href='/'>Home</a>. All Rights Reserved."></Footer>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
);
|
|
177
|
-
};
|