4 files changed
+20
-10
No files matched your search
@@ -5,7 +5,7 @@ import { execSync } from "child_process";
|
|||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), "");
|
const env = loadEnv(mode, process.cwd(), "");
|
||||||
let version = "3.1.2";
|
let version = "3.1.3";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: "/",
|
base: "/",
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class StatusPageController extends BaseController {
|
|||||||
|
|
||||||
deleteStatusPage = this.asyncHandler(
|
deleteStatusPage = this.asyncHandler(
|
||||||
async (req, res) => {
|
async (req, res) => {
|
||||||
await this.db.deleteStatusPage(req.params.url);
|
await this.db.statusPageModule.deleteStatusPage(req.params.url);
|
||||||
return res.success({
|
return res.success({
|
||||||
msg: this.stringService.statusPageDelete,
|
msg: this.stringService.statusPageDelete,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const CheckSchema = new mongoose.Schema(
|
|||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
enum: ["http", "hardware", "pagespeed", "distributed"],
|
enum: ["http", "ping", "pagespeed", "hardware", "docker", "port", "game"],
|
||||||
required: true,
|
required: true,
|
||||||
index: true,
|
index: true,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { match } from "assert";
|
||||||
|
|
||||||
const SERVICE_NAME = "NetworkService";
|
const SERVICE_NAME = "NetworkService";
|
||||||
|
|
||||||
class NetworkService {
|
class NetworkService {
|
||||||
@@ -147,16 +149,24 @@ class NetworkService {
|
|||||||
httpResponse.payload = payload;
|
httpResponse.payload = payload;
|
||||||
httpResponse.timings = response.timings || {};
|
httpResponse.timings = response.timings || {};
|
||||||
|
|
||||||
if (!expectedValue) {
|
if (!expectedValue && !jsonPath) {
|
||||||
return httpResponse;
|
return httpResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.info({
|
if (expectedValue) {
|
||||||
service: this.SERVICE_NAME,
|
let ok = false;
|
||||||
method: "requestHttp",
|
if (matchMethod === "equal") ok = payload === expectedValue;
|
||||||
message: `Job: [${name}](${_id}) match result with expected value`,
|
if (matchMethod === "include") ok = payload.includes(expectedValue);
|
||||||
details: { expectedValue, payload, jsonPath, matchMethod },
|
if (matchMethod === "regex") ok = new RegExp(expectedValue).test(payload);
|
||||||
});
|
|
||||||
|
if (ok === true) {
|
||||||
|
return httpResponse;
|
||||||
|
} else {
|
||||||
|
httpResponse.code = 500;
|
||||||
|
httpResponse.status = false;
|
||||||
|
return httpResponse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (jsonPath) {
|
if (jsonPath) {
|
||||||
const contentType = response.headers["content-type"];
|
const contentType = response.headers["content-type"];
|
||||||
|
|||||||
Reference in new issue
Block a user