fix: use short id
This commit is contained in:
Родитель
29a7c83edc
Коммит
303a3b24b9
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-service"
|
||||
><i class="icon-tag"></i> Service code or name</label
|
||||
><i class="icon-tag"></i> Service code or id</label
|
||||
>
|
||||
<input type="text" id="node-input-service" placeholder="*" />
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-service"
|
||||
><i class="icon-tag"></i> Service code or name</label
|
||||
><i class="icon-tag"></i> Service code or id</label
|
||||
>
|
||||
<input type="text" id="node-input-service" placeholder="*" />
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
</div>
|
||||
<div class="form-row">
|
||||
<label for="node-input-service"
|
||||
><i class="icon-tag"></i> Service code or name</label
|
||||
><i class="icon-tag"></i> Service code or id</label
|
||||
>
|
||||
<input type="text" id="node-input-service" placeholder="*" />
|
||||
</div>
|
||||
|
|
|
@ -20,15 +20,16 @@ export function createDeviceFilter(options: JacdacDeviceFilterOptions) {
|
|||
export function createServiceFilter(options: JacdacServiceFilterOptions) {
|
||||
const { service, serviceIndex, serviceInstanceName } = options
|
||||
|
||||
const nservice = service
|
||||
? service.toLowerCase().replace(/\s/g, "")
|
||||
: service
|
||||
const instanceNameRx = serviceInstanceName
|
||||
? new RegExp(serviceInstanceName, "i")
|
||||
: undefined
|
||||
return (srv: JDService) =>
|
||||
(!service ||
|
||||
srv.serviceClass === parseInt(service, 16) ||
|
||||
(srv.name &&
|
||||
srv.name.toLocaleLowerCase() ===
|
||||
service.toLocaleLowerCase())) &&
|
||||
(srv.specification && srv.specification.shortId === nservice)) &&
|
||||
(serviceIndex === undefined || serviceIndex == srv.serviceIndex) &&
|
||||
(!instanceNameRx || instanceNameRx.test(srv.instanceName))
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче