diff --git a/client/client.go b/client/client.go index 77a2bd7..252c265 100644 --- a/client/client.go +++ b/client/client.go @@ -13,6 +13,7 @@ import ( const ( urlPath = "/url/open" + openPath = "/cmd/open" ) type RemoteClient struct { @@ -32,6 +33,22 @@ func New(host, token string) *RemoteClient { return &RemoteClient{client: client, baseUrl: "https://" + host, token: token} } +func (r *RemoteClient) Open(path string) error { + formData := url.Values{ + "path": {path}, + } + + status, _, err := r.doRequest(openPath, formData) + + if err != nil { + return err + } else if status != http.StatusOK { + return errors.New("invalid status: " + strconv.Itoa(status)) + } + + return nil +} + func (r *RemoteClient) OpenURL(urlStr string) error { formData := url.Values{ "url": {urlStr}, diff --git a/plugin/images/actions/open-icon.png b/plugin/images/actions/open-icon.png new file mode 100644 index 0000000..9fcd011 Binary files /dev/null and b/plugin/images/actions/open-icon.png differ diff --git a/plugin/images/actions/open.png b/plugin/images/actions/open.png new file mode 100644 index 0000000..95ff75b Binary files /dev/null and b/plugin/images/actions/open.png differ diff --git a/plugin/images/actions/website-icon.png b/plugin/images/actions/website-icon.png new file mode 100644 index 0000000..44b9221 Binary files /dev/null and b/plugin/images/actions/website-icon.png differ diff --git a/plugin/manifest.json b/plugin/manifest.json index e57a6ca..1cfde4f 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -5,29 +5,42 @@ "Name": "SSH", "States": [ { - "Image": "ssh", + "Image": "images/actions/ssh", "TitleAlignment": "bottom", "FontSize": "16" } ], - "SupportedInMultiActions": false, "Tooltip": "Execute a command over SSH", "UUID": "tf.meow.remote.ssh", "PropertyInspectorPath": "pi/index_pi.html" }, { - "Icon": "images/actions/website", + "Icon": "images/actions/website-icon", "Name": "Website", "States": [ { - "Image": "website", + "Image": "images/actions/website", + "TitleAlignment": "bottom", + "FontSize": "16" + } + ], + "Tooltip": "Open a website on a remote computer", + "UUID": "tf.meow.remote.website", + "PropertyInspectorPath": "pi/index_pi_server.html" + }, + { + "Icon": "images/actions/website-icon", + "Name": "Website", + "States": [ + { + "Image": "images/actions/website", "TitleAlignment": "bottom", "FontSize": "16" } ], "SupportedInMultiActions": false, - "Tooltip": "Open a website on a remote computer", - "UUID": "tf.meow.remote.website", + "Tooltip": "Open a file on a remote computer", + "UUID": "tf.meow.remote.open", "PropertyInspectorPath": "pi/index_pi_server.html" } ], diff --git a/plugin/pi/css/check.png b/plugin/pi/css/check.png new file mode 100644 index 0000000..b5e9e62 Binary files /dev/null and b/plugin/pi/css/check.png differ diff --git a/plugin/pi/css/check.svg b/plugin/pi/css/check.svg new file mode 100644 index 0000000..5b96af0 --- /dev/null +++ b/plugin/pi/css/check.svg @@ -0,0 +1,3 @@ + + + diff --git a/plugin/pi/index_pi.js b/plugin/pi/index_pi.js index c36da6d..9670d5a 100644 --- a/plugin/pi/index_pi.js +++ b/plugin/pi/index_pi.js @@ -76,17 +76,14 @@ function connectElgatoStreamDeckSocket (inPort, inUUID, inRegisterEvent, inInfo, } function initPropertyInspector(initDelay) { - if (actionInfo['action'] == 'tf.meow.remote.website') { - $('#url_container').show(); - $('#url_background_container').show(); - } + const action = actionInfo['action']; + + $('[data-action=' + action + ']').removeClass('hidden'); Object.keys(settings).forEach(function (item) { let $item = $('#' + item), value = settings[item]; - console.log('Load setting', item, 'value', value); - switch ($item.attr('type')) { case 'checkbox': let itemVal = $item.attr('value'); diff --git a/plugin/pi/index_pi_server.html b/plugin/pi/index_pi_server.html index 3041dd5..426fb9b 100644 --- a/plugin/pi/index_pi_server.html +++ b/plugin/pi/index_pi_server.html @@ -23,17 +23,22 @@ -