HTML直接引用vue.min.js,bootstrap-vue.min.js,axios.min.js等开发一个页面(2)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Quality Metrics</title>
<script src="../js/vue.min.js"></script>
<script src="../js/axios.min.js"></script>
<script src="../js/bootstrap-vue.min.js"></script>
<link href="../css/bootstrap.min.css" rel="stylesheet">
<link href="../css/bootstrap-vue.min.css" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="../imgs/favicon.ico" />
</head>
<body>
<div id="app">
<div>
<b-navbar variant="faded" type="light">
<b-navbar-brand href="#">
<img src="../imgs/logo.png" class="d-inline-block align-top" alt="Logo" height="13%" width="13%">
Quality Metrics Project List
</b-navbar-brand>
</b-navbar>
</div>
<div>
<b-navbar type="light" variant="light">
<b-nav-form>
<b-form-input class="mr-sm-2" placeholder="Project Name"></b-form-input>
<b-button variant="outline-success" class="my-2 my-sm-0" type="submit">Search</b-button>
</b-nav-form>
</b-navbar>
</div>
<div>
<b-table-simple hover small caption-top responsive>
<colgroup>
<col>
<col>
</colgroup>
<colgroup>
<col>
<col>
<col>
</colgroup>
<colgroup>
<col>
<col>
</colgroup>
<b-thead head-variant="dark">
<b-tr>
<b-th colspan="1">Project</b-th>
<b-th colspan="1">Jira</b-th>
<b-th colspan="2">VictorOps</b-th>
<b-th colspan="2">Jenkins</b-th>
<b-th colspan="1">UDeploy</b-th>
<b-th colspan="1">Sonar</b-th>
<b-th colspan="2">TestRail</b-th>
</b-tr>
<b-tr>
<b-th>Project Name</b-th>
<b-th>Jira Project</b-th>
<b-th>VictorOps Project</b-th>
<b-th>Routing Key</b-th>
<b-th>Job URL</b-th>
<b-th>Env</b-th>
<b-th>Application Name</b-th>
<b-th>Project Name</b-th>
<b-th>TestRail Project</b-th>
<b-th>Ignore Sections</b-th>
</b-tr>
</b-thead>
<b-tbody v-for="project in projects">
<b-tr>
<b-th>{{project.projectName}}</b-th>
<b-td>{{project.jiraProjectName.join("\n")}}</b-td>
<b-td>{{project.victorOps.projectName.join("\n")}}</b-td>
<b-td>{{project.victorOps.routingKey.join("\n")}}</b-td>
<b-td>{{project.jenkinsJobs}}</b-td>
<b-td>{{project.jenkinsJobs}}</b-td>
<b-td>{{project.udeployApplicationNames.join("\n")}}</b-td>
<b-td>{{project.sonarProject.join("\n")}}</b-td>
<b-td>{{project.testRailProject.project}}</b-td>
<b-td>{{project.testRailProject.ignoreSections}}</b-td>
</b-tr>
</b-tbody>
</b-table-simple>
</div>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
projects: null
}
},
mounted(){
axios.get('http://localhost:8080/projects')
.then(response => {
if (response.data.code == 0) {
this.projects = response.data.data
}
})
.catch(error => {
console.log(error)
return []
})
}
})
</script>
</body>
</html>