Skip to content
代码片段 群组 项目
提交 80c57bea 编辑于 作者: Thuc Tran's avatar Thuc Tran
浏览文件

NOJIRA Remove box color handling for commands. Add required field to commands...

NOJIRA Remove box color handling for commands. Add required field to commands table. Some misc ui typo fixes for attributes
上级 d121cf1d
No related branches found
No related tags found
无相关合并请求
......@@ -65,7 +65,7 @@ limitations under the License.
}}</q-td>
<q-td key="required" :props="props" auto-width></q-td>
<q-td key="clientServer" :props="props" auto-width>{{
props.row.side
props.row.side === 'client' ? 'Client' : 'Server'
}}</q-td>
<q-td key="mfgID" :props="props" auto-width>{{
selectedCluster.manufacturerCode
......@@ -74,7 +74,6 @@ limitations under the License.
? props.row.manufacturerCode
: '-'
}}</q-td>
<q-td key="stgOpt" :props="props" auto-width></q-td>
<q-td key="singleton" :props="props" auto-width>
<q-checkbox
class="q-mt-xs"
......@@ -107,7 +106,9 @@ limitations under the License.
"
/>
</q-td>
<q-td key="type" :props="props" auto-width>{{ props.row.type }}</q-td>
<q-td key="type" :props="props" auto-width>{{
props.row.type ? props.row.type.toUpperCase() : 'UNKNOWN'
}}</q-td>
<q-td key="default" :props="props" auto-width>
<q-input
dense
......@@ -363,6 +364,7 @@ export default {
},
{
name: 'mfgID',
label: 'Mfg Code',
align: 'left',
field: 'mfgID',
sortable: true,
......
......@@ -45,14 +45,6 @@ limitations under the License.
:val="hashCommandIdClusterId(props.row.id, selectedCluster.id)"
indeterminate-value="false"
keep-color
:color="
handleColorSelection(
selectionOut,
requiredCommands,
props.row,
selectedCluster.id
)
"
@input="
handleCommandSelection(
selectionOut,
......@@ -91,7 +83,7 @@ limitations under the License.
props.row.label
}}</q-td>
<q-td key="required" :props="props" auto-width>
<!-- TODO -->
{{ isCommandRequired(props.row) ? 'Yes' : '' }}
</q-td>
<q-td key="mfgId" :props="props" auto-width
>{{
......@@ -182,36 +174,8 @@ export default {
}
this.$store.dispatch('zap/updateSelectedCommands', editContext)
},
handleColorSelection(selectedList, recommendedList, command, clusterId) {
let relevantClusterList =
command.source === 'client'
? this.selectionClusterClient
: this.selectionClusterServer
let isClusterIncluded = relevantClusterList.includes(clusterId)
let isCommandRecommended =
recommendedList.includes(command.id) || !command.isOptional
let isCommandIncluded = selectedList.includes(
this.hashCommandIdClusterId(command.id, clusterId)
)
if (isCommandRecommended && isCommandIncluded && isClusterIncluded) {
return 'green'
} else if (
isCommandRecommended &&
!isCommandIncluded &&
isClusterIncluded
) {
return 'red'
} else if (
isCommandRecommended &&
isCommandIncluded &&
!isClusterIncluded
) {
return 'orange'
} else {
return 'primary'
}
isCommandRequired(command) {
return this.requiredCommands.includes(command.id) || !command.isOptional
},
hashCommandIdClusterId(commandId, clusterId) {
return Util.cantorPair(commandId, clusterId)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册