mirror of
https://github.com/Joxit/docker-registry-ui.git
synced 2026-05-23 04:42:47 +00:00
feat: merge static version with latest and add license
BREAKING CHANGE: Now only one tag will be published: `latest`. This tag will include both the standard and latest version
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import { router, getCurrentRoute } from '@riotjs/route';
|
||||
import { encodeURI } from './utils';
|
||||
import { encodeURI, decodeURI } from './utils';
|
||||
|
||||
function getQueryParams() {
|
||||
const queries = {};
|
||||
@@ -44,7 +44,7 @@ function updateQueryParams(qs) {
|
||||
function toSearchString(queries) {
|
||||
let search = [];
|
||||
for (let key in queries) {
|
||||
if (queries[key] !== undefined) {
|
||||
if (key && queries[key] !== undefined) {
|
||||
search.push(`${key}=${queries[key]}`);
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,17 @@ export default {
|
||||
updateUrlQueryParam(url) {
|
||||
this.updateQueryString({ url: encodeURI(url) });
|
||||
},
|
||||
getUrlQueryParam() {
|
||||
const queries = getQueryParams();
|
||||
const url = queries['url'];
|
||||
if (url) {
|
||||
try {
|
||||
return decodeURI(url);
|
||||
} catch (e) {
|
||||
console.error(`Can't decode query parameter URL: ${url}`, e);
|
||||
}
|
||||
}
|
||||
},
|
||||
updatePageQueryParam(page) {
|
||||
this.updateQueryString({ page });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user