@rancher/shell 0.1.3 → 0.1.21

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.
Files changed (245) hide show
  1. package/assets/brand/suse/dark/rancher-logo.svg +1 -148
  2. package/assets/brand/suse/favicon.png +0 -0
  3. package/assets/brand/suse/rancher-logo.svg +1 -130
  4. package/assets/images/featured/img1.jpg +0 -0
  5. package/assets/images/featured.jpg +0 -0
  6. package/assets/images/generic-plugin.svg +1 -0
  7. package/assets/styles/themes/_dark.scss +3 -0
  8. package/assets/styles/themes/_light.scss +3 -0
  9. package/assets/styles/themes/_suse.scss +1 -1
  10. package/assets/translations/en-us.yaml +219 -47
  11. package/assets/translations/zh-hans.yaml +21 -24
  12. package/components/AsyncButton.vue +17 -2
  13. package/components/ButtonDropdown.vue +4 -0
  14. package/components/Carousel.vue +291 -0
  15. package/components/CommunityLinks.vue +64 -22
  16. package/components/CruResource.vue +11 -3
  17. package/components/Dialog.vue +102 -0
  18. package/components/ExplorerMembers.vue +2 -4
  19. package/components/ExplorerProjectsNamespaces.vue +25 -9
  20. package/components/IconMessage.vue +9 -1
  21. package/components/LazyImage.vue +21 -8
  22. package/components/LocaleSelector.vue +62 -29
  23. package/components/PromptRemove.vue +2 -2
  24. package/components/ResourceList/Masthead.vue +21 -1
  25. package/components/ResourceList/ResourceLoadingIndicator.vue +0 -8
  26. package/components/ResourceList/index.vue +9 -23
  27. package/components/ResourceTable.vue +7 -2
  28. package/components/SimpleBox.vue +6 -4
  29. package/components/SortableTable/index.vue +18 -25
  30. package/components/Tabbed/Tab.vue +5 -0
  31. package/components/Tabbed/index.vue +54 -9
  32. package/components/TypeDescription.vue +10 -1
  33. package/components/auth/Principal.vue +1 -0
  34. package/components/fleet/FleetBundles.vue +8 -3
  35. package/components/fleet/FleetClusters.vue +6 -0
  36. package/components/fleet/FleetRepos.vue +7 -1
  37. package/components/fleet/FleetSummary.vue +6 -0
  38. package/components/form/Command.vue +5 -0
  39. package/components/form/EnvVars.vue +5 -0
  40. package/components/form/KeyValue.vue +80 -58
  41. package/components/form/NameNsDescription.vue +13 -5
  42. package/components/form/NodeScheduling.vue +6 -1
  43. package/components/form/PodAffinity.vue +5 -0
  44. package/components/form/ResourceTabs/index.vue +5 -1
  45. package/components/form/ServiceNameSelect.vue +5 -0
  46. package/components/form/ValueFromResource.vue +7 -1
  47. package/components/formatter/ClusterLink.vue +3 -7
  48. package/components/nav/NamespaceFilter.vue +3 -3
  49. package/components/nav/TopLevelMenu.vue +12 -29
  50. package/config/home-links.js +155 -0
  51. package/config/labels-annotations.js +2 -1
  52. package/config/private-label.js +1 -1
  53. package/config/product/explorer.js +5 -4
  54. package/config/product/legacy.js +0 -47
  55. package/config/product/manager.js +0 -2
  56. package/config/product/multi-cluster-apps.js +0 -12
  57. package/config/product/settings.js +12 -1
  58. package/config/product/uiplugins.js +17 -0
  59. package/config/settings.js +23 -2
  60. package/config/types.js +5 -1
  61. package/config/uiplugins.js +117 -0
  62. package/config/version.js +17 -0
  63. package/content/docs/en-us/getting-started.md +1 -26
  64. package/core/plugin.ts +12 -0
  65. package/core/plugins.js +38 -2
  66. package/core/types.ts +6 -0
  67. package/creators/app/{.eslintignore → files/.eslintignore} +0 -0
  68. package/creators/app/{.eslintrc.js → files/.eslintrc.js} +0 -0
  69. package/creators/app/{.vscode → files/.vscode}/settings.json +0 -0
  70. package/creators/app/{babel.config.js → files/babel.config.js} +0 -0
  71. package/creators/app/{nuxt.config.js → files/nuxt.config.js} +0 -0
  72. package/creators/app/{tsconfig.json → files/tsconfig.json} +2 -1
  73. package/creators/app/init +16 -17
  74. package/creators/app/package.json +6 -0
  75. package/creators/pkg/{babel.config.js → files/babel.config.js} +0 -0
  76. package/creators/pkg/{index.ts → files/index.ts} +0 -0
  77. package/creators/pkg/{tsconfig.json → files/tsconfig.json} +13 -12
  78. package/creators/pkg/{vue.config.js → files/vue.config.js} +0 -0
  79. package/creators/pkg/init +1 -1
  80. package/creators/update/init +54 -0
  81. package/creators/update/package.json +20 -0
  82. package/creators/update/upgrade +56 -0
  83. package/creators/update/yarn-error.log +54 -0
  84. package/detail/provisioning.cattle.io.cluster.vue +3 -3
  85. package/detail/workload/index.vue +3 -2
  86. package/dialog/DiagnosticTimingsDialog.vue +116 -0
  87. package/dialog/RotateCertificatesDialog.vue +9 -3
  88. package/edit/auth/azuread.vue +28 -9
  89. package/edit/networking.k8s.io.ingress/index.vue +2 -2
  90. package/edit/persistentvolume/index.vue +51 -13
  91. package/edit/persistentvolumeclaim.vue +31 -13
  92. package/edit/pod.vue +27 -0
  93. package/edit/provisioning.cattle.io.cluster/rke2.vue +103 -24
  94. package/edit/service.vue +7 -5
  95. package/edit/workload/__tests__/Upgrading.test.ts +1 -0
  96. package/edit/workload/index.vue +32 -10
  97. package/edit/workload/mixins/workload.js +121 -126
  98. package/edit/workload/storage/ContainerMountPaths.vue +240 -0
  99. package/edit/workload/storage/Mount.vue +1 -0
  100. package/edit/workload/storage/awsElasticBlockStore.vue +20 -1
  101. package/edit/workload/storage/azureDisk.vue +22 -2
  102. package/edit/workload/storage/azureFile.vue +20 -2
  103. package/edit/workload/storage/csi/index.vue +23 -1
  104. package/edit/workload/storage/gcePersistentDisk.vue +20 -2
  105. package/edit/workload/storage/index.vue +33 -65
  106. package/edit/workload/storage/persistentVolumeClaim/index.vue +5 -0
  107. package/edit/workload/storage/secret.vue +6 -1
  108. package/edit/workload/storage/vsphereVolume.vue +11 -1
  109. package/layouts/default.vue +14 -8
  110. package/layouts/home.vue +9 -4
  111. package/layouts/plain.vue +10 -5
  112. package/list/catalog.cattle.io.app.vue +10 -9
  113. package/list/catalog.cattle.io.clusterrepo.vue +6 -61
  114. package/list/cis.cattle.io.clusterscan.vue +12 -12
  115. package/list/fleet.cattle.io.bundle.vue +33 -28
  116. package/list/fleet.cattle.io.cluster.vue +26 -22
  117. package/list/fleet.cattle.io.clustergroup.vue +6 -0
  118. package/list/fleet.cattle.io.clusterregistrationtoken.vue +28 -24
  119. package/list/fleet.cattle.io.gitrepo.vue +25 -14
  120. package/list/helm.cattle.io.projecthelmchart.vue +52 -33
  121. package/list/logging.banzaicloud.io.clusterflow.vue +7 -12
  122. package/list/logging.banzaicloud.io.flow.vue +7 -14
  123. package/list/management.cattle.io.cluster.vue +26 -15
  124. package/list/management.cattle.io.feature.vue +13 -8
  125. package/list/management.cattle.io.setting.vue +3 -3
  126. package/list/management.cattle.io.user.vue +38 -19
  127. package/list/monitoring.coreos.com.alertmanagerconfig.vue +8 -15
  128. package/list/namespace.vue +14 -1
  129. package/list/node.vue +13 -16
  130. package/list/persistentvolume.vue +16 -9
  131. package/list/persistentvolumeclaim.vue +5 -8
  132. package/list/provisioning.cattle.io.cluster.vue +35 -9
  133. package/list/service.vue +24 -12
  134. package/list/ui.cattle.io.navlink.vue +6 -0
  135. package/list/workload.vue +2 -2
  136. package/machine-config/harvester.vue +5 -3
  137. package/middleware/authenticated.js +6 -0
  138. package/mixins/resource-fetch.js +12 -18
  139. package/mixins/resource-manager.js +126 -0
  140. package/models/catalog.cattle.io.uiplugin.js +38 -0
  141. package/models/cluster/node.js +25 -2
  142. package/models/fleet.cattle.io.bundle.js +1 -1
  143. package/models/harvesterhci.io.management.cluster.js +11 -5
  144. package/models/pod.js +15 -5
  145. package/models/provisioning.cattle.io.cluster.js +16 -6
  146. package/models/workload.js +5 -3
  147. package/models/workload.service.js +10 -0
  148. package/nuxt.config.js +70 -25
  149. package/package.json +108 -109
  150. package/pages/auth/login.vue +11 -1
  151. package/pages/auth/verify.vue +9 -0
  152. package/pages/c/_cluster/apps/charts/index.vue +46 -1
  153. package/pages/c/_cluster/apps/charts/install.vue +10 -9
  154. package/pages/c/_cluster/explorer/index.vue +72 -9
  155. package/pages/c/_cluster/explorer/tools/index.vue +12 -5
  156. package/pages/c/_cluster/mcapps/index.vue +1 -1
  157. package/pages/c/_cluster/settings/DefaultLinksEditor.vue +108 -0
  158. package/pages/c/_cluster/settings/brand.vue +0 -40
  159. package/pages/c/_cluster/settings/links.vue +152 -0
  160. package/pages/c/_cluster/settings/performance.vue +90 -7
  161. package/pages/c/_cluster/uiplugins/DeveloperInstallDialog.vue +232 -0
  162. package/pages/c/_cluster/uiplugins/InstallDialog.vue +293 -0
  163. package/pages/c/_cluster/uiplugins/PluginInfoPanel.vue +300 -0
  164. package/pages/c/_cluster/uiplugins/RemoveUIPlugins.vue +125 -0
  165. package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +261 -0
  166. package/pages/c/_cluster/uiplugins/UninstallDialog.vue +122 -0
  167. package/pages/c/_cluster/uiplugins/index.vue +808 -0
  168. package/pages/diagnostic.vue +185 -101
  169. package/pages/docs/_doc.vue +3 -1
  170. package/pages/home.vue +21 -56
  171. package/pages/prefs.vue +108 -88
  172. package/pages/safeMode.vue +17 -0
  173. package/pages/support/index.vue +34 -137
  174. package/pkg/dynamic-importer.lib.js +4 -0
  175. package/plugins/dashboard-store/actions.js +19 -0
  176. package/plugins/dashboard-store/getters.js +20 -3
  177. package/plugins/dashboard-store/mutations.js +13 -7
  178. package/plugins/dashboard-store/resource-class.js +2 -2
  179. package/plugins/formatters.js +15 -0
  180. package/plugins/plugin.js +61 -6
  181. package/plugins/steve/getters.js +12 -0
  182. package/plugins/steve/mutations.js +1 -1
  183. package/plugins/steve/subscribe.js +94 -72
  184. package/plugins/steve/web-worker.steve-sub-worker.js +24 -15
  185. package/plugins/version.js +21 -0
  186. package/promptRemove/management.cattle.io.globalrole.vue +47 -0
  187. package/promptRemove/management.cattle.io.roletemplate.vue +47 -0
  188. package/promptRemove/mixin/roleDeletionCheck.js +97 -0
  189. package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +6 -7
  190. package/rancher-components/components/BadgeState/BadgeState.spec.ts +12 -0
  191. package/rancher-components/components/BadgeState/BadgeState.vue +107 -0
  192. package/rancher-components/components/BadgeState/index.ts +1 -0
  193. package/rancher-components/components/Banner/Banner.test.ts +13 -0
  194. package/rancher-components/components/Banner/Banner.vue +163 -0
  195. package/rancher-components/components/Banner/index.ts +1 -0
  196. package/rancher-components/components/Card/Card.vue +150 -0
  197. package/rancher-components/components/Card/index.ts +1 -0
  198. package/rancher-components/components/Form/Checkbox/Checkbox.test.ts +77 -0
  199. package/rancher-components/components/Form/Checkbox/Checkbox.vue +395 -0
  200. package/rancher-components/components/Form/Checkbox/index.ts +1 -0
  201. package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +29 -0
  202. package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +343 -0
  203. package/rancher-components/components/Form/LabeledInput/index.ts +1 -0
  204. package/rancher-components/components/Form/Radio/RadioButton.vue +270 -0
  205. package/rancher-components/components/Form/Radio/RadioGroup.vue +235 -0
  206. package/rancher-components/components/Form/Radio/index.ts +2 -0
  207. package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +168 -0
  208. package/rancher-components/components/Form/TextArea/index.ts +1 -0
  209. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.test.ts +107 -0
  210. package/rancher-components/components/Form/ToggleSwitch/ToggleSwitch.vue +137 -0
  211. package/rancher-components/components/Form/ToggleSwitch/index.ts +1 -0
  212. package/rancher-components/components/Form/index.ts +5 -0
  213. package/rancher-components/components/LabeledTooltip/LabeledTooltip.vue +137 -0
  214. package/rancher-components/components/LabeledTooltip/index.ts +1 -0
  215. package/scripts/publish-shell.sh +40 -7
  216. package/scripts/record-deps.js +37 -0
  217. package/scripts/sync-shell-deps +37 -0
  218. package/scripts/test-plugins-build.sh +8 -5
  219. package/scripts/typegen.sh +84 -0
  220. package/store/auth.js +3 -0
  221. package/store/catalog.js +9 -8
  222. package/store/i18n.js +10 -1
  223. package/store/index.js +12 -3
  224. package/store/prefs.js +16 -0
  225. package/store/type-map.js +32 -5
  226. package/store/uiplugins.ts +15 -61
  227. package/types/shell/index.d.ts +3046 -0
  228. package/utils/__tests__/object.test.ts +0 -24
  229. package/utils/__tests__/selector.test.ts +1 -1
  230. package/utils/dynamic-importer.js +4 -0
  231. package/utils/favicon.js +8 -2
  232. package/utils/gc/gc-interval.ts +40 -0
  233. package/utils/gc/gc-root-store.js +76 -0
  234. package/utils/gc/gc-route-changed.ts +44 -0
  235. package/utils/gc/gc-types.ts +21 -0
  236. package/utils/gc/gc.ts +282 -0
  237. package/utils/grafana.js +2 -6
  238. package/utils/socket.js +41 -20
  239. package/utils/string.js +1 -7
  240. package/utils/validators/formRules/__tests__/index.test.ts +108 -0
  241. package/utils/validators/formRules/index.ts +9 -1
  242. package/config/footer.js +0 -19
  243. package/creators/pkg/nuxt.config.js +0 -6
  244. package/pages/plugins.vue +0 -387
  245. package/server/verdaccio-middleware.js +0 -56
