mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-29 08:29:54 +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>
|
||||
<script>
|
||||
|
||||
this.mixin('rg.router');
|
||||
this.router.add({name: 'home', url: ''});
|
||||
this.router.add({name: 'taglist', url: '/taglist/:repository/:image'});
|
||||
|
||||
this.router.start();
|
||||
this.mixin('rg.router');
|
||||
this.router.add({name: 'home', url: ''});
|
||||
this.router.add({name: 'taglist', url: '/taglist/:repository/:image'});
|
||||
this.router.on('go', state => {
|
||||
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>
|
||||
</app>
|
||||
|
|
|
@ -80,8 +80,7 @@
|
|||
componentHandler.upgradeElements(this['catalog-tag']);
|
||||
});
|
||||
catalog.go = function (image) {
|
||||
rg.router.go('taglist',
|
||||
{
|
||||
rg.router.go('taglist', {
|
||||
repository: image.split('/')[0],
|
||||
image: image.split('/')[1]
|
||||
});
|
||||
|
|
12
taglist.tag
12
taglist.tag
|
@ -48,10 +48,7 @@
|
|||
|
||||
<script>
|
||||
registryUI.taglist.instance = this;
|
||||
|
||||
registryUI.taglist.instance.update();
|
||||
this.on('updated', function () {
|
||||
componentHandler.upgradeElements(this['taglist-tag']);
|
||||
registryUI.taglist.display = function () {
|
||||
if (rg.router.current && rg.router.current.name == 'taglist') {
|
||||
name = rg.router.current.params.repository + (rg.router.current.params.image
|
||||
? '/' + rg.router.current.params.image
|
||||
|
@ -92,8 +89,13 @@
|
|||
oReq.withCredentials = false;
|
||||
oReq.send();
|
||||
}
|
||||
|
||||
};
|
||||
registryUI.taglist.display();
|
||||
registryUI.taglist.instance.update();
|
||||
this.on('updated', function () {
|
||||
componentHandler.upgradeElements(this['taglist-tag']);
|
||||
});
|
||||
|
||||
registryUI.taglist.reverse = function (th) {
|
||||
if (th.className == 'mdl-data-table__header--sorted-ascending') {
|
||||
th.className = 'mdl-data-table__header--sorted-descending';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue