Adding version to GetSite. Fixes #1001
This commit is contained in:
parent
f93f2fe03c
commit
9a12560c80
6 changed files with 10 additions and 0 deletions
2
docs/src/contributing_websocket_http_api.md
vendored
2
docs/src/contributing_websocket_http_api.md
vendored
|
@ -754,6 +754,8 @@ Search types are `All, Comments, Posts, Communities, Users, Url`
|
|||
site: Option<SiteView>,
|
||||
admins: Vec<UserView>,
|
||||
banned: Vec<UserView>,
|
||||
online: usize,
|
||||
version: String,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
@ -3,6 +3,7 @@ use crate::{
|
|||
api::{claims::Claims, APIError, Oper, Perform},
|
||||
apub::fetcher::search_by_apub_id,
|
||||
blocking,
|
||||
version,
|
||||
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
|
||||
DbPool,
|
||||
LemmyError,
|
||||
|
@ -110,6 +111,7 @@ pub struct GetSiteResponse {
|
|||
admins: Vec<UserView>,
|
||||
banned: Vec<UserView>,
|
||||
pub online: usize,
|
||||
version: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
@ -424,6 +426,7 @@ impl Perform for Oper<GetSite> {
|
|||
admins,
|
||||
banned,
|
||||
online,
|
||||
version: version::VERSION.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -666,6 +669,7 @@ impl Perform for Oper<TransferSite> {
|
|||
admins,
|
||||
banned,
|
||||
online: 0,
|
||||
version: version::VERSION.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
1
ui/src/components/admin-settings.tsx
vendored
1
ui/src/components/admin-settings.tsx
vendored
|
@ -46,6 +46,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
|
|||
admins: [],
|
||||
banned: [],
|
||||
online: null,
|
||||
version: null,
|
||||
},
|
||||
siteConfigForm: {
|
||||
config_hjson: null,
|
||||
|
|
1
ui/src/components/main.tsx
vendored
1
ui/src/components/main.tsx
vendored
|
@ -107,6 +107,7 @@ export class Main extends Component<any, MainState> {
|
|||
admins: [],
|
||||
banned: [],
|
||||
online: null,
|
||||
version: null,
|
||||
},
|
||||
showEditSite: false,
|
||||
loading: true,
|
||||
|
|
1
ui/src/components/post.tsx
vendored
1
ui/src/components/post.tsx
vendored
|
@ -92,6 +92,7 @@ export class Post extends Component<any, PostState> {
|
|||
enable_nsfw: undefined,
|
||||
},
|
||||
online: null,
|
||||
version: null,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
1
ui/src/interfaces.ts
vendored
1
ui/src/interfaces.ts
vendored
|
@ -758,6 +758,7 @@ export interface GetSiteResponse {
|
|||
admins: Array<UserView>;
|
||||
banned: Array<UserView>;
|
||||
online: number;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export interface SiteResponse {
|
||||
|
|
Loading…
Reference in a new issue