feat:template draft & default random #3973
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Generated by Copilot at 2cb6726
Summary
🐛🌐🚀
This pull request implements several improvements and bug fixes for the frontend of the sealos template provider. It adds a new API endpoint and function to get the template details by name, filters out draft templates from the listTemplate response, adds error logging for the applyApp call, updates the dependencies and translations, and fixes some code formatting and logic issues in various files.
Walkthrough
@uiw/react-codemirror
dependency to fix bugs and improve performance (link)common.json
files for the English and Chinese translations of the sidebar labels (link, link)getKindTemplate
function to theapp.ts
file to define the API call to get the template details by name (link)NonePage
component in the404.tsx
file to redirect to the root path and return null when the page is not found (link)applyApp.ts
file to check if theyamlList
parameter is empty and return an error message (link)getKindTemplate.ts
file to define the handler function for the/api/getKindTemplate
endpoint (link)TemplateType
type to thelistTemplate.ts
file and filtered out the draft templates from the response (link, link)/api/listTemplate
endpoint and replaced it with the useQuery hook for the/api/getKindTemplate
endpoint in theindex.tsx
file (link, link)postDeployApp
API call in theindex.tsx
file (link)ConfirmChild
andLoading
components from the_app.tsx
file as they were not used (link)applyApp
API call in theindex.tsx
file (link)handleInputs
function to thejson-yaml.ts
file to handle the default values for the inputs in the template (link, link)user.ts
file to indicate that thegetUserKubeConfig
function is for the edge mode of the sealos platform (link)getUserNamespace
function from theuser.ts
file as it was not used and not compatible with the edge mode (link)README.md
andREADME_zh.md
files (link, link)Flex
,Text
,Box
,Grid
,svg
, andButton
components in theindex.tsx
files, for code formatting purposes (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)