初步代替几个bat脚本的功能
This commit is contained in:
commit
d0fbc89012
19 changed files with 4002 additions and 0 deletions
56
ui/src/pages/Update.vue
Normal file
56
ui/src/pages/Update.vue
Normal file
|
@ -0,0 +1,56 @@
|
|||
<script setup>
|
||||
const branch = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
pywebview.api.get_branch().then((value) => {
|
||||
branch.value = value
|
||||
})
|
||||
})
|
||||
|
||||
watch(branch, () => {
|
||||
pywebview.api.set_branch(branch.value)
|
||||
})
|
||||
|
||||
const steps = ref([
|
||||
{
|
||||
title: '下载源码',
|
||||
command: [
|
||||
'../git/bin/git fetch',
|
||||
`../git/bin/git switch -f ${branch.value}`,
|
||||
`../git/bin/git reset --hard origin/${branch.value}`
|
||||
],
|
||||
cwd: './mower-ng'
|
||||
},
|
||||
{
|
||||
title: '安装依赖',
|
||||
command: [
|
||||
'../python/Scripts/pip install -i https://mirror.sjtu.edu.cn/pypi/web/simple -r requirements.txt'
|
||||
],
|
||||
cwd: './mower-ng'
|
||||
}
|
||||
])
|
||||
provide('steps', steps)
|
||||
const current_step = ref(1)
|
||||
provide('current_step', current_step)
|
||||
const current_state = ref('wait')
|
||||
provide('current_state', current_state)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<n-flex vertical style="gap: 16px; height: 100%; padding: 16px; box-sizing: border-box">
|
||||
<n-flex>
|
||||
<div>代码分支:</div>
|
||||
<n-radio-group v-model:value="branch">
|
||||
<n-flex>
|
||||
<n-radio value="fast">fast</n-radio>
|
||||
<n-radio value="slow">slow</n-radio>
|
||||
</n-flex>
|
||||
</n-radio-group>
|
||||
</n-flex>
|
||||
<n-steps :current="current_step" :status="current_state" size="small">
|
||||
<n-step v-for="step in steps" :title="step.title" />
|
||||
</n-steps>
|
||||
<log-component />
|
||||
</n-flex>
|
||||
<float-button />
|
||||
</template>
|
Loading…
Add table
Add a link
Reference in a new issue