Changing allowed_instances to federated_instances.
This commit is contained in:
parent
af5f8b0538
commit
0c84d9b604
9 changed files with 12 additions and 11 deletions
|
@ -141,6 +141,7 @@ impl Settings {
|
|||
.map(|d| d.to_string())
|
||||
.collect();
|
||||
|
||||
// The defaults.hjson config always returns a [""]
|
||||
allowed_instances.retain(|d| !d.eq(""));
|
||||
|
||||
allowed_instances
|
||||
|
|
|
@ -130,7 +130,7 @@ pub struct GetSiteResponse {
|
|||
pub online: usize,
|
||||
version: String,
|
||||
my_user: Option<User_>,
|
||||
allowed_instances: Vec<String>,
|
||||
federated_instances: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
@ -434,7 +434,7 @@ impl Perform for Oper<GetSite> {
|
|||
online,
|
||||
version: version::VERSION.to_string(),
|
||||
my_user,
|
||||
allowed_instances: Settings::get().get_allowed_instances(),
|
||||
federated_instances: Settings::get().get_allowed_instances(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ impl Perform for Oper<TransferSite> {
|
|||
online: 0,
|
||||
version: version::VERSION.to_string(),
|
||||
my_user: Some(user),
|
||||
allowed_instances: Settings::get().get_allowed_instances(),
|
||||
federated_instances: Settings::get().get_allowed_instances(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
2
ui/src/components/admin-settings.tsx
vendored
2
ui/src/components/admin-settings.tsx
vendored
|
@ -48,7 +48,7 @@ export class AdminSettings extends Component<any, AdminSettingsState> {
|
|||
banned: [],
|
||||
online: null,
|
||||
version: null,
|
||||
allowed_instances: null,
|
||||
federated_instances: null,
|
||||
},
|
||||
siteConfigForm: {
|
||||
config_hjson: null,
|
||||
|
|
4
ui/src/components/instances.tsx
vendored
4
ui/src/components/instances.tsx
vendored
|
@ -63,9 +63,9 @@ export class Instances extends Component<any, InstancesState> {
|
|||
<div>
|
||||
<h5>{i18n.t('linked_instances')}</h5>
|
||||
{this.state.siteRes &&
|
||||
this.state.siteRes.allowed_instances.length ? (
|
||||
this.state.siteRes.federated_instances.length ? (
|
||||
<ul>
|
||||
{this.state.siteRes.allowed_instances.map(i => (
|
||||
{this.state.siteRes.federated_instances.map(i => (
|
||||
<li>
|
||||
<a href={`https://${i}`} target="_blank" rel="noopener">
|
||||
{i}
|
||||
|
|
2
ui/src/components/main.tsx
vendored
2
ui/src/components/main.tsx
vendored
|
@ -114,7 +114,7 @@ export class Main extends Component<any, MainState> {
|
|||
banned: [],
|
||||
online: null,
|
||||
version: null,
|
||||
allowed_instances: null,
|
||||
federated_instances: null,
|
||||
},
|
||||
showEditSite: false,
|
||||
loading: true,
|
||||
|
|
2
ui/src/components/navbar.tsx
vendored
2
ui/src/components/navbar.tsx
vendored
|
@ -82,7 +82,7 @@ export class Navbar extends Component<any, NavbarState> {
|
|||
banned: [],
|
||||
online: null,
|
||||
version: null,
|
||||
allowed_instances: null,
|
||||
federated_instances: null,
|
||||
},
|
||||
searchParam: '',
|
||||
toggleSearch: false,
|
||||
|
|
2
ui/src/components/post.tsx
vendored
2
ui/src/components/post.tsx
vendored
|
@ -97,7 +97,7 @@ export class Post extends Component<any, PostState> {
|
|||
},
|
||||
online: null,
|
||||
version: null,
|
||||
allowed_instances: undefined,
|
||||
federated_instances: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
2
ui/src/components/user.tsx
vendored
2
ui/src/components/user.tsx
vendored
|
@ -142,7 +142,7 @@ export class User extends Component<any, UserState> {
|
|||
},
|
||||
version: undefined,
|
||||
my_user: undefined,
|
||||
allowed_instances: undefined,
|
||||
federated_instances: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
2
ui/src/interfaces.ts
vendored
2
ui/src/interfaces.ts
vendored
|
@ -867,7 +867,7 @@ export interface GetSiteResponse {
|
|||
online: number;
|
||||
version: string;
|
||||
my_user?: User;
|
||||
allowed_instances: Array<string>;
|
||||
federated_instances: Array<string>;
|
||||
}
|
||||
|
||||
export interface SiteResponse {
|
||||
|
|
Loading…
Reference in a new issue