Changing allowed_instances to federated_instances.

This commit is contained in:
Dessalines 2020-08-11 10:57:10 -04:00
parent af5f8b0538
commit 0c84d9b604
9 changed files with 12 additions and 11 deletions

View file

@ -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

View file

@ -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(),
})
}
}

View file

@ -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,

View file

@ -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}

View file

@ -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,

View file

@ -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,

View file

@ -97,7 +97,7 @@ export class Post extends Component<any, PostState> {
},
online: null,
version: null,
allowed_instances: undefined,
federated_instances: undefined,
},
};

View file

@ -142,7 +142,7 @@ export class User extends Component<any, UserState> {
},
version: undefined,
my_user: undefined,
allowed_instances: undefined,
federated_instances: undefined,
},
};

View file

@ -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 {