@gdacm/dashboard-manager 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DashboardManager.d.ts +3 -3
- package/dist/index.js +7 -9
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -34,13 +34,13 @@ export declare class DashboardManager {
|
|
|
34
34
|
registerDashboards(projectName: string, dashboardsInfo: DashboardsInfo): this;
|
|
35
35
|
/**
|
|
36
36
|
* @param {string} projectName
|
|
37
|
-
* @param {string} rootVid
|
|
37
|
+
* @param {string|undefined} rootVid
|
|
38
38
|
* @param {string} rootGrafanaFolder
|
|
39
|
-
* @param {string
|
|
39
|
+
* @param {string} vidPrefix
|
|
40
40
|
* @param {GenericMetaOptions} metaOptions
|
|
41
41
|
* @returns {this}
|
|
42
42
|
*/
|
|
43
|
-
setupProject(projectName: string, rootVid: string, rootGrafanaFolder: string, vidPrefix: string
|
|
43
|
+
setupProject(projectName: string, rootVid: string | undefined, rootGrafanaFolder: string, vidPrefix: string, metaOptions: GenericMetaOptions): this;
|
|
44
44
|
/**
|
|
45
45
|
* @param {string} projectName
|
|
46
46
|
* @param {string} rootFolderPath
|
package/dist/index.js
CHANGED
|
@@ -4251,17 +4251,17 @@ var DashboardManager = class {
|
|
|
4251
4251
|
}
|
|
4252
4252
|
/**
|
|
4253
4253
|
* @param {string} projectName
|
|
4254
|
-
* @param {string} rootVid
|
|
4254
|
+
* @param {string|undefined} rootVid
|
|
4255
4255
|
* @param {string} rootGrafanaFolder
|
|
4256
|
-
* @param {string
|
|
4256
|
+
* @param {string} vidPrefix
|
|
4257
4257
|
* @param {GenericMetaOptions} metaOptions
|
|
4258
4258
|
* @returns {this}
|
|
4259
4259
|
*/
|
|
4260
4260
|
setupProject(projectName, rootVid, rootGrafanaFolder, vidPrefix, metaOptions) {
|
|
4261
4261
|
const project = this._ensureProjectExists(projectName);
|
|
4262
|
-
project.setRootVid(rootVid);
|
|
4262
|
+
if (rootVid) project.setRootVid(rootVid);
|
|
4263
4263
|
project.setRootGrafanaFolder(rootGrafanaFolder);
|
|
4264
|
-
|
|
4264
|
+
project.setVidPrefix(vidPrefix);
|
|
4265
4265
|
project.setMetaOptions(metaOptions);
|
|
4266
4266
|
return this;
|
|
4267
4267
|
}
|
|
@@ -4459,13 +4459,11 @@ var createDashboards = async (localFolders, outDir, infosCode, dashboardsInfos)
|
|
|
4459
4459
|
const info = await getInfo(infosCode, localFolders);
|
|
4460
4460
|
let { projectName, projectRootVid, projectRootGrafanaFolder, projectVidPrefix } = info;
|
|
4461
4461
|
const dashboardManager = new DashboardManager();
|
|
4462
|
-
if (!
|
|
4463
|
-
if (!
|
|
4464
|
-
if (!projectRootGrafanaFolder || !projectRootVid) throw new Error(`Missing projectRootGrafanaFolder or projectRootVid in info`);
|
|
4465
|
-
if (!projectName) projectName = projectRootVid;
|
|
4462
|
+
if (!projectRootGrafanaFolder || !projectVidPrefix) throw new Error(`Missing projectRootGrafanaFolder or projectVidPrefix in info`);
|
|
4463
|
+
if (!projectName) projectName = projectVidPrefix;
|
|
4466
4464
|
dashboardManager.setupProject(projectName, projectRootVid, projectRootGrafanaFolder, projectVidPrefix, { info });
|
|
4467
4465
|
dashboardManager.registerDashboards(projectName, new DashboardsInfo(dashboardsInfos));
|
|
4468
|
-
await dashboardManager.generateDashboards(projectName, `${outDir}/${
|
|
4466
|
+
await dashboardManager.generateDashboards(projectName, `${outDir}/${projectVidPrefix}`);
|
|
4469
4467
|
};
|
|
4470
4468
|
//#endregion
|
|
4471
4469
|
export { DashboardInfo, DashboardManager, DashboardProject, DashboardsInfo, FolderInfo, createDashboards, ensurePathExists, getEnvVarsInfo, getFromOptionsOrInfo, getInfo, mergeOptions, readJsonFile, readYamlFile, writeJsonFile, writeYamlFile };
|