mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Merge branch 'master' of github.com:OneUptime/oneuptime
This commit is contained in:
commit
2862d1e69b
@ -12,12 +12,14 @@ export interface ModelDocumentation {
|
||||
}
|
||||
|
||||
export default class ResourceUtil {
|
||||
// Get all resources that should have documentation enabled
|
||||
public static getResources(): Array<ModelDocumentation> {
|
||||
const resources: Array<ModelDocumentation> = Models.filter(
|
||||
(model: typeof BaseModel) => {
|
||||
const modelInstance: BaseModel = new model();
|
||||
let showDocs: boolean = modelInstance.enableDocumentation;
|
||||
|
||||
// If billing is enabled, do not show master admin API docs
|
||||
if (modelInstance.isMasterAdminApiDocs && IsBillingEnabled) {
|
||||
showDocs = false;
|
||||
}
|
||||
@ -40,6 +42,7 @@ export default class ResourceUtil {
|
||||
return resources;
|
||||
}
|
||||
|
||||
// Get featured resources that are pre-selected
|
||||
public static getFeaturedResources(): Array<ModelDocumentation> {
|
||||
const featuredResources: Array<string> = [
|
||||
"Monitor",
|
||||
@ -59,6 +62,7 @@ export default class ResourceUtil {
|
||||
);
|
||||
}
|
||||
|
||||
// Create a dictionary of resources indexed by their path
|
||||
public static getResourceDictionaryByPath(): Dictionary<ModelDocumentation> {
|
||||
const dict: Dictionary<ModelDocumentation> = {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user