mushy 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,38 +4,85 @@ 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-medium>
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-medium>
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">Modal title</p>
69
+ <button class="delete" aria-label="close" v-on:click.prevent.stop="setup.testResultModal['is-active'] = false"></button>
70
+ </header>
71
+ <section class="modal-card-body">
72
+ <div v-if="results.errorMessage">{{results.errorMessage}}</div>
73
+ <div v-else>{{results.length}} result{{results.length == 1 ? "" : "s"}}</div>
74
+ <mip-heavy v-for="data in results" :data="data"></mip-heavy>
75
+ </section>
76
+ <footer class="modal-card-foot">
77
+ <button class="button is-success">GO</button>
78
+ </footer>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ </div>
37
83
  </div>
38
84
  </div>
85
+ </div>
39
86
  </body>
40
87
  </html>
41
88
 
@@ -56,7 +103,7 @@ module Mushy
56
103
  var components = {
57
104
  label: {
58
105
  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>'
106
+ template: '<label :for="id" v-if="label != \\'\\'" class="label">{{label || ' + fancyName('id') + '}} <i v-show="description && !hide_description">({{description}})</i></label>'
60
107
  },
61
108
  h1: {
62
109
  props: ['label', 'description', 'hide_description'],
@@ -76,7 +123,7 @@ module Mushy
76
123
  },
77
124
  text: {
78
125
  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>'
126
+ 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
127
  },
81
128
  hide: {
82
129
  props: ['label', 'description'],
@@ -84,19 +131,19 @@ module Mushy
84
131
  },
85
132
  integer: {
86
133
  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>'
134
+ 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
135
  },
89
136
  email: {
90
137
  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>'
138
+ 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
139
  },
93
140
  textarea: {
94
141
  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>'
142
+ 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
143
  },
97
144
  json: {
98
145
  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>'
146
+ 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
147
  },
101
148
  jsonview: {
102
149
  data: function() {
@@ -107,19 +154,19 @@ module Mushy
107
154
  };
108
155
  },
109
156
  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>'
157
+ 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
158
  },
112
159
  radio: {
113
160
  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>'
161
+ 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
162
  },
116
163
  select: {
117
164
  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>'
165
+ 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
166
  },
120
167
  selectrecord: {
121
168
  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>'
169
+ 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
170
  },
124
171
  selectmanyrecords: {
125
172
  data: function() {
@@ -145,15 +192,15 @@ module Mushy
145
192
  };
146
193
  },
147
194
  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>'
195
+ 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
196
  },
150
197
  boolean: {
151
198
  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>'
199
+ 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
200
  },
154
201
  table: {
155
202
  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>'
203
+ 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
204
  },
158
205
  editgrid: {
159
206
  data: function() {
@@ -171,7 +218,7 @@ module Mushy
171
218
  };
172
219
  },
173
220
  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>'
221
+ 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
222
  },
176
223
  keyvalue: {
177
224
  data: function() {
@@ -186,11 +233,21 @@ module Mushy
186
233
  };
187
234
  },
188
235
  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>'
236
+ 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
237
  },
191
238
  button: {
192
- props: ['click', 'description', 'name'],
193
- template: '<button v-on:click.prevent.stop="click(pull(this), thisComponent())">{{name || id}}</button>'
239
+ data: function() {
240
+ return {
241
+ buttonStyles: function(x) {
242
+ var colors = {};
243
+ if (x.color && x.color != '')
244
+ colors[x.color] = true;
245
+ return colors;
246
+ }
247
+ };
248
+ },
249
+ props: ['click', 'description', 'name', 'color'],
250
+ template: '<button v-on:click.prevent.stop="click(pull(this), thisComponent())" class="button" v-bind:class="buttonStyles(this)">{{name || id}}</button>'
194
251
  }
195
252
  };
196
253
 
