mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-06 02:36:38 +00:00
hide sites inputs on clients
This commit is contained in:
@@ -173,39 +173,6 @@ export default function GeneralPage() {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
|
||||||
control={form.control}
|
|
||||||
name="siteIds"
|
|
||||||
render={(field) => (
|
|
||||||
<FormItem className="flex flex-col">
|
|
||||||
<FormLabel>{t("sites")}</FormLabel>
|
|
||||||
<TagInput
|
|
||||||
{...field}
|
|
||||||
activeTagIndex={activeSitesTagIndex}
|
|
||||||
setActiveTagIndex={setActiveSitesTagIndex}
|
|
||||||
placeholder={t("selectSites")}
|
|
||||||
size="sm"
|
|
||||||
tags={form.getValues().siteIds}
|
|
||||||
setTags={(newTags) => {
|
|
||||||
form.setValue(
|
|
||||||
"siteIds",
|
|
||||||
newTags as [Tag, ...Tag[]]
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
enableAutocomplete={true}
|
|
||||||
autocompleteOptions={sites}
|
|
||||||
allowDuplicates={false}
|
|
||||||
restrictTagsToAutocompleteOptions={true}
|
|
||||||
sortTags={true}
|
|
||||||
/>
|
|
||||||
<FormDescription>
|
|
||||||
{t("sitesDescription")}
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</SettingsSectionForm>
|
</SettingsSectionForm>
|
||||||
|
|||||||
@@ -99,10 +99,7 @@ export default function Page() {
|
|||||||
id: z.string(),
|
id: z.string(),
|
||||||
text: z.string()
|
text: z.string()
|
||||||
})
|
})
|
||||||
)
|
),
|
||||||
.refine((val) => val.length > 0, {
|
|
||||||
message: t("siteRequired")
|
|
||||||
}),
|
|
||||||
subnet: z.string().ip().min(1, {
|
subnet: z.string().ip().min(1, {
|
||||||
message: t("subnetRequired")
|
message: t("subnetRequired")
|
||||||
})
|
})
|
||||||
@@ -293,18 +290,18 @@ export default function Page() {
|
|||||||
|
|
||||||
// Fetch available sites
|
// Fetch available sites
|
||||||
|
|
||||||
const res = await api.get<AxiosResponse<ListSitesResponse>>(
|
// const res = await api.get<AxiosResponse<ListSitesResponse>>(
|
||||||
`/org/${orgId}/sites/`
|
// `/org/${orgId}/sites/`
|
||||||
);
|
// );
|
||||||
const sites = res.data.data.sites.filter(
|
// const sites = res.data.data.sites.filter(
|
||||||
(s) => s.type === "newt" && s.subnet
|
// (s) => s.type === "newt" && s.subnet
|
||||||
);
|
// );
|
||||||
setSites(
|
// setSites(
|
||||||
sites.map((site) => ({
|
// sites.map((site) => ({
|
||||||
id: site.siteId.toString(),
|
// id: site.siteId.toString(),
|
||||||
text: site.name
|
// text: site.name
|
||||||
}))
|
// }))
|
||||||
);
|
// );
|
||||||
|
|
||||||
let olmVersion = "latest";
|
let olmVersion = "latest";
|
||||||
|
|
||||||
@@ -468,60 +465,60 @@ export default function Page() {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
{/* <FormField */}
|
||||||
control={form.control}
|
{/* control={form.control} */}
|
||||||
name="siteIds"
|
{/* name="siteIds" */}
|
||||||
render={(field) => (
|
{/* render={(field) => ( */}
|
||||||
<FormItem className="flex flex-col">
|
{/* <FormItem className="flex flex-col"> */}
|
||||||
<FormLabel>
|
{/* <FormLabel> */}
|
||||||
{t("sites")}
|
{/* {t("sites")} */}
|
||||||
</FormLabel>
|
{/* </FormLabel> */}
|
||||||
<TagInput
|
{/* <TagInput */}
|
||||||
{...field}
|
{/* {...field} */}
|
||||||
activeTagIndex={
|
{/* activeTagIndex={ */}
|
||||||
activeSitesTagIndex
|
{/* activeSitesTagIndex */}
|
||||||
}
|
{/* } */}
|
||||||
setActiveTagIndex={
|
{/* setActiveTagIndex={ */}
|
||||||
setActiveSitesTagIndex
|
{/* setActiveSitesTagIndex */}
|
||||||
}
|
{/* } */}
|
||||||
placeholder={t("selectSites")}
|
{/* placeholder={t("selectSites")} */}
|
||||||
size="sm"
|
{/* size="sm" */}
|
||||||
tags={
|
{/* tags={ */}
|
||||||
form.getValues()
|
{/* form.getValues() */}
|
||||||
.siteIds
|
{/* .siteIds */}
|
||||||
}
|
{/* } */}
|
||||||
setTags={(
|
{/* setTags={( */}
|
||||||
olmags
|
{/* olmags */}
|
||||||
) => {
|
{/* ) => { */}
|
||||||
form.setValue(
|
{/* form.setValue( */}
|
||||||
"siteIds",
|
{/* "siteIds", */}
|
||||||
olmags as [
|
{/* olmags as [ */}
|
||||||
Tag,
|
{/* Tag, */}
|
||||||
...Tag[]
|
{/* ...Tag[] */}
|
||||||
]
|
{/* ] */}
|
||||||
);
|
{/* ); */}
|
||||||
}}
|
{/* }} */}
|
||||||
enableAutocomplete={
|
{/* enableAutocomplete={ */}
|
||||||
true
|
{/* true */}
|
||||||
}
|
{/* } */}
|
||||||
autocompleteOptions={
|
{/* autocompleteOptions={ */}
|
||||||
sites
|
{/* sites */}
|
||||||
}
|
{/* } */}
|
||||||
allowDuplicates={
|
{/* allowDuplicates={ */}
|
||||||
false
|
{/* false */}
|
||||||
}
|
{/* } */}
|
||||||
restrictTagsToAutocompleteOptions={
|
{/* restrictTagsToAutocompleteOptions={ */}
|
||||||
true
|
{/* true */}
|
||||||
}
|
{/* } */}
|
||||||
sortTags={true}
|
{/* sortTags={true} */}
|
||||||
/>
|
{/* /> */}
|
||||||
<FormDescription>
|
{/* <FormDescription> */}
|
||||||
{t("sitesDescription")}
|
{/* {t("sitesDescription")} */}
|
||||||
</FormDescription>
|
{/* </FormDescription> */}
|
||||||
<FormMessage />
|
{/* <FormMessage /> */}
|
||||||
</FormItem>
|
{/* </FormItem> */}
|
||||||
)}
|
{/* )} */}
|
||||||
/>
|
{/* /> */}
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</SettingsSectionForm>
|
</SettingsSectionForm>
|
||||||
|
|||||||
Reference in New Issue
Block a user