Merge pull request #520 from crawlab-team/develop

Develop
This commit is contained in:
Marvin Zhang
2020-02-08 09:34:32 +08:00
committed by GitHub
7 changed files with 75 additions and 34 deletions

View File

@@ -15,7 +15,7 @@ WORKDIR /app
# install frontend
RUN npm config set unsafe-perm true
RUN npm install -g yarn && yarn install --registry=https://registry.npm.taobao.org # --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
RUN npm install -g cnpm && cnpm install
RUN npm run build:prod

View File

@@ -35,32 +35,32 @@ export default {
},
methods: {},
async mounted () {
window.setUseStats = (value) => {
document.querySelector('.el-message__closeBtn').click()
if (value === 1) {
this.$st.sendPv('/allow_stats')
this.$st.sendEv('全局', '允许/禁止统计', '允许')
} else {
this.$st.sendPv('/disallow_stats')
this.$st.sendEv('全局', '允许/禁止统计', '禁止')
}
localStorage.setItem('useStats', value)
}
// window.setUseStats = (value) => {
// document.querySelector('.el-message__closeBtn').click()
// if (value === 1) {
// this.$st.sendPv('/allow_stats')
// this.$st.sendEv('全局', '允许/禁止统计', '允许')
// } else {
// this.$st.sendPv('/disallow_stats')
// this.$st.sendEv('全局', '允许/禁止统计', '禁止')
// }
// localStorage.setItem('useStats', value)
// }
// first-time user
if (this.useStats === undefined || this.useStats === null) {
this.$message({
type: 'info',
dangerouslyUseHTMLString: true,
showClose: true,
duration: 0,
message: '<p>' + this.$t('Do you allow us to collect some statistics to improve Crawlab?') + '</p>' +
'<div style="text-align: center;margin-top: 10px;">' +
'<button class="message-btn" onclick="setUseStats(1)">' + this.$t('Yes') + '</button>' +
'<button class="message-btn" onclick="setUseStats(0)">' + this.$t('No') + '</button>' +
'</div>'
})
}
// if (this.useStats === undefined || this.useStats === null) {
// this.$message({
// type: 'info',
// dangerouslyUseHTMLString: true,
// showClose: true,
// duration: 0,
// message: '<p>' + this.$t('Do you allow us to collect some statistics to improve Crawlab?') + '</p>' +
// '<div style="text-align: center;margin-top: 10px;">' +
// '<button class="message-btn" onclick="setUseStats(1)">' + this.$t('Yes') + '</button>' +
// '<button class="message-btn" onclick="setUseStats(0)">' + this.$t('No') + '</button>' +
// '</div>'
// })
// }
// set uid if first visit
if (this.uid === undefined || this.uid === null) {

View File

@@ -15,6 +15,11 @@
<a class="a-tag" @click="onClickSpider(scope.row)">{{scope.row.spider_name}}</a>
</template>
</el-table-column>
<el-table-column property="param" :label="$t('Parameters')" width="120">
<template slot-scope="scope">
<span>{{scope.row.param}}</span>
</template>
</el-table-column>
<el-table-column property="result_count" :label="$t('Results Count')" width="60" align="right">
<template slot-scope="scope">
<span>{{scope.row.result_count}}</span>

View File

@@ -226,6 +226,7 @@ export default {
'Tags': '标签',
'Enter Tags': '输入标签',
'No Project': '无项目',
'All Projects': '所有项目',
// 定时任务
'Schedule Name': '定时任务名称',
@@ -379,11 +380,13 @@ export default {
'DingTalk Robot Webhook': '钉钉机器人 Webhook',
'Wechat Robot Webhook': '微信机器人 Webhook',
'Password Settings': '密码设置',
'Notify Settings': '通知设置',
'Notifications': '消息通知',
'Global Variable': '全局变量',
'Add Global Variable': '新增全局变量',
'Are you sure to delete this global variable': '确定删除该全局变量',
'Key': '设置',
'Allow Sending Statistics': '允许发送统计信息',
'General': '通用',
// 其他
tagsView: {

View File

@@ -54,7 +54,7 @@ This Disclaimer and privacy protection statement (hereinafter referred to as "di
2. 本产品是基于Golang的分布式爬虫管理平台支持Python、NodeJS、Go、Java、PHP等多种编程语言以及多种爬虫框架。
3. 一切因使用 Crawlab 而引致之任何意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其所造成的损失(包括在非官方站点下载 Crawlab 而感染电脑病毒)Crawlab 开发组概不负责,亦不承担任何法律责任。
4. 用户对使用 Crawlab 自行承担风险,我们不做任何形式的保证, 因网络状况、通讯线路等任何技术原因而导致用户不能正常升级更新,我们也不承担任何法律责任。
5. 用户使用 Crawlab 对目标网站进行抓取时需遵从《网络安全法》等与爬虫相关的法律法规,切勿擅自采集公民个人信息、用 DDoS 等方式造成目标网站瘫痪、不遵从目标网站的 robots.txt 协议等非法手段。
5. 用户使用 Crawlab 对目标网站进行抓取时需遵从[《网络安全法》](https://baike.baidu.com/item/中华人民共和国网络安全法)等与爬虫相关的法律法规,切勿擅自采集公民个人信息、用 DDoS 等方式造成目标网站瘫痪、不遵从目标网站的 [robots.txt 协议](https://baike.baidu.com/item/robots协议)等非法手段。
6. Crawlab 尊重并保护所有用户的个人隐私权,不会窃取任何用户计算机中的信息。
7. 系统的版权Crawlab 开发组对所有开发的或合作开发的产品拥有知识产权,著作权,版权和使用权,这些产品受到适用的知识产权、版权、商标、服务商标、专利或其他法律的保护。
8. 传播:任何公司或个人在网络上发布,传播我们软件的行为都是允许的,但因公司或个人传播软件可能造成的任何法律和刑事事件 Crawlab 开发组不负任何责任。
@@ -68,4 +68,19 @@ This Disclaimer and privacy protection statement (hereinafter referred to as "di
.disclaimer >>> ol li {
margin: 10px 0;
}
.disclaimer >>> a {
color: #409EFF;
}
.disclaimer >>> a:hover {
text-decoration: underline;
}
.disclaimer .el-card {
line-height: 1.5;
max-width: 700px;
margin-left: calc(50% - 450px);
min-height: calc(100vh - 130px);
}
</style>

View File

@@ -84,7 +84,7 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('Cron')" prop="cron" required>
<el-popover v-model="isShowCron" trigger="manual">
<el-popover v-model="isShowCron" trigger="focus">
<template>
<vue-cron-linux :data="scheduleForm.cron" :i18n="lang" @change="onCronChange"/>
</template>
@@ -94,8 +94,6 @@
ref="cron"
v-model="scheduleForm.cron"
:placeholder="`${$t('[minute] [hour] [day] [month] [day of week]')}`"
@focus="isShowCron = true"
@blur="isShowCron = false"
>
</el-input>
</template>

View File

@@ -32,7 +32,7 @@
</el-dialog>
<el-tabs v-model="activeName" @tab-click="tabActiveHandle">
<el-tab-pane :label="$t('Password Settings')" name="password">
<el-tab-pane :label="$t('General')" name="general">
<el-form :model="userInfo" class="setting-form" ref="setting-form" label-width="200px" :rules="rules"
inline-message>
<el-form-item prop="username" :label="$t('Username')">
@@ -41,6 +41,14 @@
<el-form-item prop="password" :label="$t('Password')">
<el-input v-model="userInfo.password" type="password" :placeholder="$t('Password')"></el-input>
</el-form-item>
<el-form-item :label="$t('Allow Sending Statistics')">
<el-switch
v-model="isAllowSendingStatistics"
@change="onAllowSendingStatisticsChange"
active-color="#67C23A"
inactive-color="#909399"
/>
</el-form-item>
<el-form-item>
<div style="text-align: right">
<el-button type="success" size="small" @click="saveUserInfo">
@@ -50,7 +58,7 @@
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane :label="$t('Notify Settings')" name="notify">
<el-tab-pane :label="$t('Notifications')" name="notify">
<el-form :model="userInfo" class="setting-form" ref="setting-form" label-width="200px" :rules="rules"
inline-message>
<el-form-item :label="$t('Notification Trigger Timing')">
@@ -165,7 +173,7 @@ export default {
'setting.wechat_robot_webhook': [{ trigger: 'blur', validator: validateWechatRobotWebhook }]
},
isShowDingTalkAppSecret: false,
activeName: 'password',
activeName: 'general',
addDialogVisible: false,
tourSteps: [
{
@@ -204,7 +212,8 @@ export default {
}
this.$utils.tour.nextStep('setting', currentStep)
}
}
},
isAllowSendingStatistics: localStorage.getItem('useStats') === '1'
}
},
computed: {
@@ -271,6 +280,17 @@ export default {
this.$st.sendEv('设置', '保存')
},
tabActiveHandle () {
},
onAllowSendingStatisticsChange (value) {
if (value) {
this.$st.sendPv('/allow_stats')
this.$st.sendEv('全局', '允许/禁止统计', '允许')
} else {
this.$st.sendPv('/disallow_stats')
this.$st.sendEv('全局', '允许/禁止统计', '禁止')
}
this.$message.success(this.$t('Saved successfully'))
localStorage.setItem('useStats', value ? '1' : '0')
}
},
async created () {