mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-30 00:49:53 +03:00
[rg-router] Fix taglist update
This commit is contained in:
parent
28649c6893
commit
e45c107fe7
3 changed files with 28 additions and 12 deletions
25
app.tag
25
app.tag
|
@ -19,10 +19,25 @@
|
||||||
<taglist if="{rg.router.current.name == 'taglist'}"></taglist>
|
<taglist if="{rg.router.current.name == 'taglist'}"></taglist>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
this.mixin('rg.router');
|
this.mixin('rg.router');
|
||||||
this.router.add({name: 'home', url: ''});
|
this.router.add({name: 'home', url: ''});
|
||||||
this.router.add({name: 'taglist', url: '/taglist/:repository/:image'});
|
this.router.add({name: 'taglist', url: '/taglist/:repository/:image'});
|
||||||
|
this.router.on('go', state => {
|
||||||
this.router.start();
|
switch (state.name) {
|
||||||
|
case 'taglist':
|
||||||
|
if (registryUI.taglist.display) {
|
||||||
|
registryUI.taglist.display();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'home':
|
||||||
|
if (catalog.display) {
|
||||||
|
catalog.display();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.router.start();
|
||||||
</script>
|
</script>
|
||||||
</app>
|
</app>
|
||||||
|
|
|
@ -80,8 +80,7 @@
|
||||||
componentHandler.upgradeElements(this['catalog-tag']);
|
componentHandler.upgradeElements(this['catalog-tag']);
|
||||||
});
|
});
|
||||||
catalog.go = function (image) {
|
catalog.go = function (image) {
|
||||||
rg.router.go('taglist',
|
rg.router.go('taglist', {
|
||||||
{
|
|
||||||
repository: image.split('/')[0],
|
repository: image.split('/')[0],
|
||||||
image: image.split('/')[1]
|
image: image.split('/')[1]
|
||||||
});
|
});
|
||||||
|
|
12
taglist.tag
12
taglist.tag
|
@ -48,10 +48,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
registryUI.taglist.instance = this;
|
registryUI.taglist.instance = this;
|
||||||
|
registryUI.taglist.display = function () {
|
||||||
registryUI.taglist.instance.update();
|
|
||||||
this.on('updated', function () {
|
|
||||||
componentHandler.upgradeElements(this['taglist-tag']);
|
|
||||||
if (rg.router.current && rg.router.current.name == 'taglist') {
|
if (rg.router.current && rg.router.current.name == 'taglist') {
|
||||||
name = rg.router.current.params.repository + (rg.router.current.params.image
|
name = rg.router.current.params.repository + (rg.router.current.params.image
|
||||||
? '/' + rg.router.current.params.image
|
? '/' + rg.router.current.params.image
|
||||||
|
@ -92,8 +89,13 @@
|
||||||
oReq.withCredentials = false;
|
oReq.withCredentials = false;
|
||||||
oReq.send();
|
oReq.send();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
registryUI.taglist.display();
|
||||||
|
registryUI.taglist.instance.update();
|
||||||
|
this.on('updated', function () {
|
||||||
|
componentHandler.upgradeElements(this['taglist-tag']);
|
||||||
});
|
});
|
||||||
|
|
||||||
registryUI.taglist.reverse = function (th) {
|
registryUI.taglist.reverse = function (th) {
|
||||||
if (th.className == 'mdl-data-table__header--sorted-ascending') {
|
if (th.className == 'mdl-data-table__header--sorted-ascending') {
|
||||||
th.className = 'mdl-data-table__header--sorted-descending';
|
th.className = 'mdl-data-table__header--sorted-descending';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue