mushy 0.13.0 → 0.15.0

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.
@@ -4,38 +4,86 @@ module Mushy
4
4
  def self.file
5
5
 
6
6
  <<-ENDEND
7
+ <!DOCTYPE html>
7
8
  <html>
8
9
  <head>
9
- <link rel="stylesheet" href="/dark.css">
10
+ <meta name="viewport" content="width=device-width, initial-scale=1">
11
+ <link rel="stylesheet" href="/bulma.css">
10
12
  <script src="/vue.js"></script>
11
13
  <script src="/axios.js"></script>
12
14
  </head>
13
15
  <body>
14
- <div id="app">
15
- <table v-if="setup.showFlux == false">
16
- <tr>
17
- <th>Name</th>
18
- <th>Receives Events From</th>
19
- <th>Actions</th>
20
- </tr>
21
- <tr v-for="flux in flow.fluxs">
22
- <td>{{flux.name}}</td>
23
- <td>{{flux_name_for(flux.parents, flow.fluxs)}}</td>
24
- <td>
25
- <button v-on:click.prevent.stop="editFlux({ flux: flux, setup: setup, configs: configs })">Edit</button>
26
- <button v-on:click.prevent.stop="deleteFlux({ flux: flux, flow: flow })">Delete</button>
27
- </td>
28
- </tr>
29
- </table>
30
- <button v-if="setup.showFlux == false" v-on:click.prevent.stop="startNew({ setup: setup, configs: configs })">Add a New Flux To This Flow</button>
31
- <div v-if="setup.showFlux">
32
- <mip-heavy :data="setup"></mip-heavy>
33
- <mip-heavy v-for="(data, id) in configs" v-show="setup.flux.value === id" :data="data"></mip-heavy>
34
- <div v-if="results.errorMessage">{{results.errorMessage}}</div>
35
- <div v-else>{{results.length}} result{{results.length == 1 ? "" : "s"}}</div>
36
- <mip-heavy v-for="data in results" :data="data"></mip-heavy>
16
+ <div id="app">
17
+
18
+ <div class="columns">
19
+ <div class="column is-one-fifth">
20
+ <aside class="menu">
21
+ <p class="menu-label">
22
+ General
23
+ </p>
24
+ <ul class="menu-list">
25
+ <li><a v-on:click.prevent.stop="setup.showFlux = false;">Fluxs</a></li>
26
+ <li>
27
+ <ul>
28
+ <li v-for="flux in flow.fluxs"><a v-on:click.prevent.stop="editFlux({ flux: flux, setup: setup, configs: configs })">{{flux.name}}</a></li>
29
+ </ul>
30
+ </li>
31
+ </ul>
32
+ </aside>
33
+ </div>
34
+ <div class="column" v-if="setup.showFlux == false">
35
+
36
+ <div class="container">
37
+ <table class="table is-fullwidth">
38
+ <tr>
39
+ <th>Name</th>
40
+ <th>Receives Events From</th>
41
+ <th>Actions</th>
42
+ </tr>
43
+ <tr v-for="flux in flow.fluxs">
44
+ <td>{{flux.name}}</td>
45
+ <td>{{flux_name_for(flux.parents, flow.fluxs)}}</td>
46
+ <td>
47
+ <button v-on:click.prevent.stop="editFlux({ flux: flux, setup: setup, configs: configs })" class="button is-primary">Edit</button>
48
+ <button v-on:click.prevent.stop="deleteFlux({ flux: flux, flow: flow })" class="button is-danger">Delete</button>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ <button v-on:click.prevent.stop="startNew({ setup: setup, configs: configs })" class="button is-link">Add a New Flux To This Flow</button>
53
+ </div>
54
+ </div>
55
+ <div class="column" v-if="setup.showFlux">
56
+ <div class="columns">
57
+ <div class="column is-half">
58
+ <mip-heavy :data="setup"></mip-heavy>
59
+ <mip-mediumred v-for="(data, id) in configs" v-show="setup.flux.value === id" :data="data" medium="hey"></mip-mediumred>
60
+ </div>
61
+ <div class="column is-half">
62
+ <mip-mediumgreen v-for="(data, id) in configs" v-show="setup.flux.value === id" :data="data" medium="hey"></mip-mediumgreen>
63
+
64
+ <div v-bind:class="setup.testResultModal">
65
+ <div class="modal-background"></div>
66
+ <div class="modal-card">
67
+ <header class="modal-card-head">
68
+ <p class="modal-card-title">Test Results</p>
69
+ <div v-if="results.errorMessage"></div>
70
+ <div v-else>{{results.length}} result{{results.length == 1 ? "" : "s"}}</div>
71
+ <button class="delete" aria-label="close" v-on:click.prevent.stop="setup.testResultModal['is-active'] = false"></button>
72
+ </header>
73
+ <section class="modal-card-body">
74
+ <div v-if="results.errorMessage">{{results.errorMessage}}</div>
75
+ <mip-heavy v-for="data in results" :data="data"></mip-heavy>
76
+ </section>
77
+ <footer class="modal-card-foot">
78
+ <button class="button is-primary" v-on:click.prevent.stop="setup.testResultModal['is-active'] = false">Done</button>
79
+ </footer>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
37
84
  </div>
