mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
加入挑战
This commit is contained in:
@@ -262,6 +262,9 @@ export default {
|
||||
})
|
||||
dep.installed = true
|
||||
}
|
||||
this.$request.put('/actions', {
|
||||
type: 'install_dep'
|
||||
})
|
||||
this.$set(this.depLoadingDict, name, false)
|
||||
this.$st.sendEv('节点详情', '安装', '安装依赖')
|
||||
},
|
||||
@@ -312,6 +315,9 @@ export default {
|
||||
message: this.$t('You have successfully installed a language: ') + this.activeLang.name
|
||||
})
|
||||
}
|
||||
this.$request.put('/actions', {
|
||||
type: 'install_lang'
|
||||
})
|
||||
this.isLoadingInstallLang = false
|
||||
this.$st.sendEv('节点详情', '安装', '安装语言')
|
||||
},
|
||||
|
||||
@@ -266,6 +266,7 @@ export default {
|
||||
await Promise.all(this.nodeList.map(async n => {
|
||||
if (n.status !== 'online') return
|
||||
const res = await this.$request.get(`/nodes/${n._id}/langs`)
|
||||
if (!res.data.data) return
|
||||
res.data.data.forEach(l => {
|
||||
const key = n._id + '|' + l.executable_name
|
||||
this.$set(this.langsDataDict, key, l)
|
||||
@@ -280,6 +281,7 @@ export default {
|
||||
await Promise.all(this.nodeList.map(async n => {
|
||||
if (n.status !== 'online') return
|
||||
const res = await this.$request.get(`/nodes/${n._id}/deps/installed`, { lang: this.activeLang })
|
||||
if (!res.data.data) return
|
||||
res.data.data.forEach(d => {
|
||||
depsSet.add(d.name)
|
||||
const key = n._id + '|' + d.name
|
||||
@@ -319,6 +321,9 @@ export default {
|
||||
setTimeout(() => {
|
||||
this.getLangsData()
|
||||
}, 1000)
|
||||
this.$request.put('/actions', {
|
||||
type: 'install_lang'
|
||||
})
|
||||
this.$st.sendEv('节点列表', '安装', '安装语言')
|
||||
},
|
||||
async onInstallLangAll (langLabel, ev) {
|
||||
@@ -372,6 +377,9 @@ export default {
|
||||
})
|
||||
this.$set(this.depsDataDict, key, 'installed')
|
||||
}
|
||||
this.$request.put('/actions', {
|
||||
type: 'install_dep'
|
||||
})
|
||||
this.$st.sendEv('节点列表', '安装', '安装依赖')
|
||||
},
|
||||
async uninstallDep (node, dep) {
|
||||
|
||||
@@ -592,6 +592,7 @@ docker run -d --restart always --name crawlab_worker \\
|
||||
'Are you sure to stop selected items?': '您是否确认停止所选项?',
|
||||
'Sent signals to cancel selected tasks': '已经向所选任务发送取消任务信号',
|
||||
'Copied successfully': '已成功复制',
|
||||
'You have started the challenge.': '您已开始挑战',
|
||||
|
||||
// 其他
|
||||
'Star crawlab-team/crawlab on GitHub': '在 GitHub 上为 Crawlab 加星吧'
|
||||
|
||||
@@ -152,7 +152,7 @@ const user = {
|
||||
|
||||
// 添加用户
|
||||
addUser ({ dispatch, commit, state }) {
|
||||
return request.put('/users', state.userForm)
|
||||
return request.put('/users-add', state.userForm)
|
||||
},
|
||||
// 新增全局变量
|
||||
addGlobalVariable ({ commit, state }) {
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-s-flag"
|
||||
@click="onStartChallenge(c)"
|
||||
>
|
||||
{{$t('Start Challenge')}}
|
||||
</el-button>
|
||||
@@ -80,6 +81,13 @@ export default {
|
||||
await this.$request.post('/challenges-check')
|
||||
const res = await this.$request.get('/challenges')
|
||||
this.challenges = res.data.data || []
|
||||
},
|
||||
onStartChallenge (c) {
|
||||
if (c.path) {
|
||||
this.$router.push(c.path)
|
||||
} else {
|
||||
this.$message.success(this.$t('You have started the challenge.'))
|
||||
}
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
@@ -96,8 +104,8 @@ export default {
|
||||
}
|
||||
|
||||
.challenge-list .challenge-item {
|
||||
flex-basis: 240px;
|
||||
width: 240px;
|
||||
flex-basis: 280px;
|
||||
width: 280px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,11 @@ This Disclaimer and privacy protection statement (hereinafter referred to as "di
|
||||
8. 传播:任何公司或个人在网络上发布,传播我们软件的行为都是允许的,但因公司或个人传播软件可能造成的任何法律和刑事事件 Crawlab 开发组不负任何责任。
|
||||
`
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$request.put('/actions', {
|
||||
type: 'view_disclaimer'
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user