mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2025-04-29 00:19:54 +03:00
[riot-mui] Add riot-mui in remove taf (#17)
When we remove the current server, it will update the view.
This commit is contained in:
parent
dc929951cf
commit
ab0571eaa1
3 changed files with 30 additions and 31 deletions
|
@ -18,7 +18,7 @@ var registryUI = {}
|
|||
registryUI.URL_QUERY_PARAM_REGEX = /[&?]url=/;
|
||||
registryUI.URL_PARAM_REGEX = /^url=/;
|
||||
|
||||
registryUI.url = function() {
|
||||
registryUI.url = function(byPassQueryParam) {
|
||||
if (!registryUI._url) {
|
||||
var url = registryUI.getUrlQueryParam();
|
||||
if (url) {
|
||||
|
@ -78,10 +78,14 @@ registryUI.removeServer = function(url) {
|
|||
}
|
||||
registryServer.splice(index, 1);
|
||||
localStorage.setItem('registryServer', JSON.stringify(registryServer));
|
||||
if (url == registryUI.url()) {
|
||||
registryUI.updateHistory(registryUI.getRegistryServer(0));
|
||||
rg.router.go('home');
|
||||
}
|
||||
}
|
||||
|
||||
registryUI.updateHistory = function(url) {
|
||||
history.pushState(null, '', '?url=' + registryUI.encodeURI(url) + window.location.hash);
|
||||
history.pushState(null, '', (url ? '?url=' + registryUI.encodeURI(url) : '?') + window.location.hash);
|
||||
registryUI._url = url;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue