@dataloop-ai/components 0.18.124 → 0.18.125

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.18.124",
3
+ "version": "0.18.125",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -731,11 +731,10 @@ export default defineComponent({
731
731
  display: flex;
732
732
  align-items: center;
733
733
 
734
+ &--small,
734
735
  &--s {
735
- margin: 4px auto auto;
736
- }
737
- &--small {
738
- margin: 4px auto auto;
736
+ margin-bottom: 0;
737
+ margin-right: 4px;
739
738
  }
740
739
  }
741
740
 
@@ -917,10 +917,7 @@ export default defineComponent({
917
917
  <style scoped lang="scss">
918
918
  .root-container {
919
919
  width: var(--dl-select-width);
920
- &--s {
921
- display: flex;
922
- align-items: center;
923
- }
920
+ &--s,
924
921
  &--small {
925
922
  display: flex;
926
923
  align-items: center;
@@ -935,9 +932,10 @@ export default defineComponent({
935
932
  align-items: center;
936
933
  color: var(--dl-color-lighter);
937
934
 
935
+ &--s,
938
936
  &--small {
939
- margin-right: 5px;
940
- margin-bottom: 0px;
937
+ margin-bottom: 0;
938
+ margin-right: 4px;
941
939
  }
942
940
  }
943
941
 
@@ -37,174 +37,144 @@ export default defineComponent({
37
37
  const lines = ref(false)
38
38
 
39
39
  const codeEditorValue = ref(
40
- 'import urllib3\n' +
41
- 'urllib3.disable_warnings()\n' +
42
- 'from base64 import b64encode\n' +
43
- 'import os\n' +
44
- 'import sys\n' +
45
- 'import json\n' +
46
- 'import getpass\n' +
47
- 'from optparse import OptionParser\n' +
48
- 'from datetime import datetime, timedelta\n' +
49
- 'import time\n' +
50
- 'from time import gmtime, strftime, strptime\n' +
51
- 'from operator import itemgetter, attrgetter\n' +
52
- 'from purity_fb import PurityFb, FileSystem, FileSystemSnapshot, SnapshotSuffix, rest\n' +
53
- '\n' +
54
- '# Global Variables\n' +
55
- "VERSION = '2.0.0'\n" +
56
- "HEADER = 'Pure Storage Take FlashBlade Snapshot (' + VERSION + ')'\n" +
57
- "BANNER = ('=' * 132)\n" +
58
- 'DEBUG_FLAG = False\n' +
59
- 'VERBOSE_FLAG = False\n' +
60
- "COOKIE = ''\n" +
61
- '\n' +
62
- 'def parsecl():\n' +
63
- " usage = 'usage: %prog [options]'\n" +
64
- " version = '%prog ' + VERSION\n" +
65
- ' description = "This application has been developed using Pure Storage v1.12 RESTful Web Service interfaces. Developed and tested using Python 3.9.5 Please contact ron@purestorage.com for assistance."\n' +
66
- '\n' +
67
- ' parser = OptionParser(usage=usage, version=version, description=description)\n' +
68
- '\n' +
69
- '\n' +
70
- " parser.add_option('-d', '--debug',\n" +
71
- " action = 'store_true',\n" +
72
- " dest = 'DEBUG_FLAG',\n" +
73
- ' default = False,\n' +
74
- " help = 'Debug [default: %default]')\n" +
75
- ' \n' +
76
- " parser.add_option('-f', '--filesystem',\n" +
77
- " action = 'store',\n" +
78
- " type = 'string',\n" +
79
- " dest = 'fs',\n" +
80
- " help = 'FlashBlade File System')\n" +
81
- ' \n' +
82
- " parser.add_option('-r', '--replicant',\n" +
83
- " action = 'store',\n" +
84
- " type = 'string',\n" +
85
- " dest = 'flashBladeRep',\n" +
86
- " help = 'FlashBlade Replicant array')\n" +
87
- ' \n' +
88
- " parser.add_option('-s', '--server',\n" +
89
- " action = 'store',\n" +
90
- " type = 'string',\n" +
91
- " dest = 'flashBlade',\n" +
92
- " help = 'FlashBlade array')\n" +
93
- ' \n' +
94
- " parser.add_option('-t', '--token',\n" +
95
- " action = 'store',\n" +
96
- " type = 'string',\n" +
97
- " dest = 'API_TOKEN',\n" +
98
- " help = 'Pure API Token')\n" +
99
- '\n' +
100
- " parser.add_option('-S', '--suffix',\n" +
101
- " action = 'store',\n" +
102
- " type = 'string',\n" +
103
- " dest = 'suffix',\n" +
104
- " help = 'File system snapshot suffix')\n" +
105
- '\n' +
106
- " parser.add_option('-v', '--verbose',\n" +
107
- " action = 'store_true',\n" +
108
- " dest = 'VERBOSE_FLAG',\n" +
109
- ' default = False,\n' +
110
- " help = 'Verbose [default: %default]')\n" +
111
- '\n' +
112
- ' (options, args) = parser.parse_args()\n' +
113
- '\n' +
114
- " '''\n" +
115
- ' print("Options:", options)\n' +
116
- ' print("Args:", args)\n' +
117
- " '''\n" +
118
- ' \n' +
119
- ' return(options)\n' +
120
- '\n' +
121
- 'def main():\n' +
122
- ' # Setup variables\n' +
123
- ' global DEBUG_FLAG\n' +
124
- ' exit_code = 0\n' +
125
- '\n' +
126
- ' # Check for command line parameters\n' +
127
- ' options = parsecl()\n' +
128
- ' API_TOKEN = options.API_TOKEN\n' +
129
- ' flashBlade = options.flashBlade\n' +
130
- ' flashBladeRep = options.flashBladeRep\n' +
131
- ' fs = options.fs\n' +
132
- ' suffix = options.suffix\n' +
133
- ' DEBUG_FLAG = options.DEBUG_FLAG\n' +
134
- ' VERBOSE_FLAG = options.VERBOSE_FLAG\n' +
135
- ' \n' +
136
- ' if DEBUG_FLAG:\n' +
137
- " print('API Token:', API_TOKEN)\n" +
138
- " print('FlashBlade:', flashBlade)\n" +
139
- " print('Relplicant:', flashBladeRep)\n" +
140
- " print('File System:', fs)\n" +
141
- " print('Suffix:', suffix)\n" +
142
- " print('Debug Flag:', DEBUG_FLAG)\n" +
143
- " print('Verbose Flag:', VERBOSE_FLAG)\n" +
144
- '\n' +
145
- ' if flashBlade == None:\n' +
146
- " sys.exit('Exiting: You must provide FlashBlade details')\n" +
147
- ' \n' +
148
- ' if API_TOKEN == None:\n' +
149
- " sys.exit('Exiting: You must provide FlashBlade API Token details')\n" +
150
- '\n' +
151
- ' if fs == None:\n' +
152
- " sys.exit('Exiting: You must provide FlashBlade file system')\n" +
153
- '\n' +
154
- ' print(BANNER)\n' +
155
- " print(HEADER + ' - ' + flashBlade)\n" +
156
- " print(strftime('%d/%m/%Y %H:%M:%S %Z', gmtime()))\n" +
157
- ' print(BANNER)\n' +
158
- '\n' +
159
- ' # create PurityFb object for a certain array\n' +
160
- ' fb = PurityFb(flashBlade)\n' +
161
- ' # this is required for versions before Purity//FB 2.1.3 because they only supports self-signed\n' +
162
- ' # certificates. in later versions, this may be unnecessary if you have imported a certificate.\n' +
163
- ' fb.disable_verify_ssl()\n' +
164
- ' \n' +
165
- ' try:\n' +
166
- ' res= fb.login(API_TOKEN)\n' +
167
- ' except rest.ApiException as e:\n' +
168
- ' print("Exception when logging in to the array: %s\\n" % e)\n' +
169
- '\n' +
170
- ' if res:\n' +
171
- ' try:\n' +
172
- ' if flashBladeRep:\n' +
173
- ' if suffix:\n' +
174
- ' # create a snapshot with suffix and replicate to target array\n' +
175
- ' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs],\n' +
176
- ' suffix=SnapshotSuffix(suffix),\n' +
177
- ' send=True,\n' +
178
- ' targets=[flashBladeRep])\n' +
179
- ' else:\n' +
180
- ' # create a snapshot without suffix and replicate to target array\n' +
181
- ' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs],\n' +
182
- ' send=True,\n' +
183
- ' targets=[flashBladeRep])\n' +
184
- ' else:\n' +
185
- ' if suffix:\n' +
186
- ' # create a snapshot with suffix for the file system\n' +
187
- ' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs],\n' +
188
- ' suffix=SnapshotSuffix(suffix))\n' +
189
- ' else:\n' +
190
- ' # create a snapshot without suffix for the file system\n' +
191
- ' res = fb.file_system_snapshots.create_file_system_snapshots(sources=[fs])\n' +
192
- ' \n' +
193
- ' if VERBOSE_FLAG:\n' +
194
- ' print(res)\n' +
195
- ' \n' +
196
- " print('Snapshot created for', fs, 'suffix', res.items[0].suffix) \n" +
197
- '\n' +
198
- ' except rest.ApiException as e:\n' +
199
- ' print("Exception when creating file system snapshots: %s\\n" % e) \n' +
200
- '\n' +
201
- ' fb.logout()\n' +
202
- ' print(BANNER)\n' +
203
- " print(strftime('%d/%m/%Y %H:%M:%S %Z', gmtime()))\n" +
204
- ' print(BANNER)\n' +
205
- ' sys.exit(exit_code)\n' +
206
- '\n' +
207
- 'main()'
40
+ `import getopt, sys, urllib, time
41
+
42
+ def main():
43
+
44
+ status = 0
45
+
46
+ # input arguments
47
+
48
+ try:
49
+ opts, args = getopt.getopt(sys.argv[1:],"h:iq",
50
+ ["help","invid=","quarter="])
51
+ except getopt.GetoptError:
52
+ usage()
53
+ tree = False
54
+ for o, a in opts:
55
+ if o in ("-h", "--help"):
56
+ usage()
57
+ if o in ("-i", "--invid"):
58
+ invid = str(a)
59
+ if o in ("-q", "--quarter"):
60
+ quarter = int(a)
61
+
62
+ kepid, invid, kepmag, mode, start, stop, release = GetMetaData(invid,quarter)
63
+
64
+ # convert Gregorian date to Julian date
65
+
66
+ def Greg2JD(year, month, day):
67
+
68
+ if (month < 3):
69
+ y = float(year) - 1.0
70
+ m = float(month) + 12.0
71
+ else:
72
+ y = float(year)
73
+ m = float(month)
74
+ a = 0; b = 0
75
+ if (y + m / 12 + float(day) / 365 > 1582.87166):
76
+ a = int(y / 100)
77
+ b = 2 - a + int(float(a / 4))
78
+ c = 0
79
+ if (y < 0.0):
80
+ c = int(365.25 * y - 0.75)
81
+ else:
82
+ c = int(365.25 * y)
83
+ d = int(30.6001 * (m + 1))
84
+ jd = float(b + c + d + day + 1720994.5);
85
+
86
+ return jd
87
+
88
+ # start and stop Julian dates for Kepler quarters
89
+
90
+ def QuarterDates(quarter):
91
+
92
+ Qstart = [2454953.5,2454964.5,2454998.5]
93
+ Qstop = [2454962.5,2454997.5,2455100.5]
94
+ if (quarter < len(Qstart)):
95
+ return Qstart[quarter] - 10, Qstop[quarter] + 10
96
+ else:
97
+ message = 'No spacecraft roll dates recorded for quarter ' + str(quarter) + '.\n'
98
+ message += 'Find an updated script at http://keplergo.arc.nasa.gov'
99
+ sys.exit(message)
100
+
101
+ def GetMetaData(invid,quarter):
102
+
103
+ # get start and stop dates for quarter
104
+
105
+ Qstart, Qstop = QuarterDates(quarter)
106
+
107
+ # URL for MAST data access
108
+
109
+ url = 'http://archive.stsci.edu/kepler/data_search/search.php?'
110
+ url += 'action=Search'
111
+ url += '&max_records=100000'
112
+ url += '&verb=3'
113
+ url += '&ktc_investigation_id=' + invid
114
+ url += '&ktc_target_type[]=LC'
115
+ url += '&ktc_target_type[]=SC'
116
+ url += '&outputformat=CSV'
117
+
118
+ # retrieve results from MAST
119
+
120
+ lines = urllib.urlopen(url)
121
+
122
+ # extract metadata from CSV
123
+
124
+ print '\n%4s %9s %7s %5s %2s %10s %10s %10s' % \
125
+ ('#', 'KepID', 'InvID', 'KpMag', 'Md', 'Start', 'Stop', 'Release')
126
+ kepid = []; invid = []; mode = []
127
+ ra = []; dec = []; kepmag = []
128
+ start = []; stop = []; release = []
129
+ for line in lines:
130
+ line = line.strip().split(',')
131
+ if (len(line[0]) > 0 and
132
+ 'Kepler' not in line[0] and
133
+ 'integer' not in line[0] and
134
+ 'no rows found' not in line[0]):
135
+ GregStart = line[7][:10].split('-')
136
+ GregStop = line[8][:10].split('-')
137
+ JDstart = Greg2JD(int(GregStart[0]),int(GregStart[1]),int(GregStart[2]))
138
+ JDstop = Greg2JD(int(GregStop[0]),int(GregStop[1]),int(GregStop[2]))
139
+ if (JDstart > Qstart and JDstop < Qstop):
140
+ kepid.append(line[0])
141
+ invid.append(line[1])
142
+ kepmag.append(float(line[22]))
143
+ mode.append(line[6])
144
+ ra.append(line[4])
145
+ dec.append(line[5])
146
+ start.append(line[7])
147
+ stop.append(line[8])
148
+ release.append(line[9])
149
+ print '%4d %9s %7s %5.2f %2s %10s %10s %10s' % \
150
+ (len(kepid), kepid[-1], invid[-1], kepmag[-1], mode[-1],
151
+ start[-1][:10], stop[-1][:10], release[-1][:10])
152
+ if (len(kepid) == 0):
153
+ print '\nNo data available as of ' + time.asctime(time.localtime())
154
+ else:
155
+ print '\n' + time.asctime(time.localtime())
156
+
157
+ return kepid, invid, kepmag, mode, start, stop, release
158
+
159
+ def usage():
160
+
161
+ print ' -------------------------------------------------------------------------'
162
+ print ' Martin Still (martin.d.still@nasa.gov) NASA Ames Nov 11, 2009'
163
+ print ' '
164
+ print ' Find all quarter data associated with an investigation ID within the MAST'
165
+ print ' archive.'
166
+ print ' '
167
+ print ' Typical usage:'
168
+ print ' KepInvestigationAtMAST.py --invid=GO10003 --quarter=1'
169
+ print ' '
170
+ print ' --invid Investigation ID number of GO program'
171
+ print ' --quarter Kepler quarter (integer number)'
172
+ print ' -------------------------------------------------------------------------'
173
+ sys.exit(' ')
174
+
175
+ #-------------------------------
176
+ if __name__ == "__main__":
177
+ main()`
208
178
  )
209
179
  const language = ref('python')
210
180
 
@@ -143,6 +143,43 @@
143
143
  </template>
144
144
  </dl-input>
145
145
  </div>
146
+
147
+ <p>input with tooltip and no title</p>
148
+ <div>
149
+ <dl-input
150
+ class="input-parts"
151
+ placeholder="Select option"
152
+ tooltip="test me tooltip"
153
+ >
154
+ <template #action>
155
+ <dl-button
156
+ dense
157
+ flat
158
+ icon="icon-dl-add"
159
+ size="m"
160
+ />
161
+ </template>
162
+ </dl-input>
163
+ </div>
164
+
165
+ <p>input with tooltip and no title size small</p>
166
+ <div>
167
+ <dl-input
168
+ class="input-parts"
169
+ placeholder="Select option"
170
+ tooltip="test me tooltip"
171
+ size="small"
172
+ >
173
+ <template #action>
174
+ <dl-button
175
+ dense
176
+ flat
177
+ icon="icon-dl-add"
178
+ size="m"
179
+ />
180
+ </template>
181
+ </dl-input>
182
+ </div>
146
183
  </div>
147
184
  </template>
148
185
  <script lang="ts">
@@ -426,6 +426,81 @@
426
426
  </div>
427
427
  </template>
428
428
  </dl-select>
429
+
430
+ Select with tooltip no title
431
+ <dl-select
432
+ v-model="selectedOption"
433
+ :options="[
434
+ {
435
+ subLabel: 'not so high',
436
+ label: 'High',
437
+ value: 'high',
438
+ bgColor: 'dl-color-negative'
439
+ },
440
+ {
441
+ subLabel: 'not so medium',
442
+ label: 'Medium',
443
+ value: 'medium',
444
+ bgColor: 'dl-color-warning',
445
+ textColor: 'dl-color-darker'
446
+ },
447
+ {
448
+ subLabel: 'not so low',
449
+ label: 'Low',
450
+ value: 'low',
451
+ bgColor: 'dl-color-positive',
452
+ textColor: 'dl-color-darker'
453
+ }
454
+ ]"
455
+ clearable
456
+ style="margin-bottom: 150px"
457
+ tooltip="test tooltip"
458
+ >
459
+ <template #option="scope">
460
+ <div style="padding: 5px 0px">
461
+ <div>{{ scope.opt.label }}</div>
462
+ <div>{{ scope.opt.subLabel }}</div>
463
+ </div>
464
+ </template>
465
+ </dl-select>
466
+
467
+ Select with tooltip no title size small
468
+ <dl-select
469
+ v-model="selectedOption"
470
+ :options="[
471
+ {
472
+ subLabel: 'not so high',
473
+ label: 'High',
474
+ value: 'high',
475
+ bgColor: 'dl-color-negative'
476
+ },
477
+ {
478
+ subLabel: 'not so medium',
479
+ label: 'Medium',
480
+ value: 'medium',
481
+ bgColor: 'dl-color-warning',
482
+ textColor: 'dl-color-darker'
483
+ },
484
+ {
485
+ subLabel: 'not so low',
486
+ label: 'Low',
487
+ value: 'low',
488
+ bgColor: 'dl-color-positive',
489
+ textColor: 'dl-color-darker'
490
+ }
491
+ ]"
492
+ clearable
493
+ style="margin-bottom: 150px"
494
+ size="small"
495
+ tooltip="test tooltip"
496
+ >
497
+ <template #option="scope">
498
+ <div style="padding: 5px 0px">
499
+ <div>{{ scope.opt.label }}</div>
500
+ <div>{{ scope.opt.subLabel }}</div>
501
+ </div>
502
+ </template>
503
+ </dl-select>
429
504
  </div>
430
505
  </template>
431
506