@nethserver/ns8-ui-lib 0.0.69 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import { carbonPrefixMixin, themeMixin } from '@carbon/vue/src/mixins';
6
6
  import CheckmarkFilled20 from '@carbon/icons-vue/es/checkmark--filled/20';
7
7
  import ErrorFilled20 from '@carbon/icons-vue/es/error--filled/20';
8
8
  import Warning20 from '@carbon/icons-vue/es/warning--filled/20';
9
+ import crypto from 'crypto';
9
10
  import OverflowMenuVertical20 from '@carbon/icons-vue/es/overflow-menu--vertical/20';
10
11
  import Vue from 'vue';
11
12
  import '@carbon/charts/styles.css';
@@ -6724,6 +6725,182 @@ const __vue_component__$B = /*#__PURE__*/normalizeComponent({
6724
6725
 
6725
6726
  var __vue_component__$C = __vue_component__$B;
6726
6727
 
6728
+ // Unique ID creation requires a high quality random # generator. In node.js
6729
+ // this is pretty straight-forward - we use the crypto API.
6730
+
6731
+
6732
+
6733
+ var rng = function nodeRNG() {
6734
+ return crypto.randomBytes(16);
6735
+ };
6736
+
6737
+ /**
6738
+ * Convert array of 16 byte values to UUID string format of the form:
6739
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
6740
+ */
6741
+ var byteToHex = [];
6742
+ for (var i = 0; i < 256; ++i) {
6743
+ byteToHex[i] = (i + 0x100).toString(16).substr(1);
6744
+ }
6745
+
6746
+ function bytesToUuid(buf, offset) {
6747
+ var i = offset || 0;
6748
+ var bth = byteToHex;
6749
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
6750
+ return ([
6751
+ bth[buf[i++]], bth[buf[i++]],
6752
+ bth[buf[i++]], bth[buf[i++]], '-',
6753
+ bth[buf[i++]], bth[buf[i++]], '-',
6754
+ bth[buf[i++]], bth[buf[i++]], '-',
6755
+ bth[buf[i++]], bth[buf[i++]], '-',
6756
+ bth[buf[i++]], bth[buf[i++]],
6757
+ bth[buf[i++]], bth[buf[i++]],
6758
+ bth[buf[i++]], bth[buf[i++]]
6759
+ ]).join('');
6760
+ }
6761
+
6762
+ var bytesToUuid_1 = bytesToUuid;
6763
+
6764
+ // **`v1()` - Generate time-based UUID**
6765
+ //
6766
+ // Inspired by https://github.com/LiosK/UUID.js
6767
+ // and http://docs.python.org/library/uuid.html
6768
+
6769
+ var _nodeId;
6770
+ var _clockseq;
6771
+
6772
+ // Previous uuid creation time
6773
+ var _lastMSecs = 0;
6774
+ var _lastNSecs = 0;
6775
+
6776
+ // See https://github.com/uuidjs/uuid for API details
6777
+ function v1(options, buf, offset) {
6778
+ var i = buf && offset || 0;
6779
+ var b = buf || [];
6780
+
6781
+ options = options || {};
6782
+ var node = options.node || _nodeId;
6783
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
6784
+
6785
+ // node and clockseq need to be initialized to random values if they're not
6786
+ // specified. We do this lazily to minimize issues related to insufficient
6787
+ // system entropy. See #189
6788
+ if (node == null || clockseq == null) {
6789
+ var seedBytes = rng();
6790
+ if (node == null) {
6791
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
6792
+ node = _nodeId = [
6793
+ seedBytes[0] | 0x01,
6794
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
6795
+ ];
6796
+ }
6797
+ if (clockseq == null) {
6798
+ // Per 4.2.2, randomize (14 bit) clockseq
6799
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
6800
+ }
6801
+ }
6802
+
6803
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
6804
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
6805
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
6806
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
6807
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
6808
+
6809
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
6810
+ // cycle to simulate higher resolution clock
6811
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
6812
+
6813
+ // Time since last uuid creation (in msecs)
6814
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
6815
+
6816
+ // Per 4.2.1.2, Bump clockseq on clock regression
6817
+ if (dt < 0 && options.clockseq === undefined) {
6818
+ clockseq = clockseq + 1 & 0x3fff;
6819
+ }
6820
+
6821
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
6822
+ // time interval
6823
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
6824
+ nsecs = 0;
6825
+ }
6826
+
6827
+ // Per 4.2.1.2 Throw error if too many uuids are requested
6828
+ if (nsecs >= 10000) {
6829
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
6830
+ }
6831
+
6832
+ _lastMSecs = msecs;
6833
+ _lastNSecs = nsecs;
6834
+ _clockseq = clockseq;
6835
+
6836
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
6837
+ msecs += 12219292800000;
6838
+
6839
+ // `time_low`
6840
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
6841
+ b[i++] = tl >>> 24 & 0xff;
6842
+ b[i++] = tl >>> 16 & 0xff;
6843
+ b[i++] = tl >>> 8 & 0xff;
6844
+ b[i++] = tl & 0xff;
6845
+
6846
+ // `time_mid`
6847
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
6848
+ b[i++] = tmh >>> 8 & 0xff;
6849
+ b[i++] = tmh & 0xff;
6850
+
6851
+ // `time_high_and_version`
6852
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
6853
+ b[i++] = tmh >>> 16 & 0xff;
6854
+
6855
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
6856
+ b[i++] = clockseq >>> 8 | 0x80;
6857
+
6858
+ // `clock_seq_low`
6859
+ b[i++] = clockseq & 0xff;
6860
+
6861
+ // `node`
6862
+ for (var n = 0; n < 6; ++n) {
6863
+ b[i + n] = node[n];
6864
+ }
6865
+
6866
+ return buf ? buf : bytesToUuid_1(b);
6867
+ }
6868
+
6869
+ var v1_1 = v1;
6870
+
6871
+ function v4(options, buf, offset) {
6872
+ var i = buf && offset || 0;
6873
+
6874
+ if (typeof(options) == 'string') {
6875
+ buf = options === 'binary' ? new Array(16) : null;
6876
+ options = null;
6877
+ }
6878
+ options = options || {};
6879
+
6880
+ var rnds = options.random || (options.rng || rng)();
6881
+
6882
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
6883
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
6884
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
6885
+
6886
+ // Copy bytes to buffer, if provided
6887
+ if (buf) {
6888
+ for (var ii = 0; ii < 16; ++ii) {
6889
+ buf[i + ii] = rnds[ii];
6890
+ }
6891
+ }
6892
+
6893
+ return buf || bytesToUuid_1(rnds);
6894
+ }
6895
+
6896
+ var v4_1 = v4;
6897
+
6898
+ var uuid = v4_1;
6899
+ uuid.v1 = v1_1;
6900
+ uuid.v4 = v4_1;
6901
+
6902
+ var uuid_1 = uuid;
6903
+
6727
6904
  var UtilService = {
6728
6905
  name: "UtilService",
6729
6906
 
@@ -6990,6 +7167,13 @@ var UtilService = {
6990
7167
  if (this.core.$route.fullPath != path) {
6991
7168
  this.core.$router.push(path);
6992
7169
  }
7170
+ },
7171
+
7172
+ /**
7173
+ * Generate a universally unique identifier
7174
+ */
7175
+ getUuid() {
7176
+ return uuid_1.v4();
6993
7177
  }
6994
7178
 
6995
7179
  }