38
85
  </div>
86
+ </div>
39
87
  </body>
40
88
  </html>
41
89
 
@@ -56,7 +104,7 @@ module Mushy
56
104
  var components = {
57
105
  label: {
58
106
  props: ['label', 'description', 'hide_description'],
59
- template: '<label :for="id" v-if="label != \\'\\'">{{label || ' + fancyName('id') + '}} <i v-show="description && !hide_description">({{description}})</i></label>'
107
+ template: '<label :for="id" v-if="label != \\'\\'" class="label">{{label || ' + fancyName('id') + '}} <i v-show="description && !hide_description">({{description}})</i></label>'
60
108
  },
61
109
  h1: {
62
110
  props: ['label', 'description', 'hide_description'],
@@ -76,7 +124,7 @@ module Mushy
76
124
  },
77
125
  text: {
78
126
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'shrink'],
79
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><input type="text" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value);" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'"></div>'
127
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><input type="text" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value);" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'" class="input"></div></div>'
80
128
  },
81
129
  hide: {
82
130
  props: ['label', 'description'],
@@ -84,19 +132,19 @@ module Mushy
84
132
  },
85
133
  integer: {
86
134
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'shrink'],
87
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><input type="text" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value);" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'"></div>'
135
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><input type="text" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value);" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'" class="input"></div></div>'
88
136
  },
89
137
  email: {
90
138
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'shrink'],
91
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><input type="email" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'"></div>'
139
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><input type="email" :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'" class="input"></div></div>'
92
140
  },
93
141
  textarea: {
94
142
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'shrink'],
95
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><textarea :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'"></textarea></div>'
143
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><textarea :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'" class="textarea"></textarea></div></div>'
96
144
  },
97
145
  json: {
98
146
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'shrink'],
99
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><textarea :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'"></textarea></div>'
147
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><textarea :name="id" v-if="value || !shrink" :placeholder="placeholder" v-bind:value="value" v-on:input="$emit(\\'update:value\\', $event.target.value)" :disabled="disabled == \\'true\\'" :readonly="readonly == \\'true\\'" class="textarea"></textarea></div>'
100
148
  },
101
149
  jsonview: {
102
150
  data: function() {
@@ -107,19 +155,19 @@ module Mushy
107
155
  };
108
156
  },
109
157
  props: ['label', 'placeholder', 'disabled', 'readonly', 'value', 'description', 'view'],
