Merge branch 'develop' into develop

This commit is contained in:
暗音
2020-01-07 00:53:18 +08:00
committed by GitHub
7 changed files with 29 additions and 23 deletions

View File

@@ -1,25 +1,25 @@
api:
address: "localhost:8000"
mongo:
host: localhost
host: "192.168.235.26"
port: 27017
db: crawlab_test
username: ""
password: ""
db: crawlab_local
username: "root"
password: "example"
authSource: "admin"
redis:
address: localhost
password: ""
address: 127.0.0.1
password:
database: 1
port: 6379
log:
level: info
path: "/var/logs/crawlab"
path: "./logs/crawlab"
isDeletePeriodically: "N"
deleteFrequency: "@hourly"
server:
host: 0.0.0.0
port: 8000
port: 8001
master: "Y"
secret: "crawlab"
register:
@@ -30,11 +30,11 @@ server:
python: "Y"
node: "N"
spider:
path: "/app/spiders"
path: "./spiders"
task:
workers: 4
other:
tmppath: "/tmp"
version: 0.4.3
setting:
allowRegister: "N"
allowRegister: "N"

View File

@@ -103,7 +103,7 @@ func UpdateNodeStatus() {
model.ResetNodeStatusToOffline(list)
}
// 处理接到信息
// 处理节点信息
func handleNodeInfo(key string, data *Data) {
// 添加同步锁
v, err := database.RedisClient.Lock(key)
@@ -186,10 +186,12 @@ func UpdateNodeData() {
debug.PrintStack()
return
}
if err := database.RedisClient.HSet("nodes", key, utils.BytesToString(dataBytes)); err != nil {
log.Errorf(err.Error())
return
}
}
func MasterNodeCallback(message redis.Message) (err error) {

View File

@@ -1,2 +1,2 @@
NODE_ENV='development'
VUE_APP_BASE_URL=http://localhost:8000
VUE_APP_BASE_URL=http://localhost:8001

View File

@@ -65,12 +65,15 @@
:file-list="fileList"
style="display:inline-block;margin-right:10px"
>
<el-button size="normal" type="primary" icon="el-icon-upload" v-loading="uploadLoading">
<el-button size="small" type="primary" icon="el-icon-upload" v-loading="uploadLoading">
{{$t('Upload')}}
</el-button>
</el-upload>
<el-button size="normal" type="success" @click="onSave"
icon="el-icon-check">
<el-button size="small" v-if="isShowRun" type="danger" @click="onCrawl"
icon="el-icon-video-play">
{{$t('Run')}}
</el-button>
<el-button size="small" type="success" @click="onSave" icon="el-icon-check">
{{$t('Save')}}
</el-button>
</el-row>

View File

@@ -182,7 +182,7 @@
<el-tooltip :content="$t('Remove')" placement="top">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="onRemove(scope.row)"></el-button>
</el-tooltip>
<el-tooltip v-if="false" :content="$t(getStatusTooltip(scope.row))" placement="top">
<el-tooltip :content="$t(getStatusTooltip(scope.row))" placement="top">
<el-button type="success" icon="fa fa-bug" size="mini" @click="onCrawl(scope.row)"></el-button>
</el-tooltip>
</template>

View File

@@ -34,6 +34,7 @@
:visible.sync="addDialogVisible"
:before-close="onAddDialogClose">
<el-tabs :active-name="spiderType">
<!-- customized -->
<el-tab-pane name="customized" :label="$t('Customized')">
<el-form :model="spiderForm" ref="addCustomizedForm" inline-message label-width="120px">
<el-form-item :label="$t('Spider Name')" prop="name" required>
@@ -55,8 +56,7 @@
:headers="{Authorization:token}"
:on-success="onUploadSuccess"
:file-list="fileList">
<el-button size="normal" type="primary" icon="el-icon-upload"
style="width: 160px; font-size: 18px;font-weight: bolder">
<el-button size="small" type="primary" icon="el-icon-upload">
{{$t('Upload')}}
</el-button>
</el-upload>
@@ -75,9 +75,10 @@
</p>
</el-alert>
<div class="actions">
<el-button type="primary" @click="onAddCustomized">{{$t('Add')}}</el-button>
<el-button size="small" type="primary" @click="onAddCustomized">{{$t('Add')}}</el-button>
</div>
</el-tab-pane>
<!-- configurable -->
<el-tab-pane name="configurable" :label="$t('Configurable')">
<el-form :model="spiderForm" ref="addConfigurableForm" inline-message label-width="120px">
<el-form-item :label="$t('Spider Name')" prop="name" required>
@@ -101,7 +102,7 @@
</el-form-item>
</el-form>
<div class="actions">
<el-button type="primary" @click="onAddConfigurable">{{$t('Add')}}</el-button>
<el-button size="small" type="primary" @click="onAddConfigurable">{{$t('Add')}}</el-button>
</div>
</el-tab-pane>
</el-tabs>
@@ -146,7 +147,7 @@
{{$t('Import Spiders')}}
</el-button>
<el-button
size="normal"
size="small"
type="success"
icon="el-icon-plus"
class="btn add"

View File

@@ -4,7 +4,7 @@
<!--filter-->
<div class="filter">
<div class="left">
<el-form model="filter" label-width="100px" label-position="right" inline>
<el-form :model="filter" label-width="100px" label-position="right" inline>
<el-form-item prop="node_id" :label="$t('Node')">
<el-select v-model="filter.node_id" size="small" :placeholder="$t('Node')" @change="onFilterChange">
<el-option value="" :label="$t('All')"/>
@@ -125,7 +125,7 @@
:width="col.width">
</el-table-column>
</template>
<el-table-column :label="$t('Action')" align="left" fixed="right" width="150px">
<el-table-column :label="$t('Action')" align="left" fixed="right" width="120px">
<template slot-scope="scope">
<el-tooltip :content="$t('View')" placement="top">
<el-button type="primary" icon="el-icon-search" size="mini" @click="onView(scope.row)"></el-button>