mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add a theme picker (#11140)
This commit is contained in:
Generated
+1
@@ -71,6 +71,7 @@ curl -X GET http://coder-server:8080/api/v2/audit \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
},
|
||||
"user_agent": "string"
|
||||
|
||||
Generated
+13
@@ -196,6 +196,7 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -258,6 +259,7 @@ curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -335,6 +337,7 @@ curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -472,6 +475,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -511,6 +515,7 @@ Status Code **200**
|
||||
| `»»» display_name` | string | false | | |
|
||||
| `»»» name` | string | false | | |
|
||||
| `»» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
|
||||
| `»» theme_preference` | string | false | | |
|
||||
| `»» username` | string | true | | |
|
||||
| `» name` | string | false | | |
|
||||
| `» organization_id` | string(uuid) | false | | |
|
||||
@@ -591,6 +596,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -654,6 +660,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -1014,6 +1021,7 @@ curl -X PATCH http://coder-server:8080/api/v2/scim/v2/Users/{id} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1067,6 +1075,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -1097,6 +1106,7 @@ Status Code **200**
|
||||
| `»» display_name` | string | false | | |
|
||||
| `»» name` | string | false | | |
|
||||
| `» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
|
||||
| `» theme_preference` | string | false | | |
|
||||
| `» username` | string | true | | |
|
||||
|
||||
#### Enumerated Values
|
||||
@@ -1224,6 +1234,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -1249,6 +1260,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -1285,6 +1297,7 @@ Status Code **200**
|
||||
| `»»»» display_name` | string | false | | |
|
||||
| `»»»» name` | string | false | | |
|
||||
| `»»» status` | [codersdk.UserStatus](schemas.md#codersdkuserstatus) | false | | |
|
||||
| `»»» theme_preference` | string | false | | |
|
||||
| `»»» username` | string | true | | |
|
||||
| `»» name` | string | false | | |
|
||||
| `»» organization_id` | string(uuid) | false | | |
|
||||
|
||||
Generated
+24
@@ -865,6 +865,7 @@ _None_
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -890,6 +891,7 @@ _None_
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -1175,6 +1177,7 @@ _None_
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
},
|
||||
"user_agent": "string"
|
||||
@@ -1252,6 +1255,7 @@ _None_
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
},
|
||||
"user_agent": "string"
|
||||
@@ -3106,6 +3110,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -3162,6 +3167,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
],
|
||||
@@ -4882,6 +4888,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -4900,6 +4907,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `role` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
|
||||
| `roles` | array of [codersdk.Role](#codersdkrole) | false | | |
|
||||
| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | |
|
||||
| `theme_preference` | string | false | | |
|
||||
| `username` | string | true | | |
|
||||
|
||||
#### Enumerated Values
|
||||
@@ -5278,6 +5286,20 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `user_perms` | object | false | | User perms should be a mapping of user ID to role. The user ID must be the uuid of the user, not a username or email address. |
|
||||
| » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | |
|
||||
|
||||
## codersdk.UpdateUserAppearanceSettingsRequest
|
||||
|
||||
```json
|
||||
{
|
||||
"theme_preference": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ------------------ | ------ | -------- | ------------ | ----------- |
|
||||
| `theme_preference` | string | true | | |
|
||||
|
||||
## codersdk.UpdateUserPasswordRequest
|
||||
|
||||
```json
|
||||
@@ -5427,6 +5449,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -5444,6 +5467,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
|
||||
| `organization_ids` | array of string | false | | |
|
||||
| `roles` | array of [codersdk.Role](#codersdkrole) | false | | |
|
||||
| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | |
|
||||
| `theme_preference` | string | false | | |
|
||||
| `username` | string | true | | |
|
||||
|
||||
#### Enumerated Values
|
||||
|
||||
Generated
+71
@@ -45,6 +45,7 @@ curl -X GET http://coder-server:8080/api/v2/users \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
]
|
||||
@@ -112,6 +113,7 @@ curl -X POST http://coder-server:8080/api/v2/users \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -370,6 +372,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -421,6 +424,69 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user} \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Responses
|
||||
|
||||
| Status | Meaning | Description | Schema |
|
||||
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- |
|
||||
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) |
|
||||
|
||||
To perform this operation, you must be authenticated. [Learn more](authentication.md).
|
||||
|
||||
## Update user appearance settings
|
||||
|
||||
### Code samples
|
||||
|
||||
```shell
|
||||
# Example request using curl
|
||||
curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Accept: application/json' \
|
||||
-H 'Coder-Session-Token: API_KEY'
|
||||
```
|
||||
|
||||
`PUT /users/{user}/appearance`
|
||||
|
||||
> Body parameter
|
||||
|
||||
```json
|
||||
{
|
||||
"theme_preference": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
| ------ | ---- | ------------------------------------------------------------------------------------------------------ | -------- | ----------------------- |
|
||||
| `user` | path | string | true | User ID, name, or me |
|
||||
| `body` | body | [codersdk.UpdateUserAppearanceSettingsRequest](schemas.md#codersdkupdateuserappearancesettingsrequest) | true | New appearance settings |
|
||||
|
||||
### Example responses
|
||||
|
||||
> 200 Response
|
||||
|
||||
```json
|
||||
{
|
||||
"avatar_url": "http://example.com",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"email": "user@example.com",
|
||||
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
|
||||
"last_seen_at": "2019-08-24T14:15:22Z",
|
||||
"login_type": "",
|
||||
"organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"],
|
||||
"roles": [
|
||||
{
|
||||
"display_name": "string",
|
||||
"name": "string"
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1015,6 +1081,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1066,6 +1133,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1127,6 +1195,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1178,6 +1247,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
@@ -1229,6 +1299,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \
|
||||
}
|
||||
],
|
||||
"status": "active",
|
||||
"theme_preference": "string",
|
||||
"username": "string"
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user