Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature: Overview of tag history content #58

Merged
merged 31 commits into from
Dec 8, 2018
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
20861bb
Add .idea directory to .ignore
lennartblom Nov 30, 2018
3b1b6f2
Add new "tag-history" column for tag overview
lennartblom Nov 30, 2018
3f860cd
Define taghistory object
lennartblom Nov 30, 2018
96a9266
Include tag-history-button
lennartblom Nov 30, 2018
fe5e962
Format code
lennartblom Nov 30, 2018
c857bd8
Add functionality for new tag history view
lennartblom Nov 30, 2018
8ab6ecb
Define dynamic parsing of history elements
lennartblom Dec 1, 2018
f6bc4df
Styling elements and getting structure into data view
lennartblom Dec 1, 2018
6d798ca
Styling of history element headlines
lennartblom Dec 1, 2018
5bb7dfc
Optimize date format
lennartblom Dec 1, 2018
cf883cb
Optimize routing and code format
lennartblom Dec 1, 2018
66fe613
Optimize format
lennartblom Dec 1, 2018
39cf28e
Remove logging and format code
lennartblom Dec 1, 2018
f364564
Remove logging
lennartblom Dec 1, 2018
43af3ff
Remove logging
lennartblom Dec 1, 2018
86f78f7
Remove instance usage of registryUI.taghistory
lennartblom Dec 1, 2018
6d849a9
Add information text about the history elements
lennartblom Dec 1, 2018
292336c
Format code
lennartblom Dec 1, 2018
bf975cd
Formate code
lennartblom Dec 1, 2018
b94a65d
Remove space in front of function brackets
lennartblom Dec 2, 2018
246369f
Move go function to taghistory-namespace within app.tag
lennartblom Dec 2, 2018
e3437da
Use toLocaleString() instead of custom date format
lennartblom Dec 2, 2018
249d021
Formate code
lennartblom Dec 2, 2018
ae78b2d
Fix navigation bug
lennartblom Dec 3, 2018
472b485
Remove test logging
lennartblom Dec 3, 2018
04259ab
Change wording of headline
lennartblom Dec 6, 2018
06a11a7
Merge remote-tracking branch 'origin/master'
lennartblom Dec 6, 2018
67ad46a
Change wording of headline
lennartblom Dec 6, 2018
c176a08
Change wording of headline
lennartblom Dec 6, 2018
7163150
Optimize GUI elements and HTTP logic for content preperation
lennartblom Dec 6, 2018
4aa0160
Add more const
Joxit Dec 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add new "tag-history" column for tag overview
  • Loading branch information
lennartblom committed Nov 30, 2018
commit 3b1b6f2e721876c273c426b1154e0d493c2e273f
1 change: 1 addition & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
<!-- endbuild -->
<!-- build:js scripts/docker-registry-ui.js -->
<script src="tags/catalog.tag" type="riot/tag"></script>
<script src="tags/tag-history.tag" type="riot/tag"></script>
<script src="tags/taglist.tag" type="riot/tag"></script>
<script src="tags/image-tag.tag" type="riot/tag"></script>
<script src="tags/remove-image.tag" type="riot/tag"></script>
11 changes: 11 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -322,6 +322,17 @@ select {
padding: 12px 5px;
}

.show-tag-history {
width: 30px;
text-align: center;
}

.remove-tag {
padding: 12px 5px;
width: 30px;
lennartblom marked this conversation as resolved.
Show resolved Hide resolved
text-align: center;
}

.copy-to-clipboard a:hover {
cursor: pointer;
}
21 changes: 21 additions & 0 deletions src/tags/tag-history.tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
Copyright (C) 2016-2018 Jones Magloire @Joxit

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<tag-history>
<a href="#" title="This will show the history of given tag" onclick="">
<i class="material-icons">history</i>
</a>
</tag-history>
209 changes: 111 additions & 98 deletions src/tags/taglist.tag
Original file line number Diff line number Diff line change
@@ -1,107 +1,120 @@
<!--
Copyright (C) 2016 Jones Magloire @Joxit
Copyright (C) 2016 Jones Magloire @Joxit

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<taglist>
<!-- Begin of tag -->
<material-card ref="taglist-tag" class="taglist">
<div class="material-card-title-action">
<a href="#!" onclick="registryUI.home();">
<i class="material-icons">arrow_back</i>
</a>
<h2>Tags of { registryUI.name() + '/' + registryUI.taglist.name }</h2>
</div>
<div hide="{ registryUI.taglist.loadend }" class="spinner-wrapper">
<material-spinner></material-spinner>
</div>
<table show="{ registryUI.taglist.loadend }" style="border: none;">
<thead>
<tr>
<th class="material-card-th-left">Repository</th>
<th></th>
<th>Creation date</th>
<th>Size</th>
<th class="{ registryUI.taglist.asc ? 'material-card-th-sorted-ascending' : 'material-card-th-sorted-descending' }" onclick="registryUI.taglist.reverse();">Tag</th>
<th show="{ registryUI.isImageRemoveActivated }"></th>
</tr>
</thead>
<tbody>
<tr each="{ image in registryUI.taglist.tags }">
<td class="material-card-th-left">{ image.name }</td>
<td class="copy-to-clipboard">
<copy-to-clipboard image={ image }/>
</td>
<td><image-date image="{ image }" /></td>
<td><image-size image="{ image }" /></td>
<td><image-tag image="{ image }" /></td>
<td show="{ registryUI.isImageRemoveActivated }">
<remove-image image={ image }/>
</td>
</tr>
</tbody>
</table>
</material-card>
<script>
registryUI.taglist.instance = this;
registryUI.taglist.display = function () {
registryUI.taglist.tags = [];
if (route.routeName == 'taglist') {
var oReq = new Http();
registryUI.taglist.instance.update();
oReq.addEventListener('load', function () {
registryUI.taglist.tags = [];
if (this.status == 200) {
registryUI.taglist.tags = JSON.parse(this.responseText).tags || [];
registryUI.taglist.tags = registryUI.taglist.tags.map(function(tag) {
return new registryUI.DockerImage(registryUI.taglist.name, tag);
}).sort(registryUI.DockerImage.compare);
} else if (this.status == 404) {
registryUI.snackbar('Server not found', true);
} else {
registryUI.snackbar(this.responseText, true);
}
});
oReq.addEventListener('error', function () {
registryUI.snackbar(this.getErrorMessage(), true);
<!-- Begin of tag -->
<material-card ref="taglist-tag" class="taglist">
<div class="material-card-title-action">
<a href="#!" onclick="registryUI.home();">
<i class="material-icons">arrow_back</i>
</a>
<h2>Tags of { registryUI.name() + '/' + registryUI.taglist.name }</h2>
</div>
<div hide="{ registryUI.taglist.loadend }" class="spinner-wrapper">
<material-spinner></material-spinner>
</div>
<table show="{ registryUI.taglist.loadend }" style="border: none;">
<thead>
<tr>
<th class="material-card-th-left">Repository</th>
<th></th>
<th>Creation date</th>
<th>Size</th>

<th class="{ registryUI.taglist.asc ? 'material-card-th-sorted-ascending' : 'material-card-th-sorted-descending' }"
onclick="registryUI.taglist.reverse();">Tag
</th>
<th class="show-tag-history">History</th>
<th class="remove-tag" show="{ registryUI.isImageRemoveActivated }"></th>
</tr>
</thead>
<tbody>
<tr each="{ image in registryUI.taglist.tags }">
<td class="material-card-th-left">{ image.name }</td>
<td class="copy-to-clipboard">
<copy-to-clipboard image={ image }/>
</td>
<td>
<image-date image="{ image }"/>
</td>
<td>
<image-size image="{ image }"/>
</td>
<td>
<image-tag image="{ image }"/>
</td>
<td class="show-tag-history">
<tag-history image={ image } />
</td>
<td show="{ registryUI.isImageRemoveActivated }">
<remove-image image={ image }/>
</td>
</tr>
</tbody>
</table>
</material-card>
<script>
registryUI.taglist.instance = this;
registryUI.taglist.display = function () {
registryUI.taglist.tags = [];
});
oReq.addEventListener('loadend', function () {
registryUI.taglist.loadend = true;
registryUI.taglist.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/' + registryUI.taglist.name + '/tags/list');
oReq.send();
registryUI.taglist.asc = true;
}
};
registryUI.taglist.display();
registryUI.taglist.instance.update();
if (route.routeName == 'taglist') {
var oReq = new Http();
registryUI.taglist.instance.update();
oReq.addEventListener('load', function () {
registryUI.taglist.tags = [];
if (this.status == 200) {
registryUI.taglist.tags = JSON.parse(this.responseText).tags || [];
registryUI.taglist.tags = registryUI.taglist.tags.map(function (tag) {
return new registryUI.DockerImage(registryUI.taglist.name, tag);
}).sort(registryUI.DockerImage.compare);
} else if (this.status == 404) {
registryUI.snackbar('Server not found', true);
} else {
registryUI.snackbar(this.responseText, true);
}
});
oReq.addEventListener('error', function () {
registryUI.snackbar(this.getErrorMessage(), true);
registryUI.taglist.tags = [];
});
oReq.addEventListener('loadend', function () {
registryUI.taglist.loadend = true;
registryUI.taglist.instance.update();
});
oReq.open('GET', registryUI.url() + '/v2/' + registryUI.taglist.name + '/tags/list');
oReq.send();
registryUI.taglist.asc = true;
}
};
registryUI.taglist.display();
registryUI.taglist.instance.update();

registryUI.taglist.reverse = function () {
if (registryUI.taglist.asc) {
registryUI.taglist.tags.reverse();
registryUI.taglist.asc = false;
} else {
registryUI.taglist.tags.sort(registryUI.DockerImage.compare);
registryUI.taglist.asc = true;
}
registryUI.taglist.instance.update();
};
registryUI.taglist.refresh = function () {
route(registryUI.taglist.name);
};
</script>
<!-- End of tag -->
registryUI.taglist.reverse = function () {
if (registryUI.taglist.asc) {
registryUI.taglist.tags.reverse();
registryUI.taglist.asc = false;
} else {
registryUI.taglist.tags.sort(registryUI.DockerImage.compare);
registryUI.taglist.asc = true;
}
registryUI.taglist.instance.update();
};
registryUI.taglist.refresh = function () {
route(registryUI.taglist.name);
};
</script>
<!-- End of tag -->
</taglist>