110
- template: '<div><mip-h4 :id="id" :label="label" :description="description"></mip-h4> <pre><code>{{show(view, value)}}</code></pre><button :disabled="view==\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">View Pretty</button><button :disabled="view!=\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)">View Smaller</button><button v-on:click.prevent.stop="copy(view, value)">Copy</button></div>'
158
+ template: '<div><mip-h4 :id="id" :label="label" :description="description"></mip-h4> <pre><code>{{show(view, value)}}</code></pre><button :disabled="view==\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)" class="button ml-3 is-success">View Pretty</button><button :disabled="view!=\\'beautiful\\'" v-on:click.prevent.stop="view=toggle(view)" class="button ml-3 is-success">View Smaller</button><button v-on:click.prevent.stop="copy(view, value)" class="button ml-3 is-primary">Copy</button></div>'
111
159
  },
112
160
  radio: {
113
161
  props: ['label', 'value', 'options', 'description', 'shrink'],
114
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div v-for="option in options"><input type="radio" :name="id" v-bind:value="option" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)" :checked="value == option"> <label for="option">{{option}}</label></div></div>'
162
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div v-for="option in options"><input type="radio" :name="id" v-bind:value="option" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)" :checked="value == option"> <label for="option">{{option}}</label></div></div>'
115
163
  },
116
164
  select: {
117
165
  props: ['label', 'value', 'options', 'description', 'shrink'],
118
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><select :name="id" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in options" v-bind:value="option" :selected="value == option">{{option}}</option></select></div>'
166
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><select :name="id" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)" class="select"><option v-for="option in options" v-bind:value="option" :selected="value == option">{{option}}</option></select></div></div>'
119
167
  },
120
168
  selectrecord: {
121
169
  props: ['label', 'value', 'options', 'description', 'shrink'],
122
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><select :name="id" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in options" v-bind:value="option.id" :selected="value == option.id">{{option.name}}</option></select></div>'
170
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><select :name="id" v-if="value || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)" class="select"><option v-for="option in options" v-bind:value="option.id" :selected="value == option.id">{{option.name}}</option></select></div></div>'
123
171
  },
124
172
  selectmanyrecords: {
125
173
  data: function() {
@@ -145,15 +193,15 @@ module Mushy
145
193
  };
146
194
  },
147
195
  props: ['label', 'value', 'options', 'description', 'shrink'],
148
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a> <span v-for="option in options" v-if="value && value.includes(option.id)">{{option.name}} <a href="#" v-on:click.prevent.stop="remove(option.id, value);$emit(\\'update:value\\', value)">[X]</a> </span> <a href="#" v-on:click.prevent.stop="doit(selectedValue, value);$emit(\\'update:value\\', value)">ADD</a> <select :name="id" v-if="value || !shrink" v-on:input="selectedValue=$event.target.value;"><option v-for="option in options" v-bind:value="option.id">{{option.name}}</option></select></div>'
196
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a> <span v-for="option in options" v-if="value && value.includes(option.id)">{{option.name}} <a href="#" v-on:click.prevent.stop="remove(option.id, value);$emit(\\'update:value\\', value)">[X]</a> </span> <a href="#" v-on:click.prevent.stop="doit(selectedValue, value);$emit(\\'update:value\\', value)">ADD</a> <div class="control"><select :name="id" v-if="value || !shrink" v-on:input="selectedValue=$event.target.value;" class="select"><option v-for="option in options" v-bind:value="option.id">{{option.name}}</option></select></div></div>'
149
197
  },
150
198
  boolean: {
151
199
  props: ['label', 'value', 'options', 'description', 'shrink'],
152
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><select :name="id" v-if="(value != undefined && value != null && value != \\'\\') || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)"><option v-for="option in [true, false]" v-bind:value="option" :selected="value == option">{{option}}</option></select></div>'
200
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && !value">[^]</a><div class="control"><select :name="id" v-if="(value != undefined && value != null && value != \\'\\') || !shrink" v-on:input="$emit(\\'update:value\\', $event.target.value)" class="select"><option v-for="option in [true, false]" v-bind:value="option" :selected="value == option">{{option}}</option></select></div></div>'
153
201
  },
