Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

target_switch

Marcel Kloubert edited this page Dec 22, 2017 · 10 revisions

Home >> Targets >> switch

Switch

Switches between existing targets.

You can change the state of a switch by using the Deploy Reloaded: Switches (extension.deploy.switches) command or a button.

{
    "deploy.reloaded": {
        "targets": [
            {
                "name": "My SFTP switch",
                "type": "switch",

                "options": [
                    {
                        "name": "Server 1",
                        "targets": "sftp1",

                        "isDefault": true
                    },

                    {
                        "name": "Server 2",
                        "targets": [ "sftp2" ]
                    }
                ]
            },

            {
                "name": "sftp1",
                "type": "sftp",
                
                // ...
            },
            {
                "name": "sftp2",
                "type": "sftp",
                
                // ...
            }
        ]
    }
}
Name Description
button Displays a button in the status bar. Can also be a boolean value to indicate if a button should be displayed or not. Default: (true)
options One or more option. Can also be one or more string which the targets to deploy to.

Button

{
    "deploy.reloaded": {
        "targets": [
            {
                "name": "My SFTP switch",
                "type": "switch",

                "button": {
                    "color": "#ffff00",
                    "text": "${selectedSwitch}: ${selectedSwitchOption}",
                    "tooltip": "Click here to change the current option of that switch..."
                }

                // ...
            },

            // ...
        ]
    }
}
Name Description
color* The custom text color. Default: #ffffff
enabled Enable button or not. Default: (true)
isRight Put button on the right side or not. Default: (false)
priority The priority.
text* The custom text.
tooltip* The custom tooltip.

* supports placeholders

Additional placeholders

Name Description
switch The name of the current switch.
switch_option The name of the selected switch option.

Options

Name Description
description The description.
isDefault Is default option or not. Default: (false)
name The (display) name.
targets One or more target (names) to deploy to.
Clone this wiki locally