-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #325 from AmericanWhitewater/development
Release 2021-02-03
- Loading branch information
Showing
17 changed files
with
159 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env node | ||
require("dotenv").config(); | ||
// grab cli service requirements. | ||
const { error } = require("@vue/cli-shared-utils"); | ||
const Service = require("@vue/cli-service/lib/Service"); | ||
const service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd()); | ||
|
||
//parse the environment base | ||
const url = require("url"); | ||
const baseURL = process.env.VUE_APP_BASE_URL || "http://localhost:9669"; | ||
const parts = url.parse(baseURL); | ||
|
||
const command = "serve"; | ||
const publicHost = `${parts.hostname}:${parts.port}`; | ||
|
||
//set container name based on URL base. | ||
const args = ["--public", publicHost, "--port", parts.port]; | ||
const argsV = { public: publicHost, port: parts.port }; | ||
|
||
service.run(command, argsV, args).catch((err) => { | ||
error(err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Returns the reading with the precision specified by the gauge format. | ||
* @param reading {number} | ||
* @param metric_format {string} - value from metrics | ||
* @return number with the specified precision | ||
*/ | ||
|
||
export function formatReading(reading, metric_format) { | ||
if (typeof reading === "number") { | ||
if (metric_format) { | ||
const m = metric_format.match(/%([0-9]+)\.([0-9]+)f/); | ||
|
||
if (m.length) { | ||
return reading.toFixed(Number.parseInt(m[2])); | ||
} | ||
} | ||
|
||
return reading.toFixed(2); | ||
} | ||
return ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.