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