module description, styles

This commit is contained in:
DieMyst 2020-12-03 16:43:08 +03:00
parent 518b0942d9
commit 4378d2aa33
3 changed files with 40 additions and 6 deletions

30
src/Info.elm Normal file
View File

@ -0,0 +1,30 @@
module Info exposing (..)
import Dict exposing (Dict)
type alias ModuleDescription =
{ site: String
, description: String
}
getSite : String -> String
getSite name =
modulesDescription |> Dict.get name |> Maybe.map .site |> Maybe.withDefault ""
getDescription : String -> String
getDescription name =
modulesDescription |> Dict.get name |> Maybe.map .description |> Maybe.withDefault "Awesome module without description"
modulesDescription : Dict String ModuleDescription
modulesDescription =
Dict.fromList
[ ("sqlite3", { site = "https://github.com/fluencelabs/sqlite", description = "A database that ported on Wasm"})
, ("history", { site = "https://github.com/fluencelabs/aqua-demo/tree/master/services/history", description = "Middleware that stores history (i.e. chat messages) in sqlite"})
, ("user-list", { site = "https://github.com/fluencelabs/aqua-demo/tree/master/services/user-list", description = "Middleware that stores users with their auth (i.e. chat members) in sqlite"})
, ("redis", { site = "https://github.com/fluencelabs/redis", description = "A database that ported on Wasm"})
, ("curl", { site = "https://github.com/fluencelabs/fce/tree/master/examples/url-downloader/curl", description = "Module that call 'curl' command"})
, ("facade", { site = "https://github.com/fluencelabs/fce/tree/master/examples/url-downloader/facade", description = "An API facade for Url-Downloader app"})
, ("local_storage", { site = "https://github.com/fluencelabs/fce/tree/master/examples/url-downloader/local_storage", description = "Could be used to store data"})
]

View File

@ -1,7 +1,9 @@
module ModulePage.View exposing (..) module ModulePage.View exposing (..)
import Dict exposing (Dict) import Dict exposing (Dict)
import Html exposing (Html, article, div, h3, span, text) import Html exposing (Html, a, article, div, h3, span, text)
import Html.Attributes exposing (attribute)
import Info exposing (getDescription, getSite, modulesDescription)
import Instances.View import Instances.View
import Interface.View exposing (interfaceView) import Interface.View exposing (interfaceView)
import Model exposing (Model) import Model exposing (Model)
@ -59,9 +61,9 @@ moduleToInfo modules id =
{ name = name { name = name
, id = id , id = id
, author = "Fluence Labs" , author = "Fluence Labs"
, authorPeerId = "fluence_labs_peer_id" , authorPeerId = ""
, description = "Excelent module" , description = getDescription m.name
, website = "https://github.com/fluencelabs/" , website = getSite m.name
, moduleInfo = m , moduleInfo = m
} }
) )
@ -74,6 +76,8 @@ viewInfo moduleInfo =
article [ classes "cf" ] article [ classes "cf" ]
[ div [ classes "fl w-30 gray mv1" ] [ text "AUTHOR" ] [ div [ classes "fl w-30 gray mv1" ] [ text "AUTHOR" ]
, div [ classes "fl w-70 mv1" ] [ span [ classes "fl w-100 black b" ] [ text moduleInfo.author ], span [ classes "fl w-100 black" ] [ text moduleInfo.authorPeerId ] ] , div [ classes "fl w-70 mv1" ] [ span [ classes "fl w-100 black b" ] [ text moduleInfo.author ], span [ classes "fl w-100 black" ] [ text moduleInfo.authorPeerId ] ]
, div [ classes "fl w-30 gray mv1" ] [ text "WEBSITE" ]
, div [ classes "fl w-70 mv1" ] [ a [ attribute "href" moduleInfo.website, classes "fl w-100 black" ] [ text moduleInfo.website ] ]
, div [ classes "fl w-30 gray mv1" ] [ text "DESCRIPTION" ] , div [ classes "fl w-30 gray mv1" ] [ text "DESCRIPTION" ]
, div [ classes "fl w-70 mv1" ] [ span [ classes "fl w-100 black" ] [ text moduleInfo.description ] ] , div [ classes "fl w-70 mv1" ] [ span [ classes "fl w-100 black" ] [ text moduleInfo.description ] ]
, div [ classes "fl w-30 gray mv1" ] [ text "INTERFACE" ] , div [ classes "fl w-30 gray mv1" ] [ text "INTERFACE" ]

View File

@ -22,11 +22,11 @@ import { registerService } from 'fluence/dist/globalState';
import { ServiceOne } from 'fluence/dist/service'; import { ServiceOne } from 'fluence/dist/service';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import { Elm } from './Main.elm'; import { Elm } from './Main.elm';
import { faasNet } from './environments'; import {faasNet, stage} from './environments';
const relayIdx = 1; const relayIdx = 1;
export const relays: { peerId: string; multiaddr: string }[] = faasNet; export const relays: { peerId: string; multiaddr: string }[] = stage;
function genFlags(peerId: string): any { function genFlags(peerId: string): any {
return { return {