Back to Postgresml

Playground

pgml-dashboard/templates/content/playground.html

2.10.06.5 KB
Original Source

% use crate::components::*; use crate::components::tables::large::*; use crate::components::navigation::tabs::*; use crate::components::inputs::range_group::RangeGroup; use crate::components::inputs::text::editable_header::{EditableHeader, Headers}; use crate::components::stimulus::stimulus_target::StimulusTarget; use crate::components::stimulus::stimulus_action::StimulusAction; // use crate::components::stimulus::stimulus_action::StimulusEvents; use crate::components::inputs::select::Select; use crate::components::inputs::switch::{Switch, State}; use crate::components::cards::marketing::Slider as SliderCard; use crate::components::icons::Checkmark; use crate::components::Slider; use crate::components::pagination::Pagination; use crate::components::inputs::{range::Range, RangeGroupPricingCalc}; use crate::components::tables::ServerlessModels; use crate::components::cards::Rgb; use crate::components::cards::Psychedelic; %>

Playground

This is a space to display components.

<%+ Pagination::new(3, 1) .active_index(0) .not_clickable() %> <%+ Pagination::new(3, 1) .active_index(1) .not_clickable() %> <%+ Pagination::new(3, 1) .active_index(2) .not_clickable() %>

icons

<%+ GithubIcon::new() %>

Checkmarks
normal
in disabled container
disabled attribute

<%+ Checkmark::new().color("white") %> <%+ Checkmark::new().color("blue") %> <%+ Checkmark::new().color("green") %> <%+ Checkmark::new().color("orange") %> <%+ Checkmark::new().color("purple") %>

<%+ Checkmark::new().color("white") %> <%+ Checkmark::new().color("blue") %> <%+ Checkmark::new().color("green") %> <%+ Checkmark::new().color("orange") %> <%+ Checkmark::new().color("purple") %>

<%+ Checkmark::new().color("white").disabled() %> <%+ Checkmark::new().color("blue").disabled() %> <%+ Checkmark::new().color("green").disabled() %> <%+ Checkmark::new().color("orange").disabled() %> <%+ Checkmark::new().color("purple").disabled() %>

Twitter

<%+ Checkmark::new().twitter() %>

<%+ ProfileIcon %>

<%+ Dropdown::nav( vec![StaticNavLink::new("Test1".into(), "#test1".into()), StaticNavLink::new("Test2".into(), "#test2".into()), StaticNavLink::new("Starts Active".into(), "#test".into()).active(true)] ).collapsable() .icon(ProfileIcon::new().into()) %>

<%+ Dropdown::nav( vec![StaticNavLink::new("Test1".into(), "#test1".into()), StaticNavLink::new("Test2".into(), "#test2".into()), StaticNavLink::new("Starts Active".into(), "#test".into()).active(true)] ).collapsable() %>

<%+ Dropdown::nav( vec![StaticNavLink::new("Really long title in the dropdown".into(), "#test".into()), StaticNavLink::new("Normal link".into(), "#test".into()),] ).collapsable() .text("Really long name in the dropdown".into()) %>

<%+ Tabs::new( &[Tab::new( "Test tab", Table::new( &["Date", "Time", "Status"], &[Row::new(&[ "01/01/2022".into(), "20:00:43.956373 +00:00:00 UTC".into(), "Ready".into()]) .action("click->playground#selectRow") .data("row-id", "1"), Row::new(&["01/01/2022".into(), "20:00:43.956373 +00:00:00 UTC".into(), "Ready".into()]) .action("click->playground#selectRow") .data("row-id", "2"), Row::new(&["01/01/2022".into(), "20:00:43.956373 +00:00:00 UTC".into(), "Ready".into()]) .action("click->playground#selectRow") .data("row-id", "3"), ]) .selectable() .into() ), Tab::new( "Second tab", "Second tab content".into() ), Tab::new( "Third active tab", "Hello third tab".into(), ), ] ) .active_tab("Test tab") %>

Inputs

<%+ RangeGroup::new("Input 1") .initial_value(4.0) .bounds(2, 38, 2.0) .units("T") %>

<%+ RangeGroup::new("Input 2: with hourly rate") .initial_value(3.0) .identifier("my_test input 2") .bounds(1, 20, 1.0) .units("GB") .cost_rate(0.144) %>

<%+ RangeGroup::new("range with ticks") .initial_value(2.0) .group_target( StimulusTarget::new() .controller("playground") .name("rangeOptions") ) .options( vec!( vec!( "4 CPU".to_owned(), "16 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "8 CPU".to_owned(), "32 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "16 CPU".to_owned(), "64 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "32 CPU".to_owned(), "128 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "32 CPU".to_owned(), "128 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "64 CPU".to_owned(), "256 GB Memory".to_owned(), "24 GB GPU Memory".to_owned(), ), vec!( "48 CPU".to_owned(), "192 GB Memory".to_owned(), "96 GB GPU Memory".to_owned(), ), ) ) .hide_title() .hide_value() %> Reset Options Inputlog value

<%+ EditableHeader::new() .value("Size H1") .header_type(Headers::H1) %> this is a thing that takes up space

<%+ EditableHeader::new() .value("Size H2") .header_type(Headers::H2) .id("header-2") %> Add an ErrorClear Error

<%+ EditableHeader::new() .value("Size H3") .header_type(Headers::H3) .input_name("title") .input_target( StimulusTarget::new() .controller("some-existing-controller") .name("desired-target-name") ).id("header-3") %> Add an ErrorClear Error

<%+ Switch::new() .on_toggle( StimulusAction::new() .controller("playground") .method("testOnToggleSwitch")) .target(StimulusTarget::new() .controller("playground") .name("switch")) .left("CPU", "memory") .right("GPU", "mode_fan") .default_position(State::Right) %>

Reset Switch

<%+ Range::new() %> <%+ RangeGroupPricingCalc::new() %>

<%+ Select::new() .options(vec!["option_pg1".to_owned(), "option2".to_owned(), "option3".to_owned()]) .name("selectName") %>

<%+ Slider::new().cards( Vec::from([SliderCard::new() .title("New card") .image("/dashboard/static/images/illustrations/gravity.png") .bullets(vec!["bullet1".to_owned(), "bullet2".to_owned(), "bullet3".to_owned()]).into(), SliderCard::new() .title("New card") .image("/dashboard/static/images/illustrations/gravity.png") .bullets(vec!["bullet1".to_owned(), "bullet2".to_owned(), "bullet3".to_owned()]).into(), SliderCard::new() .title("New card") .image("/dashboard/static/images/illustrations/gravity.png") .bullets(vec!["bullet1 ldfjkh alkjhdf ladfkh skdfh ksh dfkhsdfk h".to_owned().into()]).into() ]) )%>

<%+ ServerlessModels::new() %>

RGB card

<%+ Rgb::new("hi".into()).active() %>

Psychedelic card

<%+ Psychedelic::new() %> <%+ Psychedelic::new().is_border_only(true) %> <%+ Psychedelic::new().set_color_pink() %> <%+ Psychedelic::new().set_color_pink().is_border_only(true) %>

Loading our current pricing model...