package/pages/plugins.vue DELETED
@@ -1,387 +0,0 @@
1
- <script>
2
- import { mapGetters } from 'vuex';
3
- import { LabeledInput } from '@components/Form/LabeledInput';
4
-
5
- export default {
6
- components: { LabeledInput },
7
- data() {
8
- return {
9
- name: '',
10
- location: '',
11
- catalogUrl: '',
12
- view: 'installed',
13
- dialogOpen: false,
14
- catalogDialogOpen: false,
15
- canModifyName: true,
16
- canModifyLocation: true,
17
- };
18
- },
19
- layout: 'plain',
20
- async fetch() {
21
- await this.$store.dispatch('uiplugins/loadCatalogs');
22
- },
23
- computed: {
24
- ...mapGetters({ plugins: 'uiplugins/plugins' }),
25
- ...mapGetters({ catalog: 'uiplugins/catalog' }),
26
- list() {
27
- // Get installed plugins and mark up the list
28
- const pMap = {};
29
- const list = [];
30
- // Map of plugins in the catalog
31
- const cMap = {};
32
-
33
- this.plugins.forEach((p) => {
34
- pMap[p.name] = p;
35
- });
36
-
37
- this.catalog.forEach((catalogItem) => {
38
- const item = { ...catalogItem };
39
-
40
- list.push(item);
41
- cMap[item.name] = true;
42
-
43
- item.installed = pMap[item.name]?.metadata;
44
- item.builtin = !!pMap[item.name]?.builtin;
45
- item.displayVersion = item.installed ? item.installed.version : item.version;
46
- item.icon = item.installed?.icon;
47
- item.download = `/download-pkg/${ item.name }-${ item.version }`;
48
-
49
- if (item.installed) {
50
- if (item.installed.version !== item.version) {
51
- // TODO: Only if newer
52
- item.upgrade = item.version;
53
- }
54
- }
55
- });
56
-
57
- this.plugins.forEach((p) => {
58
- if (!cMap[p.name]) {
59
- // Plugin is installed but not in the catalog, so add item for it
60
- list.push({
61
- ...p.metadata,
62
- installed: true,
63
- builtin: p.builtin,
64
- displayVersion: p.metadata?.version,
65
- icon: p.metadata?.icon
66
- });
67
- }
68
- });
69
-
70
- return list;
71
- }
72
- },
73
- watch: {
74
- name(neu, old) {
75
- if (this.canModifyLocation) {
76
- this.location = `/pkg/${ neu }/${ neu }.umd.min.js`;
77
- }
78
- },
79
- location(neu, old) {
80
- if (this.canModifyName) {
81
- const names = neu.split('/');
82
- let last = names[names.length - 1];
83
- const index = last.indexOf('.umd.min.js');
84
-
85
- if (index !== -1) {
86
- last = last.substr(0, index);
87
- }
88
-
89
- this.name = last;
90
- }
91
- }
92
- },
93
- methods: {
94
- updateName(v) {
95
- this.canModifyName = v.length === 0;
96
- },
97
- updateLocation(v) {
98
- this.canModifyLocation = v.length === 0;
99
- },
100
- showAddDialog() {
101
- this.dialogOpen = true;
102
- this.$modal.show('addPluginDialog');
103
- },
104
-
105
- closeAddDialog() {
106
- this.dialogOpen = false;
107
- this.$modal.hide('addPluginDialog');
108
- },
109
-
110
- showAddCatalogDialog() {
111
- this.catalogDialogOpen = true;
112
- this.$modal.show('addCatlogDialog');
113
- },
114
- closeAddCatalogDialog() {
115
- this.catalogDialogOpen = false;
116
- this.$modal.hide('addCatlogDialog');
117
- },
118
-
119
- addCatalog() {
120
- this.$store.dispatch('uiplugins/addCatalog', this.catalogUrl);
121
- this.$store.dispatch('uiplugins/loadCatalogs');
122
- this.closeAddCatalogDialog();
123
- },
124
-
125
- loadPlugin() {
126
- this.load(this.name, this.location);
127
- },
128
-
129
- load(name, url) {
130
- if (!name) {
131
- const parts = url.split('/');
132
- const n = parts[parts.length - 1];
133
-
134
- name = n.split('.')[0];
135
- }
136
-
137
- this.$plugin.loadAsync(name, url).then(() => {
138
- this.closeAddDialog();
139
- this.$store.dispatch('growl/success', {
140
- title: `Loaded plugin ${ name }`,
141
- message: `Plugin was loaded successfully`,
142
- timeout: 3000,
143
- }, { root: true });
144
- }).catch((error) => {
145
- this.closeAddDialog();
146
- const message = typeof error === 'object' ? 'Could not load code' : error;
147
-
148
- this.$store.dispatch('growl/error', {
149
- title: 'Error loading plugin',
150
- message,
151
- timeout: 5000
152
- }, { root: true });
153
- });
154
- },
155
-
156
- async install(plugin) {
157
- // Might need to download the package first
158
- if (plugin.download) {
159
- await this.$store.dispatch('rancher/request', { url: plugin.download }, { root: true });
160
- }
161
-
162
- const name = `${ plugin.name }-${ plugin.version }`;
163
- let moduleUrl = `/pkg/${ name }/${ name }.umd.min.js`;
164
-
165
- if (plugin.location) {
166
- moduleUrl = `${ plugin.location }/${ name }/${ name }.umd.min.js`;
167
- }
168
-
169
- this.load(name, moduleUrl);
170
- },
171
-
172
- uninstall(plugin) {
173
- this.$plugin.removePlugin(plugin.name);
174
- }
175
- }
176
- };
177
- </script>
178
-
179
- <template>
180
- <div class="plugins">
181
- <div class="plugin-header">
182
- <h2>Plugins</h2>
183
- <button class="btn role-primary mr-10" @click="showAddCatalogDialog()">
184
- Add Catalog
185
- </button>
186
- <button class="btn role-primary" @click="showAddDialog()">
187
- Load
188
- </button>
189
- </div>
190
- <br />
191
- <div class="plugin-list">
192
- <div v-for="plugin in list" :key="plugin.name" class="plugin">
193
- <div class="plugin-icon">
194
- <img v-if="plugin.icon" :src="plugin.icon" class="icon plugin-icon-img" />
195
- <i v-else class="icon icon-apps"></i>
196
- </div>
197
- <div class="plugin-metadata">
198
- <div class="plugin-name">
199
- {{ plugin.name }}
200
- </div>
201
- <div>{{ plugin.description }}</div>
202
- <div v-if="plugin.builtin" class="plugin-builtin">
203
- Built-in plugin
204
- </div>
205
- <div class="plugin-version">
206
- {{ plugin.displayVersion }}
207
- </div>
208
- <div v-if="plugin.installed">
209
- <!-- <div>{{ plugin.installed.version }}</div> -->
210
- <div class="plugin-actions">
211
- <button class="btn role-secondary" @click="uninstall(plugin)">
212
- Uninstall
213
- </button>
214
- </div>
215
- </div>
216
- <div v-else class="plugin-actions">
217
- <button class="btn role-secondary" @click="install(plugin)">
218
- Install
219
- </button>
220
- </div>
221
- </div>
222
- </div>
223
- </div>
224
-
225
- <modal
226
- name="addPluginDialog"
227
- height="auto"
228
- :scrollable="true"
229
- @closed="closeAddDialog()"
230
- >
231
- <div class="plugin-add-dialog">
232
- <h4 class="mt-20">
233
- Load Plugin
234
- </h4>
235
- <div class="custom">
236
- <div class="fields">
237
- <LabeledInput v-model="name" v-focus label="Plugin module name" @input="updateName" />
238
- </div>
239
- </div>
240
- <div class="custom mt-10">
241
- <div class="fields">
242
- <LabeledInput v-model="location" label="Plugin URL" @input="updateLocation" />
243
- </div>
244
- <div class="dialog-buttons">
245
- <button class="btn role-secondary" @click="closeAddDialog()">
246
- Cancel
247
- </button>
248
- <button class="btn role-primary" @click="loadPlugin()">
249
- Load Plugin
250
- </button>
251
- </div>
252
- </div>
253
- </div>
254
- </modal>
255
-
256
- <modal
257
- name="addCatlogDialog"
258
- height="auto"
259
- :scrollable="true"
260
- @closed="closeAddCatalogDialog()"
261
- >
262
- <div class="plugin-add-dialog">
263
- <h4 class="mt-20">
264
- Add Plugin Catalog
265
- </h4>
266
- <div class="custom mt-10">
267
- <div class="fields">
268
- <LabeledInput v-model="catalogUrl" label="Catalog URL" />
269
- </div>
270
- <div class="dialog-buttons">
271
- <button class="btn role-secondary" @click="closeAddCatalogDialog()">
272
- Cancel
273
- </button>
274
- <button class="btn role-primary" @click="addCatalog()">
275
- Add
276
- </button>
277
- </div>
278
- </div>
279
- </div>
280
- </modal>
281
- </div>
282
- </template>
283
-
284
- <style lang="scss" scoped>
285
- .plugin-list {
286
- display: flex;
287
- > .plugin:not(:last-child) {
288
- margin-right: 20px;
289
- }
290
- }
291
- .plugins {
292
- display: inherit;
293
- }
294
-
295
- .plugin-add-dialog {
296
- padding: 10px;
297
-
298
- .dialog-buttons {
299
- display: flex;
300
- justify-content: flex-end;
301
-
302
- > *:not(:last-child) {
303
- margin-right: 10px;
304
- }
305
- }
306
- }
307
-
308
- .plugin-header {
309
- display: flex;
310
- align-items: center;
311
- margin-bottom: 10px;
312
-
313
- > h2 {
314
- flex: 1;
315
- margin-bottom: 0;
316
- }
317
- }
318
-
319
- .plugin {
320
- display: flex;
321
- border: 1px solid var(--border);
322
- padding: 10px;
323
- width: 320px;
324
-
325
- .plugin-icon {
326
- font-size: 40px;
327
- margin-right:10px;
328
- color: #888;
329
-
330
- .plugin-icon-img {
331
- height: 40px;
332
- width: 40px;
333
- }
334
- }
335
-
336
- .plugin-metadata {
337
- flex: 1;
338
- }
339
-
340
- .plugin-builtin {
341
- color: var(--primary);
342
- display: block;
343
- padding: 2px 0;
344
- text-transform: uppercase;
345
- }
346
-
347
- .plugin-name {
348
- font-size: 16px;
349
- font-weight: bold;
350
- }
351
-
352
- .plugin-version {
353
- border: 1px solid var(--primary);
354
- display: inline-block;
355
- font-size: 12px;
356
- padding: 2px 5px;
357
- border-radius: 4px;
358
- margin: 5px 0;
359
- }
360
-
361
- .plugin-actions {
362
- display: flex;
363
- justify-content: flex-end;
364
-
365
- .btn {
366
- line-height: 20px;
367
- min-height: 20px;
368
- padding: 0 5px;
369
- }
370
- }
371
- }
372
-
373
- .fields {
374
- display: flex;
375
- // > div:first-child {
376
- // width: 260px;
377
- // margin-right: 20px;
378
- // }
379
- }
380
-
381
- .custom {
382
- button {
383
- margin-top: 10px;
384
- }
385
- }
386
-
387
- </style>
@@ -1,56 +0,0 @@
1
- import http from 'http';
2
- import path from 'path';
3
- import fs from 'fs-extra';
4
- import tar from 'tar';
5
-
6
- export default function(req, res, next) {
7
- if (req.url.startsWith('/download-pkg')) {
8
- const urlp = req.url.split('/');
9
- const pkg = urlp[urlp.length - 1];
10
- const name = pkg.split('-')[0];
11
-
12
- const downloadFolder = path.resolve(__dirname, '..', '..', 'dist-pkg');
13
- const pkgFolder = path.resolve(downloadFolder, pkg);
14
-
15
- // If the package is already there, use that
16
- if (fs.existsSync(pkgFolder)) {
17
- res.statusCode = 200;
18
- res.write('OK');
19
-
20
- return res.end();
21
- }
22
-
23
- // Need to download
24
- const url = `http://127.0.0.1:4873/${ name }/-/${ pkg }.tgz`;
25
- const destPath = path.join(downloadFolder, `${ pkg }.tgz`);
26
- const dest = fs.createWriteStream(destPath);
27
-
28
- dest.on('open', () => {
29
- http.get(url, (response) => {
30
- response.pipe(dest);
31
- }).on('error', () => {
32
- fs.unlink(dest);
33
- res.status = 500;
34
- res.write('ERROR');
35
- res.end();
36
- });
37
- });
38
-
39
- dest.on('finish', () => {
40
- dest.close(() => {
41
- fs.ensureDirSync(pkgFolder);
42
- tar.x({
43
- file: destPath,
44
- strip: 1,
45
- C: pkgFolder
46
- }).then(() => {
47
- res.statusCode = 200;
48
- res.write('OK');
49
- res.end();
50
- });
51
- });
52
- });
53
- } else {
54
- next();
55
- }
56
- }