* Move resource blob save into a independent function
* Support save resouce blob from Telegram like HTTP API
* Support save resouce blob download from URL to LocalStorage or S3
* fix typo
* Add support for download resource from link
* Parse external link and add file ext name from mime info
* Add zh-Hans locale for `download-link`
* fix typo on code and comments
* Update server/resource.go
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
Co-authored-by: boojack <stevenlgtm@gmail.com>
* Change all `Robot` to `Bot`
* Change all `r` of `Bot` to `b`
* Change `Robot` to `bot` in comments
* Fix typo
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
* Add retry wait for telegram.GetUpdates
* Add support to set telegram robot token from UI
* Change validator of UserSettingTelegramUserID
* Add support to set telegram user id from UI
* Fix typescript check
* Add validator for SystemSettingTelegramRobotTokenName
* Optimize error notice while config telegram params
* Change for review
* Fix telegram user id could not be empty
* Fix telegram robot could not be empty
* Fix for eslint (again)
* Update web/src/components/Settings/SystemSection.tsx
---------
Co-authored-by: Athurg Feng <athurg@gooth.org>
Co-authored-by: boojack <stevenlgtm@gmail.com>
* Add preliminar Windows support for both
development and production environments.
Default profile.Data will be set to "C:\ProgramData\memos" on Windows.
Folder will be created if it does not exist, as this behavior is
expected for Windows applications.
System service installation can be achieved with third-party tools,
explained in docs/windows-service.md.
Not sure if it's worth using https://github.com/kardianos/service
to make service support built-in.
This could be a nice addition alongside #1583 (add Windows artifacts)
* feat: improve Windows support
- Fix local file storage path handling on Windows
- Improve Windows dev script
* feat: add max upload size setting to UI & more
- feat: add max upload size setting to UI
- feat: max upload size setting is checked on UI during upload,
but also enforced by the server
- fix: overflowing mobile layout for Create SSO, Create Storage
and other Settings dialogs
- feat: add HelpButton component with some links to docs were appropriate
- remove LearnMore component in favor of HelpButton
- refactor: change some if/else to switch statements
- refactor: inline some err == nil checks
! Existing databases without the new setting 'max-upload-size-mib'
will show an upload error, but this can be user-fixed by simply
setting the value on system settings UI.
* improvements requested by @boojack
* Add option to hide Ask AI and update dev version
* Fix formatting according to eslint
* Replace option to hide Ask AI with auto hiding based on config
* Fix golangci-lint errors
* Remove showAskAI logic from OpenAPI
* feat: improve i18n support as a whole
- Remove dayjs in favor of /helpers/datetime.ts, which uses
Intl.DateTimeFormat and Date. Dayjs is not exactly i18n friendly
and has several locale related opened issues.
- Move/refactor date/time code from /helpers/utils.ts to
/helpers/datetime.ts.
- Fix Daily Review weekday not changing according to selected date.
- Localize Daily review weekday and month.
- Load i18n listed strings from /locales/{locale}.json in a dynamic way.
This makes much easier to add new locales, by just adding a properly
named json file and listing it only in /web/src/i18n.ts and
/api/user_setting.go.
- Fallback languages are now set in /web/src/i18n.ts.
- Full language codes are now preffered, but they fallback to 2-letter
codes when not available.
- The locale dropdown is now populated dynamically from the available
locales. Locale names are populated by the browser via
Intl.DisplayNames(locale).
- /web/src/i18n.ts now exports a type TLocale from availableLocales
array. This is used only by findNearestLanguageMatch(). As I was unable
to use this type in ".d.ts" files, I switched the Locale type from
/web/src/types/i18n.d.ts to string.
- Move pretty much all hardcoded text strings to i18n strings.
- Add pt-BR translation.
- Remove site.ts and move its content to a i18n string.
- Rename zh.json to zh-Hans.json to get the correct language name on
selector dropdown.
- Remove pt_BR.json and replace with pt-BR.json.
- Some minor layout spacing fixes to accommodate larger texts.
- Improve some error messages.
* Delete .yarnrc.yml
* Delete package-lock.json
* fix: 158:28 error Insert `⏎` prettier/prettier
* feat: add support for resource page on frontend
* [WIP]feat: add backend support for limit and offset search
* feat: add reducer to add resource
* support fetch all resource when first search
* beautify the fetch ui
* restore file
* feat: add all resource before clear resource
* eslint
* i18n
* chore:change the nane
* chore: change the name of param
* eslint
* feat: setIsComplete to true when first loading resource fully
* fix the bug of fetch
* feat change finally to then
* feat: add await and async to clear and search
* feat: return all resource when fetch
* chore: change variable name
* Update web/src/pages/ResourcesDashboard.tsx
Co-authored-by: boojack <stevenlgtm@gmail.com>
* fix missing const value
---------
Co-authored-by: boojack <stevenlgtm@gmail.com>
* feat(system): support for disabling public memos
* fix(web/editor): set visibility to private on disabled public memos
* feat(server/memo): find/check if public memos are disabled
* fix(server/memo): handle error for finding system error
* fix(server/memo): unmarshal visiblity when getting system settings
* chore(web): move side effect imports to end
* Update memo.go
---------
Co-authored-by: boojack <stevenlgtm@gmail.com>