eXpl0it3r / streamdeck-clockify

Clockify Action for the Elgato Stream Deck
MIT License
46 stars 8 forks source link

Need ability to specify self-hosted url #6

Closed brandonm4 closed 1 year ago

brandonm4 commented 2 years ago

We need a way to specify to baseUrl if the user is not using the clockify cloud.

My suggestions:

\\In PluginSettings.cs - add a new property to hold base url/default to standard
[JsonProperty(PropertyName = "baseApiUrl")]
public string BaseApiUrl { get; set; } = "https://api.clockify.me/api/v1";

\\ClockifyContext.cs
\\change line 130: \\allow for new setting to be passed in
public async Task<bool> SetApiKeyAsync(string apiKey, string baseApiUrl)

\\line 141:  - use it when creating the client
 _clockifyClient = new ClockifyClient(_apiKey, apiUrl: baseApiUrl);

\\ToggleAction.cs
\\lines 80 & 89 - pass the settings to the setup method
await _clockifyContext.SetApiKeyAsync(_settings.ApiKey, _settings.BaseApiUrl);

I may have missed something important, but that seems like it should work

eXpl0it3r commented 2 years ago

Didn't know that Clockify can be self-hosted, will look into adding an base URL option 🙂

ARegalbuto commented 1 year ago

Can you add a client field? My company uses the same project name over and over, but the thing that changes things is the client name. If I have a unique project name, it works well, but if my project name is the same across multiple clients, it fails.

eXpl0it3r commented 1 year ago

Oh, I totally forgot to finalize the server URL version. I've implemented it a while ago.

Can you add a client field? My company uses the same project name over and over, but the thing that changes things is the client name. If I have a unique project name, it works well, but if my project name is the same across multiple clients, it fails.

I've created a dedicated issue for it, let's discuss over there: #7

eXpl0it3r commented 1 year ago

Implemented with 7f6b77c67c009d0bc9b00882e179771686676508 and published as new release: https://github.com/eXpl0it3r/streamdeck-clockify/releases/tag/1.5

Let me know if you run into any issues!