154
202
  table: {
155
203
  props: ['value', 'description'],
156
- template: '<table><tr><th v-for="(d, i) in value[0]">{{' + fancyName('i') + '}}</th></tr><tr v-for="v in value"><td v-for="(d, i) in v">{{d}}</td></tr></table>'
204
+ template: '<table class="table"><tr><th v-for="(d, i) in value[0]">{{' + fancyName('i') + '}}</th></tr><tr v-for="v in value"><td v-for="(d, i) in v">{{d}}</td></tr></table>'
157
205
  },
158
206
  editgrid: {
159
207
  data: function() {
@@ -171,7 +219,7 @@ module Mushy
171
219
  };
172
220
  },
173
221
  props: ['value', 'editors', 'label', 'description', 'shrink'],
174
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && value.length == 0">[^]</a><table v-if="value.length > 0 || !shrink"><tr><th v-for="(d, i) in value[0]">{{' + fancyName('i') + '}}</th></tr><tr v-for="(v, z) in value"><td v-for="(d, i) in v">{{d}}</td><td><a href="#" v-on:click.prevent.stop="removeRecord(v, value, z)">[x]</a></td></tr><tr><td v-for="editor in editors"><mip-thing :data="editor.field" :id="editor.id"></mip-thing></td><td><a href="#" v-on:click.prevent.stop="addRecord(editors, value)">[Add]</a></td></tr></table></div>'
222
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink && value.length == 0">[^]</a><table v-if="value.length > 0 || !shrink" class="table"><tr><th v-for="(d, i) in value[0]">{{' + fancyName('i') + '}}</th></tr><tr v-for="(v, z) in value"><td v-for="(d, i) in v">{{d}}</td><td><a href="#" v-on:click.prevent.stop="removeRecord(v, value, z)">[x]</a></td></tr><tr><td v-for="editor in editors"><mip-thing :data="editor.field" :id="editor.id"></mip-thing></td><td><a href="#" v-on:click.prevent.stop="addRecord(editors, value)">[Add]</a></td></tr></table></div>'
175
223
  },
176
224
  keyvalue: {
177
225
  data: function() {
@@ -186,11 +234,21 @@ module Mushy
186
234
  };
187
235
  },
188
236
  props: ['value', 'label', 'editors', 'description', 'shrink'],
189
- template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink">[^]</a><table v-if="JSON.stringify(value) != \\'{}\\' || !shrink"><tr v-for="(v, k) in value"><td>{{k}}</td><td>{{v}}</td><td><button v-on:click.prevent.stop="removeRecord(value, k)">Remove {{k}}</button></td></tr><tr><td v-for="editor in editors"><mip-thing :data="editor.field" :id="editor.id"></mip-thing></td><td><button v-on:click.prevent.stop="addRecord(editors, value)" v-show="editors[0].field.value">{{actionText(editors[0].field.value, value)}} {{editors[0].field.value}}</button></td></tr></table></div>'
237
+ template: '<div><mip-label :id="id" :label="label" :description="description" :hide_description="shrink && !value"></mip-label> <a href="#" v-on:click.prevent.stop="shrink=false" v-show="shrink">[^]</a><table v-if="JSON.stringify(value) != \\'{}\\' || !shrink" class="table"><tr v-for="(v, k) in value"><td>{{k}}</td><td>{{v}}</td><td><button v-on:click.prevent.stop="removeRecord(value, k)" class="button">Remove {{k}}</button></td></tr><tr><td v-for="editor in editors"><mip-thing :data="editor.field" :id="editor.id"></mip-thing></td><td><button v-on:click.prevent.stop="addRecord(editors, value)" v-show="editors[0].field.value" class="button">{{actionText(editors[0].field.value, value)}} {{editors[0].field.value}}</button></td></tr></table></div>'
190
238
  },
191
239
  button: {
192
- props: ['click', 'description', 'name'],
193
- template: '<button v-on:click.prevent.stop="click(pull(this), thisComponent())">{{name || id}}</button>'
240
+ data: function() {
241
+ return {
242
+ buttonStyles: function(x) {
243
+ var colors = {};
244
+ if (x.color && x.color != '')
245
+ colors[x.color] = true;
246
+ return colors;
247
+ }
248
+ };
249
+ },
250
+ props: ['click', 'description', 'name', 'color'],
251
+ template: '<button v-on:click.prevent.stop="click(pull(this), thisComponent())" class="button" v-bind:class="buttonStyles(this)">{{name || id}}</button>'
194
252
  }
