X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/65f13986f98a75f8da7cfe695ea5960ff741d402..3854e6bfcd5344bce5ee0388248cb115e3c5e902:/apps/workbench/app/assets/javascripts/components/collections.js diff --git a/apps/workbench/app/assets/javascripts/components/collections.js b/apps/workbench/app/assets/javascripts/components/collections.js index a2054c1a03..33fca6c7b7 100644 --- a/apps/workbench/app/assets/javascripts/components/collections.js +++ b/apps/workbench/app/assets/javascripts/components/collections.js @@ -47,7 +47,16 @@ window.CollectionsTable = { m('tbody', [ loader.items().map(function(item) { return m('tr', [ - m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')), + m('td', [ + // Guess workbench.{apihostport} is a + // Workbench... unless the host part of + // apihostport is an IPv4 or [IPv6] + // address. + item.session.baseURL.match('://(\\[|\\d+\\.\\d+\\.\\d+\\.\\d+[:/])') ? null : + m('a.btn.btn-xs.btn-default', { + href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid, + }, 'Show'), + ]), m('td.arvados-uuid', item.uuid), m('td', item.name || '(unnamed)'), m('td', m(LocalizedDateTime, {parse: item.modified_at})), @@ -92,8 +101,11 @@ window.CollectionsSearch = { return new MultipageLoader({ sessionKey: key, loadFunc: function(filters) { - if (q) - filters.push(['any', '@@', q+':*']) + var tsquery = to_tsquery(q) + if (tsquery) { + filters = filters.slice(0) + filters.push(['any', '@@', tsquery]) + } return vnode.state.sessionDB.request(session, 'arvados/v1/collections', { data: { filters: JSON.stringify(filters), @@ -116,14 +128,14 @@ window.CollectionsSearch = { return m('form', { onsubmit: function() { vnode.state.searchActive(vnode.state.searchEntered()) - vnode.state.forgetSavedState = true + vnode.state.forgetSavedHeight = true return false }, }, [ m(SaveUIState, { defaultState: '', currentState: vnode.state.searchActive, - forgetSavedState: vnode.state.forgetSavedState, + forgetSavedHeight: vnode.state.forgetSavedHeight, saveBodyHeight: true, }), vnode.state.loader && [