简化创建应用模板页面
This commit is contained in:
parent
81fea618ca
commit
7d75bb22fa
@ -123,34 +123,6 @@
|
||||
</n-descriptions-item>
|
||||
</n-descriptions>
|
||||
|
||||
<div class="mt-4">
|
||||
<n-alert type="success" :show-icon="false">
|
||||
<template #header>
|
||||
{{ t('Next Steps') }}
|
||||
</template>
|
||||
<ol class="list-decimal list-inside space-y-2">
|
||||
<li>{{ t('Navigate to the app directory') }}: <n-text code>{{ result.appPath }}</n-text></li>
|
||||
<li>{{ t('Install dependencies') }}: <n-text code>pip install -r requirements.txt</n-text></li>
|
||||
<li>{{ t('Test locally') }}: <n-text code>python -m uvicorn main:app --port 8001</n-text></li>
|
||||
<li>{{ t('Deploy to Jingrow Cloud') }}: <n-text code>bench --site your-site install-app {{ result.appName }}</n-text></li>
|
||||
</ol>
|
||||
</n-alert>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex gap-2">
|
||||
<n-button @click="openInExplorer" type="primary">
|
||||
<template #icon>
|
||||
<n-icon><Icon icon="tabler:folder-open" /></n-icon>
|
||||
</template>
|
||||
{{ t('Open in Explorer') }}
|
||||
</n-button>
|
||||
<n-button @click="copyToClipboard" type="default">
|
||||
<template #icon>
|
||||
<n-icon><Icon icon="tabler:copy" /></n-icon>
|
||||
</template>
|
||||
{{ t('Copy Path') }}
|
||||
</n-button>
|
||||
</div>
|
||||
</n-card>
|
||||
</div>
|
||||
</div>
|
||||
@ -258,28 +230,6 @@ const createAppTemplate = async () => {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const openInExplorer = () => {
|
||||
if (result.value?.appPath) {
|
||||
// 在开发环境中,尝试打开文件管理器
|
||||
if (import.meta.env.DEV) {
|
||||
window.open(`file://${result.value.appPath}`)
|
||||
} else {
|
||||
message.info(t('Please navigate to the path manually'))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const copyToClipboard = async () => {
|
||||
if (result.value?.appPath) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(result.value.appPath)
|
||||
message.success(t('Path copied to clipboard'))
|
||||
} catch (error) {
|
||||
message.error(t('Failed to copy to clipboard'))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user