1
0
Fork 0

deploy pages

This commit is contained in:
setop 2024-11-27 21:34:02 +01:00
parent 72071df374
commit bbac94607f
5 changed files with 5444 additions and 174 deletions

View File

@ -1,19 +0,0 @@
Implements naming convention based on resource properies, such as type, location, role, application code
Requirement : name must update in real time when properties are edited (no stale result).
# TODO
- [x] virtual machines
- [x] code
- [x] region
- [x] environment
- [x] role
- [x] increment
- [ ] other resource type
- [ ] resource group
- [ ] storage account
- [ ] some styling
- [ ] propose some links (azure web console, datadog, leanix)
- [ ] lookup code from app name with fuzzy search (try native component at first)

View File

@ -1,24 +0,0 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/browser": "1.0.2",
"elm/core": "1.0.5",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.1.3",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.3"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}

5444
public/index.html Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,127 +0,0 @@
module Main exposing (..)
import Browser
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
main =
Browser.sandbox
{ init = init
, view = view
, update = update
}
init =
{ reg = "EW", code = "zz", env = "P", role = "APP", incr = 1 }
regions =
[ ( "EW", "West Europe, Amsterdam" )
, ( "EN", "North Europe, Dublin" )
]
roles =
[ ( "APP", "Application Server" )
, ( "WEB", "Web Server" )
, ( "DBA", "Database" )
, ( "RDS", "Remote Desktop Server" )
]
envs =
[ ( "P", "Production" )
, ( "E", "Préproduction" )
, ( "U", "UAT" )
, ( "T", "Test" )
, ( "I", "Integration" )
]
type Msg
= InputCode String
| InputReg String
| InputRole String
| InputEnv String
| InputIncr String
update msg model =
case msg of
InputCode s ->
{ model | code = s }
InputReg s ->
{ model | reg = s }
InputRole s ->
{ model | role = s }
InputEnv s ->
{ model | env = s }
InputIncr s ->
{ model | incr = String.toInt s |> Maybe.withDefault 1 }
formatName r =
"AL"
++ r.reg
++ "1"
-- AZ is hard coded :(
++ r.code
++ r.env
++ r.role
++ (if r.incr < 10 then
"0"
else
""
)
++ String.fromInt r.incr
br_ =
br [] []
renderSelect : (String -> Msg) -> List ( String, String ) -> Html Msg
renderSelect msg options =
select [ onInput msg ] (options |> List.map renderOption)
renderOption : ( String, String ) -> Html Msg
renderOption opt =
option [ opt |> Tuple.first |> value ] [ opt |> Tuple.second |> text ]
view model =
div []
[ h1 [] [ text "Name Generator 😎" ]
, br_
, text (formatName model)
, br_
, br_
, br_
, text "code"
, input [ onInput InputCode, value model.code ] []
, br_
, br_
, text "region"
, renderSelect InputReg regions
, br_
, br_
, text "environment"
, renderSelect InputEnv envs
, br_
, br_
, text "role"
, renderSelect InputRole roles
, br_
, br_
, text "increment"
, select [ onInput InputIncr ] (List.range 1 20 |> List.map (String.fromInt >> (\s -> ( s, s )) >> renderOption))
]

View File

@ -1,4 +0,0 @@
#!/bin/sh
find . \( -name "*.sh" -or -name "*.elm" \) -and -not \( -path "./elm-stuff/*" -or -path "./.vscode/*" \) -print0 | \
xargs -0 cat | countuniq0 # sort -u | wc -l