@@ -198,8 +255,9 @@ module Mushy
198
255
  {
199
256
  var props = JSON.parse(JSON.stringify(components[property].props));
200
257
  props.push('id');
258
+ const theData = components[property].data ?? function() { return {}; };
201
259
  Vue.component('mip-' + property, {
202
- data: components[property].data ?? function () {
260
+ data: function () {
203
261
  var foundIt = this.$parent;
204
262
  var counter = 0;
205
263
  while (foundIt.$parent.constructor.name == "VueComponent" && counter < 10)
@@ -207,18 +265,22 @@ module Mushy
207
265
  foundIt = foundIt.$parent;
208
266
  counter += 1;
209
267
  }
210
- return {
268
+ var dataToReturn = {
211
269
  console: console,
212
270
  pull: function(x) { return thingToData(foundIt.data); },
213
271
  thisComponent: function() { return foundIt.data; },
214
- }
272
+ };
273
+ var data = theData();
274
+ for(var p in data)
275
+ dataToReturn[p] = data[p];
276
+ return dataToReturn;
215
277
  },
216
278
  props: props,
217
279
  template: components[property].template
218
280
  });
219
281
  }
220
282
 
221
- var thingTemplate = '<div>';
283
+ 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
284
  for (var property in components)
223
285
  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
286
  thingTemplate = thingTemplate + '</div>';
@@ -229,7 +291,7 @@ module Mushy
229
291
  console: console,
230
292
  }
231
293
  },
232
- props: ['data', 'value', 'id', 'model'],
294
+ props: ['data', 'value', 'id', 'model', 'foghat'],
233
295
  template: thingTemplate
234
296
  });
235
297
 
@@ -240,7 +302,27 @@ module Mushy
240
302
  }
241
303
  },
242
304
  props: ['data'],
243
- template: '<div><mip-thing v-for="(d, id) in data" :data="d" :id="id"></mip-thing></div>',
305
+ template: '<div class="columns is-multiline"><mip-thing v-for="(d, id) in data" :data="d" :id="id"></mip-thing></div>',
306
+ });
307
+
308
+ Vue.component('mip-mediumgreen', {
309
+ data: function () {
310
+ return {
311
+ console: console,
312
+ }
313
+ },
314
+ props: ['data', 'medium'],
315
+ 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>',
316
+ });
317
+
318
+ Vue.component('mip-mediumred', {
319
+ data: function () {
320
+ return {
321
+ console: console,
322
+ }
323
+ },
324
+ props: ['data', 'medium'],
325
+ 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
326
  });
245
327
 
246
328
  var app = null;
@@ -304,6 +386,10 @@ module Mushy
304
386
 
305
387
  var setup = {
306
388
  showFlux: false,
389
+ testResultModal: {
390
+ "modal": true,
391
+ "is-active": false,
392
+ },
307
393
  id: { type: 'hide', value: '' },
308
394
  name: { type: 'text', value: '' },
309
395
  flux: { type: 'select', value: fluxdata.fluxs[0].name, options: options},
@@ -312,18 +398,18 @@ module Mushy
312
398
 
313
399
  for (var key in configs)
314
400
  {
315
- configs[key].save = { type: 'button', name: 'Save Changes', click: function(config) {
401
+ configs[key].save = { type: 'button', name: 'Save Changes', foghat: 'free', color: 'is-primary', click: function(config) {
316
402
  saveTheFlux({ app: app, config: config });
317
403
  saveTheFlow({ setup: app.setup, flow: app.flow });
318
404
  app.setup.showFlux = false;
319
405
  }
320
406
  };
321
- configs[key].cancel = { type: 'button', name: 'Ignore Changes', click: function() {
407
+ configs[key].cancel = { type: 'button', name: 'Ignore Changes', foghat: 'free', color: 'is-warning', click: function() {
322
408
  app.setup.showFlux = false;
323
409
  }
324
410
  };
325
411
 
326
- configs[key].test_event = { type: 'json', value: '{}', default: '{}' };
412
+ configs[key].test_event = { type: 'json', value: '{}', default: '{}', medium: 'hey' };
327
413
 
328
414
  configs[key].run_test = { type: 'button', name: 'Test Run This Flux', click: function(c, hey) {
329
415
  var previousName = hey.run_test.name;
@@ -334,6 +420,7 @@ module Mushy
334
420
  the_setup.event = c.test_event;
335
421
  axios.post('/run', { config: c, setup: the_setup })
336
422
  .then(function(r){
423
+ app.setup.testResultModal["is-active"] = true;
337
424
  var index = 1;
338
425
  for (var key in r.data.result)
339
426
  {
@@ -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.14.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.14.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