-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
163 lines (160 loc) · 8.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<html>
<head>
<title>Fancy gradle deps</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="deps.css">
<!-- <script type="text/javascript" src="vue.min.js"></script> -->
<script src="https://cdn.bootcss.com/vue/2.5.9/vue.js"></script>
</head>
<body>
<div id="container">
<div class="file-selectors">
<input v-on:change="handleSelectFile" id="select-file" type="file" value="select a deps file" />
<label class="file-label" for="select-file">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17">
<path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"></path>
</svg> <span id="first-file-name">选择一个文件</span>
</label>
<input v-on:change="handleSelectFile2" type="file" id="select-file2" value="select a deps file" />
<label v-show="firstFileDone" class="file-label" for="select-file2">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17">
<path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"></path>
</svg> <span id="second-file-name">选择另一个文件</span>
</label>
</div>
<div class="deps-title" v-if="deps.length > 0">
<span> {{firstFileName}} </span>
<select v-if="taskNameList.length" v-model="renderedTaskName" v-on:change="selectTask">
<option v-for="task in taskNameList">{{task.name}}</option>
</select>
<span>依赖列表</span>
</div>
<table v-if="deps.length > 0">
<tr>
<th>group</th>
<th>id</th>
<th>version</th>
<th>original version</th>
<th>module</th>
</tr>
<tr v-for="(dep, index) in deps" v-bind:class="{ exp: dep.explicity, imp: !dep.explicity, replaced: dep.versionReplaced && dep.sameDepChains }" v-on:click="expandDep(index)">
<td>{{ dep.group }}</td>
<td>{{ dep.artifact }}</td>
<td>{{ dep.actualVersion }}</td>
<td class="replaced">{{ dep.versionReplaced ? dep.originalVersion : '' }}</td>
<td class="dep-artiface">{{ dep.parent.artifact }}</td>
</tr>
<tr v-if="warn.length">
<td colspan="5">被替换版本的显式依赖列表</td>
</tr>
<tr v-for="w in warn">
<td v-if="w.sameDepChains && w.sameDepChains.length > 0" colspan="5">
<div class="warn-dep">
<div class="warn-title">{{(!w.explicity ? '多个间接依赖版本: ' : '被替换版本的依赖项: ') + w.group + ':' + w.artifact + ':' + (w.explicity ? w.originalVersion + ' -> ' : '') + w.actualVersion }}</div>
<div>
<ul class="dep-chain" v-for="chain in w.sameDepChains" v-bind:class="{'actual-upgrade': !w.explicity || (w != chain[0] && w.actualVersion == chain[0].originalVersion), 'auto-upgrade' : w.originalVersion != chain[0].originalVersion }">
<li v-for="node in chain">
{{ (node.group ? (node.group + ':') : '') + node.artifact + (node.originalVersion ? (':' + node.originalVersion) : '') }}
</li>
</ol>
</div>
</div>
</td>
</tr>
</table>
<transition name="slide-fade">
<div v-on:click="closeDialog" class="fullscreen-modal-dialog" v-if="dialogDep">
<content>
<div class="warn-dep" v-if="dialogDep">
<div class="warn-title">{{ dialogDep.group + ':' + dialogDep.artifact + ':' + dialogDep.originalVersion + (dialogDep.versionReplaced ? (' -> ' + dialogDep.actualVersion) : '') }}</div>
<div>
<span>其他依赖关系:</span>
<ul class="dep-chain" v-for="chain in dialogDep.sameDepChains" v-bind:class="{'actual-upgrade': dialogDep.versionReplaced && dialogDep.actualVersion == chain[0].originalVersion, 'auto-upgrade' : dialogDep.originalVersion != chain[0].originalVersion }">
<li v-for="node in chain">
{{ (node.group ? (node.group + ':') : '') + node.artifact + (node.originalVersion ? (':' + node.originalVersion) : '') }}
</li>
</ul>
</div>
</div>
</content>
</div>
</transition>
<transition name="slide-fade">
<div v-on:click="closeDiffDialog" class="fullscreen-modal-dialog" v-if="showDepDiff">
<content class="diff-dialog">
<span>{{ firstFileName }} ---> {{ secondFileName }}</span>
<select v-if="taskNameList.length" v-model="renderedDiffTaskName" v-on:change="selectDiffTask">
<option v-for="task in diffTaskNameList">{{task.name}}</option>
</select>
<div v-if="addedDeps.length">
<div>
<span>新增依赖项</span></div>
<table>
<tr>
<th>group</th>
<th>id</th>
<th>version</th>
</tr>
<tr v-for="dep in addedDeps">
<td>{{ dep.group }}</td>
<td>{{ dep.artifact }}</td>
<td>{{ dep.actualVersion }}</td>
</tr>
</table>
</div>
<div v-if="upgradedDeps.length">
<div>升级的依赖项</div>
<table>
<tr>
<th>group</th>
<th>id</th>
<th>old version</th>
<th>new version</th>
</tr>
<tr v-for="dep in upgradedDeps">
<td>{{ dep.b.group }}</td>
<td>{{ dep.b.artifact }}</td>
<td>{{ dep.a.actualVersion }}</td>
<td>{{ dep.b.actualVersion }}</td>
</tr>
</table>
</div>
<div v-if="downgradedDeps.length">
<div>降级的依赖项</div>
<table>
<tr>
<th>group</th>
<th>id</th>
<th>old version</th>
<th>new version</th>
</tr>
<tr v-for="dep in downgradedDeps">
<td>{{ dep.b.group }}</td>
<td>{{ dep.b.artifact }}</td>
<td>{{ dep.a.actualVersion }}</td>
<td>{{ dep.b.actualVersion }}</td>
</tr>
</table>
</div>
<div v-if="removedDeps.length">
<div>删除的依赖项</div>
<table>
<tr>
<th>group</th>
<th>id</th>
<th>version</th>
</tr>
<tr v-for="dep in removedDeps">
<td>{{ dep.group }}</td>
<td>{{ dep.artifact }}</td>
<td>{{ dep.actualVersion }}</td>
</tr>
</table>
</div>
</content>
</div>
</transition>
</div>
<script type="text/javascript" src="deps.js"></script>
</body>
</html>