Conformance Filter: fetch filter doning 50%.
This commit is contained in:
@@ -9,6 +9,7 @@ export default defineStore('conformanceStore', {
|
||||
conformanceLogId: null, // log 檔
|
||||
conformanceFilterId: null, // filter 檔
|
||||
conformanceLogTempCheckId: null, // log 檔存檔前的 check Id
|
||||
conformanceFilterTempCheckId: null, // Filter 檔存檔前的 check Id
|
||||
allConformanceTask: [],
|
||||
allCfmSeqStart: [],
|
||||
allCfmSeqEnd: [],
|
||||
@@ -178,13 +179,14 @@ export default defineStore('conformanceStore', {
|
||||
* fetch Log Conformance Parameters api for Rule Settings.
|
||||
*/
|
||||
async getConformanceParams() {
|
||||
let logId = this.conformanceLogId;
|
||||
let filterId = this.conformanceFilterId;
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/filter-checks/params?filter_id=${filterId}`;
|
||||
else api = `/api/log-checks/params?log_id=${logId}`;
|
||||
console.log('getConformanceParams', api);
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -201,23 +203,34 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Creates a new temporary check for a log.
|
||||
*/
|
||||
async addLogConformanceTempCheckId(data) {
|
||||
let logId = this.conformanceLogId;
|
||||
const api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
async addConformanceCheckId(data) {
|
||||
const logId = this.conformanceLogId;
|
||||
const filterId = this.conformanceFilterId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterId !== null) api = `/api/temp-filter-checks?filter_id=${filterId}`;
|
||||
else api = `/api/temp-log-checks?log_id=${logId}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.post(api, data);
|
||||
this.conformanceLogTempCheckId = response.data.id;
|
||||
if(filterId !== null) this.conformanceFilterTempCheckId = response.data.id;
|
||||
else this.conformanceLogTempCheckId = response.data.id;
|
||||
} catch(error) {
|
||||
apiError(error, 'Failed to add the Temporary Check for a log.');
|
||||
apiError(error, 'Failed to add the Temporary Check for a file.');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Get the Temporary Log Conformance Report
|
||||
*/
|
||||
async getLogConformanceTempReport() {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}`;
|
||||
async getConformanceReport() {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId;
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -229,9 +242,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the detail of a temporary log conformance issue.
|
||||
*/
|
||||
async getLogConformanceIssue(issueNo) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}`;
|
||||
async getConformanceIssue(issueNo) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -243,9 +261,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Trace Details of a Temporary Log Conformance lssue.
|
||||
*/
|
||||
async getLogConformanceTraceDetail(issueNo, traceId, start) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
async getConformanceTraceDetail(issueNo, traceId, start) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/issues/${issueNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -260,9 +283,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Details of a Temporary Log Conformance Loop.
|
||||
*/
|
||||
async getLogConformanceLoop(loopNo) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
let api = `/api/temp-log-checks/${checkId}/loops/${loopNo}`;
|
||||
async getConformanceLoop(loopNo) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/loops/${loopNo}`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/loops/${loopNo}`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
@@ -274,9 +302,14 @@ export default defineStore('conformanceStore', {
|
||||
/**
|
||||
* Get the Trace Details of a Temporary Log Conformance Loops.
|
||||
*/
|
||||
async getLogConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
let checkId = this.conformanceLogTempCheckId;
|
||||
const api = `/api/temp-log-checks/${checkId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
async getConformanceLoopsTraceDetail(loopNo, traceId, start) {
|
||||
const logTempCheckId = this.conformanceLogTempCheckId;
|
||||
const filterTempCheckId = this.conformanceFilterTempCheckId
|
||||
let api = '';
|
||||
|
||||
// 先判斷 filter 檔,再判斷 log 檔。
|
||||
if(filterTempCheckId !== null) api = `/api/temp-filter-checks/${filterTempCheckId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
else api = `/api/temp-log-checks/${logTempCheckId}/loops/${loopNo}/traces/${traceId}?start=${start}&page_size=20`;
|
||||
|
||||
try {
|
||||
const response = await this.$axios.get(api);
|
||||
|
||||
Reference in New Issue
Block a user