]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix white screen on Safari 44360/head
author胡玮文 <huww98@outlook.com>
Mon, 20 Dec 2021 04:54:23 +0000 (12:54 +0800)
committer胡玮文 <huww98@outlook.com>
Mon, 20 Dec 2021 04:54:29 +0000 (12:54 +0800)
Safari do not support lookbehind in regular expression.

Fixes: https://tracker.ceph.com/issues/53665
Signed-off-by: 胡玮文 <huww98@outlook.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/host-form/host-form.component.ts

index a36f1fbacaff3bde9de3164fea341d82f690dbbd..6bfb79d679c8884e36d2138deabc5c4ac6b58aa6 100644 (file)
@@ -110,7 +110,7 @@ export class HostFormComponent extends CdForm implements OnInit {
     // pattern to replace range [0-5] to [0..5](valid expression for brace expansion)
     // replace any kind of brackets with curly braces
     return hostname
-      .replace(/(?<=\d)\s*-\s*(?=\d)/g, '..')
+      .replace(/(\d)\s*-\s*(\d)/g, '$1..$2')
       .replace(/\(/g, '{')
       .replace(/\)/g, '}')
       .replace(/\[/g, '{')