From 9cab2942bfff5387cb49a33f18ef01fda1457f7a Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Fri, 9 Aug 2019 17:54:24 +0200 Subject: [PATCH] Move static information to HTML template --- frontend/src/Data.elm | 12 +----- frontend/src/Main.elm | 90 ++---------------------------------------- frontend/template.html | 39 ++++++++++++++++++ 3 files changed, 44 insertions(+), 97 deletions(-) diff --git a/frontend/src/Data.elm b/frontend/src/Data.elm index bf14303..fa546ea 100644 --- a/frontend/src/Data.elm +++ b/frontend/src/Data.elm @@ -1,14 +1,4 @@ -module Data exposing (Provider(..), Url, hostname, pathSeparator, repository, servicename, toUrl) - - -repository : String -repository = - "https://git.vbrandl.net/vbrandl/gitache" - - -servicename : String -servicename = - "GitCDN" +module Data exposing (Provider(..), Url, hostname, pathSeparator, toUrl) hostname : String diff --git a/frontend/src/Main.elm b/frontend/src/Main.elm index b829872..1b082ac 100644 --- a/frontend/src/Main.elm +++ b/frontend/src/Main.elm @@ -8,24 +8,9 @@ module Main exposing ) import Browser -import Data exposing (Url, hostname, repository, servicename, toUrl) -import Html - exposing - ( Html - , a - , article - , h1 - , h2 - , input - , li - , nav - , p - , section - , small - , text - , ul - ) -import Html.Attributes exposing (href, placeholder, readonly, style, value) +import Data exposing (Url, hostname, toUrl) +import Html exposing (Html, div, input) +import Html.Attributes exposing (placeholder, readonly, style, value) import Html.Events exposing (onInput) import Parse exposing (parseUrl) @@ -73,80 +58,13 @@ myStyle2 = view : Model -> Html Msg view state = - section myStyle - [ header - , body state - , footer - ] - - -header : Html msg -header = - Html.header [] - [ h1 myStyle [ text servicename ] - ] - - -footer : Html msg -footer = - Html.footer myStyle - [ nav [] - [ ul [] - [ li [] - [ small [] - [ text "Created by " - , a [ href "https://www.vbrandl.net/" ] - [ text "Valentin Brandl" ] - , text "." - ] - ] - ] - ] - , nav [] - [ ul [] - [ li [] - [ small [] - [ a [ href repository ] - [ text "Repository" ] - ] - ] - , li [] - [ small [] - [ a [ href "https://opensource.org/licenses/MIT" ] - [ text "MIT License" ] - ] - ] - ] - ] - ] - - -body : Model -> Html Msg -body state = - article myStyle + div myStyle [ input (myStyle2 [ placeholder "GitHub/GitLab/Bitbucket URL", value state.url, onInput UrlChange ]) [] , input (myStyle2 [ readonly True, value (displayMUrl state.parsed) ]) [] - , h2 myStyle - [ text "Caching" ] - , p myStyle - [ text "Files are cached in the CDN for about one year." ] - , p myStyle - [ text "Redirects for tags and branches are cached for 5 minutes." ] - , h2 myStyle - [ text "Invalidating the Cache" ] - , p myStyle - [ text "To delete a file from the cache, just request the file via HTTP " - , code "DELETE" - ] ] -code : String -> Html msg -code msg = - Html.code [] [ text msg ] - - main : Program () Model Msg main = Browser.sandbox diff --git a/frontend/template.html b/frontend/template.html index 09b3dda..afc37c4 100644 --- a/frontend/template.html +++ b/frontend/template.html @@ -9,11 +9,50 @@ +
+
+

GitCDN

+
+ +
+ +

Caching

+ +

Files from a specific commit are cached in the CDN for one year.

+ +

Redirects for tags and branches are cached for 5 minutes.

+ +

Invalidating the Cache

+ +

To delete a file from the cache, just request the file via HTTP DELETE

+ +
+ + +