195
253
  };
196
254
 
@@ -198,8 +256,9 @@ module Mushy
198
256
  {
199
257
  var props = JSON.parse(JSON.stringify(components[property].props));
200
258
  props.push('id');
259
+ const theData = components[property].data ?? function() { return {}; };
201
260
  Vue.component('mip-' + property, {
202
- data: components[property].data ?? function () {
261
+ data: function () {
203
262
  var foundIt = this.$parent;
204
263
  var counter = 0;
205
264
  while (foundIt.$parent.constructor.name == "VueComponent" && counter < 10)
@@ -207,18 +266,22 @@ module Mushy
207
266
  foundIt = foundIt.$parent;
208
267
  counter += 1;
209
268
  }
210
- return {
269
+ var dataToReturn = {
211
270
  console: console,
212
271
  pull: function(x) { return thingToData(foundIt.data); },
213
272
  thisComponent: function() { return foundIt.data; },
214
- }
273
+ };
274
+ var data = theData();
275
+ for(var p in data)
276
+ dataToReturn[p] = data[p];
277
+ return dataToReturn;
215
278
  },
216
279
  props: props,
217
280
  template: components[property].template
218
281
  });
219
282
  }
220
283
 
221
- var thingTemplate = '<div>';
284
+ var thingTemplate = '<div v-bind:class="{ \\\'ml-3\\\': data.foghat==\\\'free\\\', \\\'column\\\': data.foghat!=\\\'free\\\', \\\'is-full\\\': data.foghat!=\\\'half\\\' && data.foghat!=\\\'free\\\', \\\'is-half\\\': data.foghat==\\\'half\\\' }">';
222
285
  for (var property in components)
223
286
  thingTemplate = thingTemplate + '<mip-' + property + ' v-if="data.type == \\'' + property + '\\'" :id="id" ' + components[property].props.map(function(x){ return ':' + x + '.sync="data.' + x + '"';}).join(' ') + '></mip-' + property + '>'
224
287
  thingTemplate = thingTemplate + '</div>';
@@ -229,7 +292,7 @@ module Mushy
229
292
  console: console,
230
293
  }
231
294
  },
232
- props: ['data', 'value', 'id', 'model'],
295
+ props: ['data', 'value', 'id', 'model', 'foghat'],
233
296
  template: thingTemplate
234
297
  });
235
298
 
@@ -240,7 +303,27 @@ module Mushy
240
303
  }
241
304
  },
242
305
  props: ['data'],
243
- template: '<div><mip-thing v-for="(d, id) in data" :data="d" :id="id"></mip-thing></div>',
306
+ template: '<div class="columns is-multiline"><mip-thing v-for="(d, id) in data" :data="d" :id="id"></mip-thing></div>',
307
+ });
308
+
309
+ Vue.component('mip-mediumgreen', {
310
+ data: function () {
311
+ return {
312
+ console: console,
313
+ }
314
+ },
315
+ props: ['data', 'medium'],
316
+ template: '<div class="columns is-multiline"><mip-thing v-for="(d, id) in data" :data="d" :id="id" v-if="d.medium == medium"></mip-thing></div>',
317
+ });
318
+
319
+ Vue.component('mip-mediumred', {
320
+ data: function () {
321
+ return {
322
+ console: console,
323
+ }
324
+ },
325
+ props: ['data', 'medium'],
326
+ template: '<div class="columns is-multiline"><mip-thing v-for="(d, id) in data" :data="d" :id="id" v-if="d.medium != medium"></mip-thing></div>',
244
327
  });
245
328
 
246
329
  var app = null;
@@ -304,6 +387,10 @@ module Mushy
304
387
 
