* Move component and prep
* Make WorkspaceSection more reusable
* Lay out elements
* Layout tweaks
* Add outdated to Workspace type
* Fill out status bar component
* Format
* Add transition to types
* Add api handlers for build toggle
* Format
* Parallelize machine
* Lay out basics of build submachine
* Pipe start and stop events through - needs status
* Attempt at a machine
It's so big, but collapsing start and stop made it hard to distinguish retry from toggle
* Update mock
* Render status and buttons
* Fix type error on template page
* Move Settings
* Format
* Keep refreshed workspace
* Make it switch workspaces
* Lint
* Fix relative api path
* Test
* Fix polling
* Add loading workspace state
* Format
* Add stub settings page
* Format
* Lint
* Get rid of let
* Add update
* Make start use version id
Important for update
* Fix imports
* Add polling for outdated
* Rely on context instead of finite state for status
* Handle canceling
* Fix tests
* Format
* Display errors so users know when button presses didn't work
* Fix api typo, remove logging
* Lint
* Simplify type
Co-authored-by: G r e y <grey@coder.com>
* Add type, extract helper
Co-authored-by: G r e y <grey@coder.com>
* Adds methods to schedule.Schedule to show the raw cron string and timezone
* Uses these methods to clean up output of auto(start|stop) show or ls
* Defaults CRON_TZ=UTC if not provided
* feat: send native system notification on scheduled workspace shutdown
This commit adds a fairly generic notification package and uses it
to notify users connected over SSH of pending workspace shutdowns.
Only one notification will be sent at most 5 minutes prior to the scheduled
shutdown, and only one CLI instance will send notifications if multiple
instances are running.
It appears unclear as of now when/if these will be implemented so I
opted to remove them (as opposed to commenting them out) to avoid having
them rot (they are easily added back anyway).
Closes#1232.
* Make column renderer use the same type as its key
That way the renderer only takes `string` for example when rendering the
name field instead of `string | number` when the interface has some
fields that are strings and some fields are numbers.
This will be necessary when switching to generated types since some of
the fields are numbers (like the owner count on a template).
* Switch fully to generated types
In some places the organization ID is part of the URL but not part of
the request so I separated out the ID into a separate argument in the
relevant API functions.
Otherwise this was a straightforward replacement where I mostly only
needed to change some of the interface names (User instead of
UserResponse for example) and add a few missing but required properties.
I kind of winged the template form; I am not sure what the difference
between a template and template version is or why the latter comes
before the former so the form just returns all the data required to
create both.
* Delete handwritten types
Except for UserAgent which seems to be purely frontend and
ReconnectingPTYRequest which is not in codersdk so I am just leaving it
for now.
* Remove implemented omitempty as a future idea
This was implemented in 2d3dc436a8.
* Add missing optionalities to generated request interfaces
This PR adds a package lifecycle and an Executor implementation that attempts to schedule a build of workspaces with autostart configured.
- lifecycle.Executor takes a chan time.Time in its constructor (e.g. time.Tick(time.Minute))
- Whenever a value is received from this channel, it executes one iteration of looping through the workspaces and triggering lifecycle operations.
- When the context passed to the executor is Done, it exits.
- Only workspaces that meet the following criteria will have a lifecycle operation applied to them:
- Workspace has a valid and non-empty autostart or autostop schedule (either)
- Workspace's last build was successful
- The following transitions will be applied depending on the current workspace state:
- If the workspace is currently running, it will be stopped.
- If the workspace is currently stopped, it will be started.
- Otherwise, nothing will be done.
- Workspace builds will be created with the same parameters and template version as the last successful build (for example, template version)
* feat: build armv7 linux releases
* upload ARM binaries to bin
* Only build arm 7 for Linux
* add ARM agent scripts
* fix: specify armv7 to match tf provider
* append arm version to slim builds
* use descript armv7 binary
* Add script mappings for each architecture
Co-authored-by: kylecarbs <kyle@carberry.com>