Merge pull request #26 from gclm/dev-gclm

hook触发器全路径
This commit is contained in:
Linsk Ruis 2020-12-15 10:17:04 +08:00 committed by GitHub
commit 6ff513fd9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -10,7 +10,7 @@
"build": "node build/build.js" "build": "node build/build.js"
}, },
"dependencies": { "dependencies": {
"axios": "^0.15.3", "axios": "^0.21.0",
"echarts": "^3.3.2", "echarts": "^3.3.2",
"element-ui": "^2.10.1", "element-ui": "^2.10.1",
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",

View File

@ -23,23 +23,29 @@
<el-table-column type="index" width="60"> <el-table-column type="index" width="60">
</el-table-column> </el-table-column>
<el-table-column label="名称" width="250"> <el-table-column label="名称" width="250">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{row.Title}} {{ row.Title }}
<el-tag size="mini" type="success" v-if="row.Enable==1">已激活</el-tag> <el-tag size="mini" type="success" v-if="row.Enable==1">已激活</el-tag>
<el-tag size="mini" type="danger" v-else>未激活</el-tag> <el-tag size="mini" type="danger" v-else>未激活</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="描述"> <el-table-column label="描述">
<template slot-scope="{row}"> <template slot-scope="{row}">
<span>{{row.Desc}}</span> <span>{{ row.Desc }}</span>
<div><el-tag type="danger" v-if="row.Errs!=''">{{row.Errs}}</el-tag></div> <div>
<div><el-tag type="info" v-if="row.Types == 'hook'">hook地址/hook/trigger/{{row.Id}}</el-tag></div> <el-tag type="danger" v-if="row.Errs!=''">{{ row.Errs }}</el-tag>
</template> </div>
<div>
<el-tag type="info" v-if="row.Types == 'hook'">hook地址
{{host}}hook/trigger/{{ row.Id }}
</el-tag>
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="Types" label="触发器类型" width="150" :formatter="typesFormatter"> <el-table-column prop="Types" label="触发器类型" width="150" :formatter="typesFormatter">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{getTypes(row.Types)}} {{ getTypes(row.Types) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="Times" label="创建时间" width="200" :formatter="dateFormat" sortable> <el-table-column prop="Times" label="创建时间" width="200" :formatter="dateFormat" sortable>
</el-table-column> </el-table-column>
@ -85,6 +91,7 @@ export default {
limit: 0, limit: 0,
listdata: [], listdata: [],
sels: [],// sels: [],//
host: "",
} }
}, },
mounted() { mounted() {
@ -95,6 +102,11 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
//NProgress.start(); //NProgress.start();
// URL
const routerIndex = window.location.href.indexOf('#');
const url = window.location.href.slice(0, routerIndex > 0 ? routerIndex : window.location.href.length);
console.log("xxx:", url)
this.host = url;
this.$post('/trigger/list', this.filters).then((res) => { this.$post('/trigger/list', this.filters).then((res) => {
console.log(res); console.log(res);
this.loading = false; this.loading = false;
@ -127,11 +139,15 @@ export default {
}); });
}); });
}, getTypes(typ) { }, getTypes(typ) {
switch(typ){ switch (typ) {
case "timer":return "定时器"; case "timer":
case "hook":return "hook"; return "定时器";
case "worked":return "流水线结束"; case "hook":
default:return typ; return "hook";
case "worked":
return "流水线结束";
default:
return typ;
} }
}, },
dateFormat: function (row, column) { dateFormat: function (row, column) {

View File

@ -310,12 +310,12 @@ axios-mock-adapter@^1.7.1:
fast-deep-equal "^3.1.1" fast-deep-equal "^3.1.1"
is-buffer "^2.0.3" is-buffer "^2.0.3"
axios@^0.15.3: axios@^0.21.0:
version "0.15.3" version "0.21.0"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.15.3.tgz#2c9d638b2e191a08ea1d6cc988eadd6ba5bdc053" resolved "https://registry.npm.taobao.org/axios/download/axios-0.21.0.tgz#26df088803a2350dff2c27f96fef99fe49442aca"
integrity sha1-LJ1jiy4ZGgjqHWzJiOrda6W9wFM= integrity sha1-Jt8IiAOiNQ3/LCf5b++Z/klEKso=
dependencies: dependencies:
follow-redirects "1.0.0" follow-redirects "^1.10.0"
babel-code-frame@^6.11.0, babel-code-frame@^6.26.0: babel-code-frame@^6.11.0, babel-code-frame@^6.26.0:
version "6.26.0" version "6.26.0"
@ -2543,18 +2543,16 @@ flush-write-stream@^1.0.0:
inherits "^2.0.3" inherits "^2.0.3"
readable-stream "^2.3.6" readable-stream "^2.3.6"
follow-redirects@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.0.0.tgz#8e34298cbd2e176f254effec75a1c78cc849fd37"
integrity sha1-jjQpjL0uF28lTv/sdaHHjMhJ/Tc=
dependencies:
debug "^2.2.0"
follow-redirects@^1.0.0: follow-redirects@^1.0.0:
version "1.13.0" version "1.13.0"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA== integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
follow-redirects@^1.10.0:
version "1.13.1"
resolved "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.13.1.tgz?cache=0&sync_timestamp=1607916886138&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.13.1.tgz#5f69b813376cee4fd0474a3aba835df04ab763b7"
integrity sha1-X2m4Ezds7k/QR0o6uoNd8Eq3Y7c=
font-awesome@^4.7.0: font-awesome@^4.7.0:
version "4.7.0" version "4.7.0"
resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133" resolved "https://registry.yarnpkg.com/font-awesome/-/font-awesome-4.7.0.tgz#8fa8cf0411a1a31afd07b06d2902bb9fc815a133"