305
388
  var setup = {
306
389
  showFlux: false,
390
+ testResultModal: {
391
+ "modal": true,
392
+ "is-active": false,
393
+ },
307
394
  id: { type: 'hide', value: '' },
308
395
  name: { type: 'text', value: '' },
309
396
  flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options},
@@ -312,20 +399,9 @@ module Mushy
312
399
 
313
400
  for (var key in configs)
314
401
  {
315
- configs[key].save = { type: 'button', name: 'Save Changes', click: function(config) {
316
- saveTheFlux({ app: app, config: config });
317
- saveTheFlow({ setup: app.setup, flow: app.flow });
318
- app.setup.showFlux = false;
319
- }
320
- };
321
- configs[key].cancel = { type: 'button', name: 'Ignore Changes', click: function() {
322
- app.setup.showFlux = false;
323
- }
324
- };
325
-
326
- configs[key].test_event = { type: 'json', value: '{}', default: '{}' };
402
+ configs[key].test_event = { type: 'json', value: '{}', default: '{}', medium: 'hey' };
327
403
 
328
- configs[key].run_test = { type: 'button', name: 'Test Run This Flux', click: function(c, hey) {
404
+ configs[key].run_test = { type: 'button', name: 'Test Run This Flux', medium: 'hey', color: 'is-link', click: function(c, hey) {
329
405
  var previousName = hey.run_test.name;
330
406
  Vue.set(hey.run_test, 'name', 'Loading');
331
407
  app.results = [];
@@ -334,6 +410,7 @@ module Mushy
334
410
  the_setup.event = c.test_event;
335
411
  axios.post('/run', { config: c, setup: the_setup })
336
412
  .then(function(r){
413
+ Vue.set(app.setup.testResultModal, 'is-active', true);
337
414
  var index = 1;
338
415
  for (var key in r.data.result)
339
416
  {
@@ -349,6 +426,18 @@ module Mushy
349
426
  Vue.set(hey.run_test, 'name', previousName);
350
427
  });
351
428
  } };
429
+
430
+ configs[key].save = { type: 'button', name: 'Save Changes', foghat: 'free', medium: 'hey', color: 'is-primary', click: function(config) {
431
+ saveTheFlux({ app: app, config: config });
432
+ saveTheFlow({ setup: app.setup, flow: app.flow });
433
+ app.setup.showFlux = false;
434
+ }
435
+ };
436
+ configs[key].cancel = { type: 'button', name: 'Ignore Changes', foghat: 'free', medium: 'hey', color: 'is-warning', click: function() {
437
+ app.setup.showFlux = false;
438
+ }
439
+ };
440
+
352
441
  }
353
442
 
354
443
  var loadThisFlux = function(args)
@@ -9,6 +9,10 @@ module Mushy
9
9
  end
10
10
  end
11
11
 
12
+ def self.details
13
+ nil
14
+ end
15
+
12
16
  def process event, config
13
17
 
14
18
  lines = python_program(event, config)
data/lib/site.rb CHANGED
@@ -8,6 +8,11 @@ get '/' do
8
8
  Mushy::Builder::Index.file
9
9
  end
10
10
 
11
+ get '/bulma.css' do
12
+ content_type :css
13
+ Mushy::Builder::Bulma.file
14
+ end
15
+
11
16
  get '/dark.css' do
12
17
  content_type :css
13
18
  Mushy::Builder::Dark.file
data/mushy.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'mushy/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = 'mushy'
7
- s.version = '0.13.0'
7
+ s.version = '0.15.0'
8
8
  s.date = '2020-11-23'
9
9
  s.summary = 'Process streams of work using common modules.'
10
10
  s.description = 'This tool assists in the creation and processing of workflows.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mushy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
@@ -175,6 +175,7 @@ files:
175
175
  - lib/mushy.rb
176
176
  - lib/mushy/builder/api.rb
177
177
  - lib/mushy/builder/axios.rb
178
+ - lib/mushy/builder/bulma.rb
178
179
  - lib/mushy/builder/dark.rb
179
180
  - lib/mushy/builder/index.rb
180
181
  - lib/mushy/builder/vue.rb