]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix white screen on Safari 45301/head
author胡玮文 <huww98@outlook.com>
Mon, 20 Dec 2021 04:54:23 +0000 (12:54 +0800)
committerErnesto Puerta <epuertat@redhat.com>
Tue, 8 Mar 2022 17:58:04 +0000 (18:58 +0100)
Safari do not support lookbehind in regular expression.

Fixes: https://tracker.ceph.com/issues/53665
Signed-off-by: 胡玮文 <huww98@outlook.com>
(cherry picked from commit d4b239c63595e1dc9772a135bf6b9c0608f852ce)

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, '{')