Merge branch 'master' of https://github.com/crawlab-team/crawlab into v0.4.0

This commit is contained in:
陈景阳
2019-08-24 17:40:03 +08:00
6 changed files with 67 additions and 12 deletions

9
Jenkinsfile vendored
View File

@@ -48,8 +48,11 @@ pipeline {
sh """
# 重启docker compose
cd ./jenkins/${ENV:GIT_BRANCH}
docker-compose stop | true
docker-compose up -d
docker-compose stop master | true
docker-compose rm -f master | true
docker-compose stop worker | true
docker-compose rm -f worker | true
docker-compose up -d | true
"""
}
}
@@ -57,7 +60,7 @@ pipeline {
steps {
echo 'Cleanup...'
sh """
docker rmi `docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs`
docker rmi -f `docker images | grep '<none>' | grep -v IMAGE | awk '{ print \$3 }' | xargs`
"""
}
}

View File

@@ -32,6 +32,7 @@ func (c *Subscriber) Connect() {
log.Debug("wait...")
switch res := c.client.Receive().(type) {
case redis.Message:
i = 0
channel := (*string)(unsafe.Pointer(&res.Channel))
message := (*string)(unsafe.Pointer(&res.Data))
c.cbMap[*channel](*channel, *message)
@@ -39,17 +40,17 @@ func (c *Subscriber) Connect() {
fmt.Printf("%s: %s %d\n", res.Channel, res.Kind, res.Count)
case error:
log.Error("error handle redis connection...")
con, err := GetRedisConn()
if err != nil {
log.Fatal("redis dial failed")
continue
}
c.client = redis.PubSubConn{Conn: con}
c.cbMap = make(map[string]SubscribeCallback)
time.Sleep(2 * time.Second)
if i > 5 {
panic(errors.New("redis connection failed too many times, panic"))
}
con, err := GetRedisConn()
if err != nil {
log.Error("redis dial failed")
continue
}
c.client = redis.PubSubConn{Conn: con}
i += 1
continue

View File

@@ -0,0 +1,14 @@
<svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
<circle cx="150" cy="150" r="150" fill="#409eff">
</circle>
<circle cx="150" cy="150" r="110" fill="#fff">
</circle>
<circle cx="150" cy="150" r="70" fill="#409eff">
</circle>
<path d="
M 150,150
L 280,225
A 150,150 90 0 0 280,75
" fill="#409eff">
</path>
</svg>

After

Width:  |  Height:  |  Size: 393 B

View File

@@ -214,6 +214,7 @@ export default {
// 下拉框
User: '用户',
Logout: '退出登录',
Documentation: '文档',
// 选择
'Yes': '是',

View File

@@ -30,7 +30,7 @@
<el-dropdown class="documentation right">
<a href="https://tikazyq.github.io/crawlab-docs" target="_blank">
<font-awesome-icon :icon="['far', 'question-circle']"/>
<span style="margin-left: 5px;">文档</span>
<span style="margin-left: 5px;">{{$t('Documentation')}}</span>
</a>
</el-dropdown>
</div>

View File

@@ -4,7 +4,7 @@
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on"
label-position="left">
<h3 class="title">
CRAWLAB
<span><img style="width:48px;margin-bottom:-5px;margin-right:2px" src="../../assets/logo.svg"></span>RAWLAB
</h3>
<el-form-item prop="username" style="margin-bottom: 28px;">
<el-input
@@ -61,11 +61,18 @@
<img src="https://img.shields.io/badge/github-crawlab-blue">
</a>
</div>
<div class="lang">
<span @click="setLang('zh')" :class="lang==='zh'?'active':''">中文</span>
<span @click="setLang('en')" :class="lang==='en'?'active':''">English</span>
</div>
</el-form>
</div>
</template>
<script>
import {
mapState
} from 'vuex'
import { isValidUsername } from '../../utils/validate'
export default {
@@ -109,6 +116,9 @@ export default {
}
},
computed: {
...mapState('lang', [
'lang'
]),
isSignUp () {
return this.$route.path === '/signup'
},
@@ -149,6 +159,11 @@ export default {
onKeyEnter () {
const func = this.isSignUp ? this.handleSignup : this.handleLogin
func()
},
setLang (lang) {
window.localStorage.setItem('lang', lang)
this.$set(this.$i18n, 'locale', lang)
this.$store.commit('lang/SET_LANG', lang)
}
},
mounted () {
@@ -374,6 +389,7 @@ const initCanvas = () => {
color: #409EFF;
margin: 0px auto 20px auto;
text-align: center;
cursor: default;
}
.show-pwd {
@@ -407,5 +423,25 @@ const initCanvas = () => {
font-weight: 600;
}
}
.lang {
margin-top: 20px;
text-align: center;
span {
cursor: pointer;
margin: 10px;
color: #666;
font-size: 14px;
}
span.active {
font-weight: 600;
}
span:hover {
text-decoration: underline;
}
}
}
</style>