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>,
|
site: Option<SiteView>,
|
||||||
admins: Vec<UserView>,
|
admins: Vec<UserView>,
|
||||||
banned: Vec<UserView>,
|
banned: Vec<UserView>,
|
||||||
|
online: usize,
|
||||||
|
version: String,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -3,6 +3,7 @@ use crate::{
|
||||||
api::{claims::Claims, APIError, Oper, Perform},
|
api::{claims::Claims, APIError, Oper, Perform},
|
||||||
apub::fetcher::search_by_apub_id,
|
apub::fetcher::search_by_apub_id,
|
||||||
blocking,
|
blocking,
|
||||||
|
version,
|
||||||
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
|
websocket::{server::SendAllMessage, UserOperation, WebsocketInfo},
|
||||||
DbPool,
|
DbPool,
|
||||||
LemmyError,
|
LemmyError,
|
||||||
|
@ -110,6 +111,7 @@ pub struct GetSiteResponse {
|
||||||
admins: Vec<UserView>,
|
admins: Vec<UserView>,
|
||||||
banned: Vec<UserView>,
|
banned: Vec<UserView>,
|
||||||
pub online: usize,
|
pub online: usize,
|
||||||
|
version: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize)]
|
#[derive(Serialize, Deserialize)]
|
||||||
|
@ -424,6 +426,7 @@ impl Perform for Oper<GetSite> {
|
||||||
admins,
|
admins,
|
||||||
banned,
|
banned,
|
||||||
online,
|
online,
|
||||||
|
version: version::VERSION.to_string(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -666,6 +669,7 @@ impl Perform for Oper<TransferSite> {
|
||||||
admins,
|
admins,
|
||||||
banned,
|
banned,
|
||||||
online: 0,
|
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: [],
|
admins: [],
|
||||||
banned: [],
|
banned: [],
|
||||||
online: null,
|
online: null,
|
||||||
|
version: null,
|
||||||
},
|
},
|
||||||
siteConfigForm: {
|
siteConfigForm: {
|
||||||
config_hjson: null,
|
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: [],
|
admins: [],
|
||||||
banned: [],
|
banned: [],
|
||||||
online: null,
|
online: null,
|
||||||
|
version: null,
|
||||||
},
|
},
|
||||||
showEditSite: false,
|
showEditSite: false,
|
||||||
loading: true,
|
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,
|
enable_nsfw: undefined,
|
||||||
},
|
},
|
||||||
online: null,
|
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>;
|
admins: Array<UserView>;
|
||||||
banned: Array<UserView>;
|
banned: Array<UserView>;
|
||||||
online: number;
|
online: number;
|
||||||
|
version: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SiteResponse {
|
export interface SiteResponse {
|
||||||
|
|
Loading…
Reference in a new issue