diff --git a/modules/restapi/src/main/resources/docspell-openapi.yml b/modules/restapi/src/main/resources/docspell-openapi.yml index 6c8f55308b..30ab5e448f 100644 --- a/modules/restapi/src/main/resources/docspell-openapi.yml +++ b/modules/restapi/src/main/resources/docspell-openapi.yml @@ -24,7 +24,7 @@ externalDocs: url: https://docspell.org servers: - - url: /api/v1 + - url: /andy/api/v1 description: Current host paths: diff --git a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala index aaecc0ddcd..69e20a75ed 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/RestServer.scala @@ -104,30 +104,33 @@ object RestServer { )( wsB: WebSocketBuilder2[F] ) = { + val basePath = cfg.baseUrl.path.asString val templates = TemplateRoutes[F](cfg) val httpApp = Router( - "/internal" -> InternalHeader(internSettings.internalRouteKey) { - internalRoutes(pubSub) - }, - "/api/info" -> routes.InfoRoutes(), - "/api/v1/open/" -> openRoutes(cfg, httpClient, restApp), - "/api/v1/sec/" -> Authenticate(restApp.backend.login, cfg.auth) { token => - securedRoutes(cfg, restApp, wsB, topic, token) - }, - "/api/v1/admin" -> AdminAuth(cfg.adminEndpoint) { - adminRoutes(cfg, restApp) - }, - "/api/v1/share" -> ShareAuth(restApp.backend.share, cfg.auth) { token => - shareRoutes(cfg, restApp, token) - }, - "/api/doc" -> templates.doc, - "/app/assets" -> EnvMiddleware(WebjarRoutes.appRoutes[F]), - "/app" -> EnvMiddleware(templates.app), - "/sw.js" -> EnvMiddleware(templates.serviceWorker), - "/" -> redirectTo("/app") + basePath -> Router( + "internal" -> InternalHeader(internSettings.internalRouteKey) { + internalRoutes(pubSub) + }, + "api/info" -> routes.InfoRoutes(), + "api/v1/open/" -> openRoutes(cfg, httpClient, restApp), + "api/v1/sec/" -> Authenticate(restApp.backend.login, cfg.auth) { token => + securedRoutes(cfg, restApp, wsB, topic, token) + }, + "api/v1/admin" -> AdminAuth(cfg.adminEndpoint) { + adminRoutes(cfg, restApp) + }, + "api/v1/share" -> ShareAuth(restApp.backend.share, cfg.auth) { token => + shareRoutes(cfg, restApp, token) + }, + "api/doc" -> templates.doc, + "app/assets" -> EnvMiddleware(WebjarRoutes.appRoutes[F]), + "app" -> EnvMiddleware(templates.app), + "sw.js" -> EnvMiddleware(templates.serviceWorker), + "" -> redirectTo(basePath + "/app") + ) ).orNotFound - Logger.httpApp(logHeaders = false, logBody = false)(httpApp) + Logger.httpApp(logHeaders = true, logBody = false)(httpApp) } def internalRoutes[F[_]: Async](pubSub: NaivePubSub[F]): HttpRoutes[F] = @@ -156,7 +159,7 @@ object RestServer { "queue" -> JobQueueRoutes(restApp.backend, token), "item" -> ItemRoutes(cfg, restApp.backend, token), "items" -> ItemMultiRoutes(cfg, restApp.backend, token), - "attachment" -> AttachmentRoutes(restApp.backend, token), + "attachment" -> AttachmentRoutes(restApp.backend, cfg, token), "attachments" -> AttachmentMultiRoutes(restApp.backend, token), "upload" -> UploadRoutes.secured(restApp.backend, cfg, token), "checkfile" -> CheckFileRoutes.secured(restApp.backend, token), @@ -211,7 +214,7 @@ object RestServer { ): HttpRoutes[F] = Router( "search" -> ShareSearchRoutes(restApp.backend, cfg, token), - "attachment" -> ShareAttachmentRoutes(restApp.backend, token), + "attachment" -> ShareAttachmentRoutes(restApp.backend, cfg, token), "item" -> ShareItemRoutes(restApp.backend, token) ) diff --git a/modules/restserver/src/main/scala/docspell/restserver/http4s/ClientRequestInfo.scala b/modules/restserver/src/main/scala/docspell/restserver/http4s/ClientRequestInfo.scala index 8d962b78cf..cdde28b036 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/http4s/ClientRequestInfo.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/http4s/ClientRequestInfo.scala @@ -29,7 +29,7 @@ object ClientRequestInfo { host <- getHostname(req) port = xForwardedPort(req).getOrElse(serverPort) hostPort = if (port == 80 || port == 443) host else s"$host:$port" - } yield LenientUri(scheme, Some(hostPort), LenientUri.EmptyPath, None, None) + } yield LenientUri(scheme, Some(hostPort), LenientUri.NonEmptyPath(NonEmptyList.of("andy")), None, None) def getHostname[F[_]](req: Request[F]): Option[String] = xForwardedHost(req) diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala index a7bc4b82c5..ffefb4abaa 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/AttachmentRoutes.scala @@ -15,6 +15,7 @@ import docspell.backend.ops._ import docspell.common.Ident import docspell.common.MakePreviewArgs import docspell.restapi.model._ +import docspell.restserver.Config import docspell.restserver.conv.Conversions import docspell.restserver.http4s.BinaryUtil import docspell.restserver.webapp.Webjars @@ -29,6 +30,7 @@ object AttachmentRoutes { def apply[F[_]: Async]( backend: BackendApp[F], + cfg: Config, user: AuthToken ): HttpRoutes[F] = { val dsl = new Http4sDsl[F] {} @@ -132,8 +134,8 @@ object AttachmentRoutes { case GET -> Root / Ident(id) / "view" => // this route exists to provide a stable url // it redirects currently to viewerjs - val attachUrl = s"/api/v1/sec/attachment/${id.id}" - val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl" + val attachUrl = s"${cfg.baseUrl.path.asString}/api/v1/sec/attachment/${id.id}" + val path = s"${cfg.baseUrl.path.asString}/app/assets${Webjars.viewerjs}/index.html#$attachUrl" SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path)))) case GET -> Root / Ident(id) / "meta" => diff --git a/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala index b93a138136..28dbb9e954 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/routes/ShareAttachmentRoutes.scala @@ -12,6 +12,7 @@ import cats.implicits._ import docspell.backend.BackendApp import docspell.backend.auth.ShareToken import docspell.common._ +import docspell.restserver.Config import docspell.restserver.http4s.BinaryUtil import docspell.restserver.webapp.Webjars @@ -23,6 +24,7 @@ object ShareAttachmentRoutes { def apply[F[_]: Async]( backend: BackendApp[F], + cfg: Config, token: ShareToken ): HttpRoutes[F] = { val dsl = new Http4sDsl[F] {} @@ -44,8 +46,8 @@ object ShareAttachmentRoutes { case GET -> Root / Ident(id) / "view" => // this route exists to provide a stable url // it redirects currently to viewerjs - val attachUrl = s"/api/v1/share/attachment/${id.id}" - val path = s"/app/assets${Webjars.viewerjs}/index.html#$attachUrl" + val attachUrl = s"${cfg.baseUrl.path.asString}/api/v1/share/attachment/${id.id}" + val path = s"${cfg.baseUrl.path.asString}/app/assets${Webjars.viewerjs}/index.html#$attachUrl" SeeOther(Location(Uri(path = Uri.Path.unsafeFromString(path)))) case req @ GET -> Root / Ident(id) / "preview" => diff --git a/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala b/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala index 393b2be896..44beaf49cc 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/webapp/Flags.scala @@ -35,7 +35,7 @@ object Flags { cfg.appName, getBaseUrl(cfg), cfg.backend.signup.mode, - s"/app/assets/docspell-webapp/${BuildInfo.version}", + s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}", cfg.integrationEndpoint.enabled, cfg.fullTextSearch.enabled, cfg.maxItemPageSize, diff --git a/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala b/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala index 43ed9a5baa..e60fa97f1c 100644 --- a/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala +++ b/modules/restserver/src/main/scala/docspell/restserver/webapp/TemplateRoutes.scala @@ -39,10 +39,10 @@ object TemplateRoutes { def apply[F[_]: Async](cfg: Config): InnerRoutes[F] = { val indexTemplate = memo( - loadResource("/index.html").flatMap(loadTemplate(_)) + loadResource(s"/index.html").flatMap(loadTemplate(_)) ) - val docTemplate = memo(loadResource("/doc.html").flatMap(loadTemplate(_))) - val swTemplate = memo(loadResource("/sw.js").flatMap(loadTemplate(_))) + val docTemplate = memo(loadResource(s"/doc.html").flatMap(loadTemplate(_))) + val swTemplate = memo(loadResource(s"/sw.js").flatMap(loadTemplate(_))) val dsl = new Http4sDsl[F] {} import dsl._ @@ -52,7 +52,7 @@ object TemplateRoutes { for { templ <- docTemplate resp <- Ok( - DocData().render(templ), + DocData(cfg).render(templ), `Content-Type`(textHtml, Charset.`UTF-8`) ) } yield resp @@ -108,10 +108,10 @@ object TemplateRoutes { case class DocData(swaggerRoot: String, openapiSpec: String) object DocData { - def apply(): DocData = + def apply(cfg: Config): DocData = DocData( - "/app/assets" + Webjars.swaggerui, - s"/app/assets/${BuildInfo.name}/${BuildInfo.version}/docspell-openapi.yml" + cfg.baseUrl.path.asString + "/app/assets" + Webjars.swaggerui, + s"${cfg.baseUrl.path.asString}/app/assets/${BuildInfo.name}/${BuildInfo.version}/docspell-openapi.yml" ) implicit def yamuscaValueConverter: ValueConverter[DocData] = @@ -133,19 +133,19 @@ object TemplateRoutes { def apply(cfg: Config): IndexData = IndexData( Flags(cfg, uiVersion), - chooseUi, + chooseUi(cfg), Seq( - "/app/assets" + Webjars.clipboardjs + "/clipboard.min.js", - s"/app/assets/docspell-webapp/${BuildInfo.version}/docspell-app.js", - s"/app/assets/docspell-webapp/${BuildInfo.version}/docspell-query-opt.js" + cfg.baseUrl.path.asString + "/app/assets" + Webjars.clipboardjs + "/clipboard.min.js", + s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}/docspell-app.js", + s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}/docspell-query-opt.js" ), - s"/app/assets/docspell-webapp/${BuildInfo.version}/favicon", - s"/app/assets/docspell-webapp/${BuildInfo.version}/docspell.js", + s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}/favicon", + s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}/docspell.js", Flags(cfg, uiVersion).asJson.spaces2 ) - private def chooseUi: Seq[String] = - Seq(s"/app/assets/docspell-webapp/${BuildInfo.version}/css/styles.css") + private def chooseUi(cfg: Config): Seq[String] = + Seq(s"${cfg.baseUrl.path.asString}/app/assets/docspell-webapp/${BuildInfo.version}/css/styles.css") implicit def yamuscaValueConverter: ValueConverter[IndexData] = ValueConverter.deriveConverter[IndexData] diff --git a/modules/restserver/src/main/templates/index.html b/modules/restserver/src/main/templates/index.html index a94abf75cf..3a07d8226f 100644 --- a/modules/restserver/src/main/templates/index.html +++ b/modules/restserver/src/main/templates/index.html @@ -66,7 +66,7 @@ diff --git a/modules/webapp/src/main/elm/Api.elm b/modules/webapp/src/main/elm/Api.elm index 1d719f5cbe..493c23a71d 100644 --- a/modules/webapp/src/main/elm/Api.elm +++ b/modules/webapp/src/main/elm/Api.elm @@ -1940,19 +1940,19 @@ reprocessItem flags itemId attachIds receive = } -attachmentPreviewURL : String -> String -attachmentPreviewURL id = - "/api/v1/sec/attachment/" ++ id ++ "/preview?withFallback=true" +attachmentPreviewURL : Flags -> String -> String +attachmentPreviewURL flags id = + flags.config.baseUrl ++ "/api/v1/sec/attachment/" ++ id ++ "/preview?withFallback=true" -itemBasePreviewURL : String -> String -itemBasePreviewURL itemId = - "/api/v1/sec/item/" ++ itemId ++ "/preview?withFallback=true" +itemBasePreviewURL : Flags -> String -> String +itemBasePreviewURL flags itemId = + flags.config.baseUrl ++ "/api/v1/sec/item/" ++ itemId ++ "/preview?withFallback=true" -fileURL : String -> String -fileURL attachId = - "/api/v1/sec/attachment/" ++ attachId +fileURL : Flags -> String -> String +fileURL flags attachId = + flags.config.baseUrl ++ "/api/v1/sec/attachment/" ++ attachId setAttachmentName : diff --git a/modules/webapp/src/main/elm/App/Update.elm b/modules/webapp/src/main/elm/App/Update.elm index 20e513594f..0ae3b98216 100644 --- a/modules/webapp/src/main/elm/App/Update.elm +++ b/modules/webapp/src/main/elm/App/Update.elm @@ -232,7 +232,7 @@ updateWithSub msg model = NavRequest req -> case req of Internal url -> - if String.startsWith "/app" url.path then + if String.contains "/app" url.path then let isCurrent = Page.fromUrl url diff --git a/modules/webapp/src/main/elm/Comp/ItemCard.elm b/modules/webapp/src/main/elm/Comp/ItemCard.elm index e240913105..4217fe05ad 100644 --- a/modules/webapp/src/main/elm/Comp/ItemCard.elm +++ b/modules/webapp/src/main/elm/Comp/ItemCard.elm @@ -202,7 +202,7 @@ viewRow texts cfg settings flags model item = attachUrl = Maybe.map mkAttachUrl mainAttach - |> Maybe.withDefault "/api/v1/sec/attachment/none" + |> Maybe.withDefault "/andy/api/v1/sec/attachment/none" fieldHidden f = Data.UiSettings.fieldHidden settings f @@ -844,7 +844,7 @@ previewMenu2 texts settings flags cfg model item mainAttach = attachUrl = Maybe.map mkAttachUrl mainAttach - |> Maybe.withDefault "/api/v1/sec/attachment/none" + |> Maybe.withDefault "/andy/api/v1/sec/attachment/none" dueDate = IT.render IT.dueDateShort (templateCtx texts) item diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/ShowQrCode.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/ShowQrCode.elm index a6e3a96f25..0fc0c92c7c 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/ShowQrCode.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/ShowQrCode.elm @@ -8,13 +8,11 @@ module Comp.ItemDetail.ShowQrCode exposing (UrlId(..), qrCodeElementId, view, view1) import Api -import Comp.Basic as B import Comp.ItemDetail.Model exposing (Model, Msg(..), isShowQrAttach, isShowQrItem) import Comp.MenuBar as MB import Data.Flags exposing (Flags) import Html exposing (..) import Html.Attributes exposing (..) -import Html.Events exposing (onClick) import QRCode import Styles as S import Svg.Attributes as SvgA @@ -44,7 +42,7 @@ view1 flags classes urlId = docUrl = case urlId of Attach str -> - flags.config.baseUrl ++ Api.fileURL str + flags.config.baseUrl ++ Api.fileURL flags str Item str -> flags.config.baseUrl ++ "/app/item/" ++ str diff --git a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm index 7c8bd0fb02..786668f27c 100644 --- a/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm +++ b/modules/webapp/src/main/elm/Comp/ItemDetail/SingleAttachment.elm @@ -42,7 +42,7 @@ view : Texts -> Flags -> UiSettings -> Model -> Int -> Attachment -> Html Msg view texts flags settings model pos attach = let fileUrl = - Api.fileURL attach.id + Api.fileURL flags attach.id in div [ class "flex flex-col md:relative h-full mb-2" @@ -55,10 +55,10 @@ view texts flags settings model pos attach = [ class "flex flex-row px-2 py-2 text-sm" , class S.border ] - [ attachHeader texts settings model pos attach + [ attachHeader texts flags settings model pos attach ] , editAttachmentName model attach - , attachmentSelect texts model pos attach + , attachmentSelect texts flags model pos attach , if isAttachMetaOpen model attach.id then case Dict.get attach.id model.attachMeta of Just am -> @@ -110,14 +110,14 @@ view texts flags settings model pos attach = - native view -} -attachHeader : Texts -> UiSettings -> Model -> Int -> Attachment -> Html Msg -attachHeader texts settings model _ attach = +attachHeader : Texts -> Flags -> UiSettings -> Model -> Int -> Attachment -> Html Msg +attachHeader texts flags _ model _ attach = let attachName = Maybe.withDefault texts.noName attach.name fileUrl = - Api.fileURL attach.id + Api.fileURL flags attach.id hasArchive = List.map .id model.item.archives @@ -346,8 +346,8 @@ editAttachmentName model attach = span [ class "hidden" ] [] -attachmentSelect : Texts -> Model -> Int -> Attachment -> Html Msg -attachmentSelect texts model _ _ = +attachmentSelect : Texts -> Flags -> Model -> Int -> Attachment -> Html Msg +attachmentSelect texts flags model _ _ = div [ class "flex flex-row border-l border-r px-2 py-2 dark:border-slate-600 " , class "overflow-x-auto overflow-y-none" @@ -355,11 +355,11 @@ attachmentSelect texts model _ _ = [ ( "hidden", not model.attachMenuOpen ) ] ] - (List.indexedMap (menuItem texts model) model.item.attachments) + (List.indexedMap (menuItem texts flags model) model.item.attachments) -menuItem : Texts -> Model -> Int -> Attachment -> Html Msg -menuItem texts model pos attach = +menuItem : Texts -> Flags -> Model -> Int -> Attachment -> Html Msg +menuItem texts flags model pos attach = let highlight = let @@ -427,7 +427,7 @@ menuItem texts model pos attach = ] , div [ class "flex-grow" ] [ img - [ src (Api.attachmentPreviewURL attach.id) + [ src (Api.attachmentPreviewURL flags attach.id) , class "block w-20 mx-auto" ] [] diff --git a/modules/webapp/src/main/elm/Comp/ItemMerge.elm b/modules/webapp/src/main/elm/Comp/ItemMerge.elm index 03b52e8edd..936d56b5aa 100644 --- a/modules/webapp/src/main/elm/Comp/ItemMerge.elm +++ b/modules/webapp/src/main/elm/Comp/ItemMerge.elm @@ -229,8 +229,8 @@ flatten list = --- View -view : Texts -> UiSettings -> Model -> Html Msg -view texts settings model = +view : Texts -> Flags -> UiSettings -> Model -> Html Msg +view texts flags settings model = div [ class "px-2 mb-4" ] [ h1 [ class S.header1 ] [ text texts.title @@ -275,15 +275,15 @@ view texts settings model = } , renderFormState texts model , div [ class "flex-col px-2" ] - (List.indexedMap (itemCard texts settings model) model.items) + (List.indexedMap (itemCard texts flags settings model) model.items) ] -itemCard : Texts -> UiSettings -> Model -> Int -> ItemLight -> Html Msg -itemCard texts settings model index item = +itemCard : Texts -> Flags -> UiSettings -> Model -> Int -> ItemLight -> Html Msg +itemCard texts flags settings model index item = let previewUrl = - Api.itemBasePreviewURL item.id + Api.itemBasePreviewURL flags item.id fieldHidden f = Data.UiSettings.fieldHidden settings f diff --git a/modules/webapp/src/main/elm/Main.elm b/modules/webapp/src/main/elm/Main.elm index 3569ad5c95..be94b7fff8 100644 --- a/modules/webapp/src/main/elm/Main.elm +++ b/modules/webapp/src/main/elm/Main.elm @@ -14,7 +14,6 @@ import App.View2 import Browser exposing (Document) import Browser.Navigation exposing (Key) import Data.Flags exposing (Flags) -import Data.NotificationChannel import Data.UiSettings import Html exposing (..) import Html.Attributes exposing (..) diff --git a/modules/webapp/src/main/elm/Page.elm b/modules/webapp/src/main/elm/Page.elm index a14e529513..9fb8cc45c7 100644 --- a/modules/webapp/src/main/elm/Page.elm +++ b/modules/webapp/src/main/elm/Page.elm @@ -27,6 +27,7 @@ module Page exposing ) import Browser.Navigation as Nav +import Data.Flags exposing (Flags) import Html exposing (Attribute) import Html.Attributes as Attr import Url exposing (Url) @@ -227,50 +228,51 @@ pageToString : Page -> String pageToString page = case page of HomePage -> - "/app/home" + "/andy" ++ "/app/home" LoginPage data -> case data.referrer of Just (LoginPage _) -> - "/app/login" + "/andy" ++ "/app/login" Just p -> - "/app/login?r=" ++ pageToString p + String.concat [ "/andy", "/app/login?r=", pageToString p ] Nothing -> - "/app/login" + "/andy" ++ "/app/login" ManageDataPage -> - "/app/managedata" + "/andy" ++ "/app/managedata" CollectiveSettingPage -> - "/app/csettings" + "/andy" ++ "/app/csettings" UserSettingPage -> - "/app/usettings" + "/andy" ++ "/app/usettings" QueuePage -> - "/app/queue" + "/andy" ++ "/app/queue" RegisterPage -> - "/app/register" + "/andy" ++ "/app/register" UploadPage sourceId -> Maybe.map (\id -> "/" ++ id) sourceId |> Maybe.withDefault "" + |> (++) "/andy" |> (++) "/app/upload" NewInvitePage -> - "/app/newinvite" + "/andy" ++ "/app/newinvite" ItemDetailPage id -> - "/app/item/" ++ id + "/andy" ++ "/app/item/" ++ id SharePage id -> - "/app/share/" ++ id + "/andy" ++ "/app/share/" ++ id ShareDetailPage shareId itemId -> - "/app/share/" ++ shareId ++ "/" ++ itemId + "/andy" ++ "/app/share/" ++ shareId ++ "/" ++ itemId pageFromString : String -> Maybe Page @@ -304,6 +306,11 @@ goto page = Nav.load (pageToString page) +basePath : String +basePath = + "andy" + + pathPrefix : String pathPrefix = "app" @@ -315,21 +322,21 @@ parser = [ Parser.map HomePage (oneOf [ Parser.top - , s pathPrefix s "home" + , s basePath s pathPrefix s "home" ] ) - , Parser.map LoginPage (s pathPrefix s "login" loginPageParser) - , Parser.map ManageDataPage (s pathPrefix s "managedata") - , Parser.map CollectiveSettingPage (s pathPrefix s "csettings") - , Parser.map UserSettingPage (s pathPrefix s "usettings") - , Parser.map QueuePage (s pathPrefix s "queue") - , Parser.map RegisterPage (s pathPrefix s "register") - , Parser.map (\s -> UploadPage (Just s)) (s pathPrefix s "upload" string) - , Parser.map (UploadPage Nothing) (s pathPrefix s "upload") - , Parser.map NewInvitePage (s pathPrefix s "newinvite") - , Parser.map ItemDetailPage (s pathPrefix s "item" string) - , Parser.map ShareDetailPage (s pathPrefix s "share" string string) - , Parser.map SharePage (s pathPrefix s "share" string) + , Parser.map LoginPage (s basePath s pathPrefix s "login" loginPageParser) + , Parser.map ManageDataPage (s basePath s pathPrefix s "managedata") + , Parser.map CollectiveSettingPage (s basePath s pathPrefix s "csettings") + , Parser.map UserSettingPage (s basePath s pathPrefix s "usettings") + , Parser.map QueuePage (s basePath s pathPrefix s "queue") + , Parser.map RegisterPage (s basePath s pathPrefix s "register") + , Parser.map (\s -> UploadPage (Just s)) (s basePath s pathPrefix s "upload" string) + , Parser.map (UploadPage Nothing) (s basePath s pathPrefix s "upload") + , Parser.map NewInvitePage (s basePath s pathPrefix s "newinvite") + , Parser.map ItemDetailPage (s basePath s pathPrefix s "item" string) + , Parser.map ShareDetailPage (s basePath s pathPrefix s "share" string string) + , Parser.map SharePage (s basePath s pathPrefix s "share" string) ] diff --git a/modules/webapp/src/main/elm/Page/Home/View2.elm b/modules/webapp/src/main/elm/Page/Home/View2.elm index 3f4bf2b139..3b4984747c 100644 --- a/modules/webapp/src/main/elm/Page/Home/View2.elm +++ b/modules/webapp/src/main/elm/Page/Home/View2.elm @@ -74,7 +74,7 @@ mainView texts flags settings model = MergeSelected -> Just [ div [ class "sm:relative mb-2" ] - (itemMergeView texts settings svm) + (itemMergeView texts flags settings svm) ] PublishSelected -> @@ -113,15 +113,15 @@ itemPublishView texts settings flags svm = ] -itemMergeView : Texts -> UiSettings -> SelectViewModel -> List (Html Msg) -itemMergeView texts settings svm = +itemMergeView : Texts -> Flags -> UiSettings -> SelectViewModel -> List (Html Msg) +itemMergeView texts flags settings svm = [ Html.map MergeItemsMsg - (Comp.ItemMerge.view texts.itemMerge settings svm.mergeModel) + (Comp.ItemMerge.view texts.itemMerge flags settings svm.mergeModel) ] publishResults : Texts -> UiSettings -> Flags -> Model -> Comp.PublishItems.Model -> List (Html Msg) -publishResults texts settings flags model pm = +publishResults texts settings flags _ pm = [ Html.map PublishViewMsg (Comp.PublishItems.view texts.publishItems settings flags pm) ] @@ -524,17 +524,17 @@ itemCardList : Texts -> Flags -> UiSettings -> Model -> List (Html Msg) itemCardList texts flags settings model = let previewUrl attach = - Api.attachmentPreviewURL attach.id + Api.attachmentPreviewURL flags attach.id previewUrlFallback item = - Api.itemBasePreviewURL item.id + Api.itemBasePreviewURL flags item.id viewCfg sel = { current = model.scrollToCard , selection = sel , previewUrl = previewUrl , previewUrlFallback = previewUrlFallback - , attachUrl = .id >> Api.fileURL + , attachUrl = .id >> Api.fileURL flags , detailPage = .id >> ItemDetailPage , arrange = settings.itemSearchArrange , showGroups = settings.itemSearchShowGroups diff --git a/modules/webapp/src/main/webjar/docspell.js b/modules/webapp/src/main/webjar/docspell.js index 4b32212e76..8ca180b407 100644 --- a/modules/webapp/src/main/webjar/docspell.js +++ b/modules/webapp/src/main/webjar/docspell.js @@ -153,7 +153,7 @@ function closeWS() { function initWS() { closeWS(); var protocol = (window.location.protocol === 'https:') ? 'wss:' : 'ws:'; - var url = protocol + '//' + window.location.host + '/api/v1/sec/ws'; + var url = protocol + '//' + window.location.host + '/andy/api/v1/sec/ws'; console.log("Initialize websocket at " + url); dsWebSocket = new WebSocket(url); dsWebSocket.addEventListener("message", function(event) {