1
1
<script setup lang="ts">
2
2
import { computed } from ' vue'
3
+ import { useI18n } from ' vue-i18n'
3
4
4
5
interface AdvancedOptions {
5
6
withPull: boolean
@@ -18,6 +19,7 @@ interface Emits {
18
19
19
20
const props = defineProps <Props >()
20
21
const emit = defineEmits <Emits >()
22
+ const { t } = useI18n ()
21
23
22
24
// 为每个属性创建独立的计算属性
23
25
const withPull = computed ({
@@ -41,12 +43,12 @@ const mirrorUrl = computed({
41
43
})
42
44
43
45
44
- const mirrorPresets = [
45
- { title: ' 清华大学镜像源 ' , value: ' mirrors.tuna.tsinghua.edu.cn' },
46
- { title: ' 吉林大学镜像源 ' , value: ' mirrors.jlu.edu.cn' },
47
- { title: ' 中科大镜像源 ' , value: ' mirrors.ustc.edu.cn' },
48
- { title: ' 华南理工镜像源 ' , value: ' mirrors.scut.edu.cn' }
49
- ]
46
+ const mirrorPresets = computed (() => [
47
+ { title: t ( ' build.mirrors.tuna ' ) , value: ' mirrors.tuna.tsinghua.edu.cn' },
48
+ { title: t ( ' build.mirrors.jlu ' ) , value: ' mirrors.jlu.edu.cn' },
49
+ { title: t ( ' build.mirrors.ustc ' ) , value: ' mirrors.ustc.edu.cn' },
50
+ { title: t ( ' build.mirrors.scut ' ) , value: ' mirrors.scut.edu.cn' }
51
+ ])
50
52
51
53
const selectMirrorPreset = (preset : string ) => {
52
54
mirrorUrl .value = preset
@@ -66,27 +68,27 @@ const resetOptions = () => {
66
68
<div >
67
69
<div class =" d-flex align-center mb-4" >
68
70
<v-icon class =" mr-2" >mdi-tune</v-icon >
69
- <span class =" text-subtitle-1 font-weight-medium" >高级构建选项 </span >
71
+ <span class =" text-subtitle-1 font-weight-medium" >{{ t('build.advancedOptions') }} </span >
70
72
<v-spacer />
71
73
<v-btn
72
74
variant =" text"
73
75
size =" small"
74
76
@click =" resetOptions"
75
77
>
76
78
<v-icon >mdi-restore</v-icon >
77
- 重置
79
+ {{ t('common.reset') }}
78
80
</v-btn >
79
81
</div >
80
82
81
83
<div >
82
84
<v-row >
83
85
<!-- Docker 选项 -->
84
86
<v-col cols =" 12" >
85
- <div class =" text-subtitle-2 mb-3" >Docker 选项 </div >
87
+ <div class =" text-subtitle-2 mb-3" >{{ t('build.dockerOptions') }} </div >
86
88
87
89
<v-switch
88
90
v-model =" withPull"
89
- label =" 构建前拉取最新镜像 "
91
+ : label =" t('build.pullImage') "
90
92
color =" primary"
91
93
hide-details
92
94
class =" mb-2"
@@ -96,14 +98,14 @@ const resetOptions = () => {
96
98
<template v-slot :activator =" { props } " >
97
99
<v-icon v-bind =" props" size =" small" color =" info" >mdi-help-circle-outline</v-icon >
98
100
</template >
99
- <span >--with-pull: 确保使用最新的 ImageBuilder 镜像 </span >
101
+ <span >{{ t('build.pullImageTooltip') }} </span >
100
102
</v-tooltip >
101
103
</template >
102
104
</v-switch >
103
105
104
106
<v-switch
105
107
v-model =" rmFirst"
106
- label =" 构建前删除现有容器 "
108
+ : label =" t('build.removeFirst') "
107
109
color =" primary"
108
110
hide-details
109
111
class =" mb-3"
@@ -113,19 +115,19 @@ const resetOptions = () => {
113
115
<template v-slot :activator =" { props } " >
114
116
<v-icon v-bind =" props" size =" small" color =" info" >mdi-help-circle-outline</v-icon >
115
117
</template >
116
- <span >--rm-first: 清理可能冲突的容器 </span >
118
+ <span >{{ t('build.removeFirstTooltip') }} </span >
117
119
</v-tooltip >
118
120
</template >
119
121
</v-switch >
120
122
</v-col >
121
123
122
124
<!-- 镜像源选项 -->
123
125
<v-col cols =" 12" >
124
- <div class =" text-subtitle-2 mb-3" >镜像源设置 </div >
126
+ <div class =" text-subtitle-2 mb-3" >{{ t('build.mirrorSettings') }} </div >
125
127
126
128
<v-switch
127
129
v-model =" useMirror"
128
- label =" 使用镜像源加速下载 "
130
+ : label =" t('build.useMirror') "
129
131
color =" primary"
130
132
hide-details
131
133
class =" mb-3"
@@ -135,7 +137,7 @@ const resetOptions = () => {
135
137
<template v-slot :activator =" { props } " >
136
138
<v-icon v-bind =" props" size =" small" color =" info" >mdi-help-circle-outline</v-icon >
137
139
</template >
138
- <span >--use-mirror: 使用国内镜像源加速软件包下载 </span >
140
+ <span >{{ t('build.useMirrorTooltip') }} </span >
139
141
</v-tooltip >
140
142
</template >
141
143
</v-switch >
@@ -144,7 +146,7 @@ const resetOptions = () => {
144
146
<div v-if =" useMirror" >
145
147
<v-text-field
146
148
v-model =" mirrorUrl"
147
- label =" 镜像源地址 "
149
+ : label =" t('build.mirrorUrl') "
148
150
placeholder =" mirrors.tuna.tsinghua.edu.cn"
149
151
variant =" outlined"
150
152
density =" compact"
@@ -176,7 +178,7 @@ const resetOptions = () => {
176
178
</v-text-field >
177
179
178
180
<div class =" text-caption text-medium-emphasis mb-3" >
179
- 提示:不要包含 http:// 或 https:// 前缀
181
+ {{ t('build.mirrorUrlHint') }}
180
182
</div >
181
183
</div >
182
184
</v-expand-transition >
0 commit comments