|
|
@ -60,7 +60,11 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import _ from 'lodash' |
|
|
|
import _ from 'lodash' |
|
|
|
import disabledState from '@/module/mixin/disabledState' |
|
|
|
import disabledState from '@/module/mixin/disabledState' |
|
|
|
|
|
|
|
const StrategyMap = { |
|
|
|
|
|
|
|
WARN: 'WARN', |
|
|
|
|
|
|
|
FAILED: 'FAILED', |
|
|
|
|
|
|
|
WARNFAILED: 'WARNFAILED' |
|
|
|
|
|
|
|
} |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'form-timeout-alarm', |
|
|
|
name: 'form-timeout-alarm', |
|
|
|
data () { |
|
|
|
data () { |
|
|
@ -100,10 +104,12 @@ |
|
|
|
strategy: (() => { |
|
|
|
strategy: (() => { |
|
|
|
// Handling checkout sequence |
|
|
|
// Handling checkout sequence |
|
|
|
let strategy = this.strategy |
|
|
|
let strategy = this.strategy |
|
|
|
if (strategy.length === 2 && strategy[0] === 'FAILED') { |
|
|
|
if (strategy.length > 1) { |
|
|
|
return [strategy[1], strategy[0]].join(',') |
|
|
|
return StrategyMap.WARNFAILED |
|
|
|
|
|
|
|
} else if (strategy.length === 1) { |
|
|
|
|
|
|
|
return strategy[0] |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return strategy.join(',') |
|
|
|
return '' |
|
|
|
} |
|
|
|
} |
|
|
|
})(), |
|
|
|
})(), |
|
|
|
interval: parseInt(this.interval), |
|
|
|
interval: parseInt(this.interval), |
|
|
@ -119,7 +125,15 @@ |
|
|
|
// Non-null objects represent backfill |
|
|
|
// Non-null objects represent backfill |
|
|
|
if (!_.isEmpty(o) && o.timeout) { |
|
|
|
if (!_.isEmpty(o) && o.timeout) { |
|
|
|
this.enable = o.timeout.enable || false |
|
|
|
this.enable = o.timeout.enable || false |
|
|
|
this.strategy = _.split(o.timeout.strategy, ',') || ['WARN'] |
|
|
|
if (o.timeout.strategy) { |
|
|
|
|
|
|
|
if (o.timeout.strategy === StrategyMap.WARNFAILED) { |
|
|
|
|
|
|
|
this.strategy = [StrategyMap.WARN, StrategyMap.FAILED] |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.strategy = [o.timeout.strategy] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.strategy = [StrategyMap.WARN] |
|
|
|
|
|
|
|
} |
|
|
|
this.interval = o.timeout.interval || null |
|
|
|
this.interval = o.timeout.interval || null |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|