Explorer

html-ui.part-io-tools

description
(en)
type
Fn(language: String, project: String, branch: String, part: String, text: String) -> List<@html.node>
expression
fn(language$990, project$0, branch$1, part$2, text$3) =>
  let part_type$4 = @html-ui.part-section(text: $3, start: "\ntype:\n", end: "\n\nexpression:\n");
  let expression$5 = @html-ui.part-section(text: $3, start: "\n\nexpression:\n", end: "");
  @core.list-concat(
    left: match @core.equal(left: $4, right: "@wasi.io") {
      true =>
        @core.list-concat(
          left: [
            @html-ui.text-element(
              name: "h2",
              text: @html-ui.text(
                language: $990,
                en: "Run on this server",
                ja: "このサーバーで実行",
                eo: "Ruli en ĉi tiu servilo"
              )
            ),
            @html.element(
              name: "p",
              attributes: [],
              children: @html-ui.text-nodes(
                language: $990,
                en: [
                  @html.text(
                    text: "Runs the whole program on this server to the end (administrators only). It sends HTTP requests from the server and uses the values of the secrets kept by this server ("
                  ),
                  @html.element(
                    name: "a",
                    attributes: [{name: "href", value: "/secrets"}],
                    children: [@html.text(text: "Secrets")]
                  ),
                  @html.text(text: ").")
                ],
                ja: [
                  @html.text(
                    text: "プログラム全体をこのサーバーで最後まで動かします (管理者だけ)。HTTP リクエストはサーバーが送り, シークレットはこのサーバーに入れた値 ("
                  ),
                  @html.element(
                    name: "a",
                    attributes: [{name: "href", value: "/secrets"}],
                    children: [@html.text(text: "シークレット")]
                  ),
                  @html.text(text: ") を使います。")
                ],
                eo: [
                  @html.text(
                    text: "Rulas la tutan programon en ĉi tiu servilo ĝis la fino (nur administrantoj). La servilo sendas HTTP-petojn kaj uzas la valorojn de sekretoj konservitaj en ĉi tiu servilo ("
                  ),
                  @html.element(
                    name: "a",
                    attributes: [{name: "href", value: "/secrets"}],
                    children: [@html.text(text: "Sekretoj")]
                  ),
                  @html.text(text: ").")
                ]
              )
            )
          ],
          right: @html-ui.tool-form(
            tool: "definy_run_io",
            then: "",
            confirm: @core.string-join(
              items: [
                $2,
                @html-ui.text(
                  language: $990,
                  en: ": run it on this server? It sends HTTP requests",
                  ja: " をこのサーバーで実行しますか? HTTP リクエストを送ります",
                  eo: ": ĉu ruli ĝin? Ĝi sendos HTTP-petojn"
                )
              ],
              separator: ""
            ),
            fields: [
              @html-ui.hidden(name: "project", value: $0),
              @html-ui.hidden(name: "branch", value: $1),
              @html-ui.hidden(name: "expression", value: @core.string-concat(left: "@", right: $2))
            ],
            button: @html-ui.text(language: $990, en: "Run on the server", ja: "サーバーで実行", eo: "Ruli en la servilo")
          )
        ),
      false =>
        []
    },
    right: match @std.string-starts-with(value: $5, prefix: "secret(") {
      true =>
        @html-ui.secret-form(
          language: $990,
          literal: @core.string-join(
            items: [
              "[",
              @core.string-slice(
                value: $5,
                start: 7,
                end: @core.minus(left: @core.string-length(value: @html-ui.trim-end(text: $5)), right: 1)
              ),
              "]"
            ],
            separator: ""
          )
        ),
      false =>
        []
    }
  )
visibility
public
html-ui.part-io-tools (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: aFOw7UoVMSxK_krKKkna6n4Hhowwx5XDRHdvCtwI3qA
content hash: tp1Bn0Jxq8WcbFREO2qNHCyBepFBMiN-0ATUguOKErY