diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a0a0fe2df5..0c05b378d0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -142,6 +142,7 @@ jobs: run: | ls yarn coverage + ls coverage - name: Upload unit test coverage to Codecov uses: codecov/codecov-action@v3 diff --git a/shell/assets/images/generic-plugin.svg b/shell/assets/images/generic-plugin.svg new file mode 100644 index 0000000000..1277beb38c --- /dev/null +++ b/shell/assets/images/generic-plugin.svg @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/shell/assets/translations/en-us.yaml b/shell/assets/translations/en-us.yaml index 8c3d801276..e946d0cb95 100644 --- a/shell/assets/translations/en-us.yaml +++ b/shell/assets/translations/en-us.yaml @@ -43,6 +43,7 @@ generic: info: Info warning: Warning error: Error + ok: OK overview: Overview plusMore: "+ {n} more" readFromFile: Read from File @@ -188,6 +189,7 @@ product: neuvector: NeuVector harvesterManager: Virtualization Management rancher: Rancher + uiplugins: UI Plugins suffix: percent: "%" @@ -598,7 +600,11 @@ asyncButton: install: action: Install success: Installing - waiting: Starting… + waiting: Installing… + load: + action: Load + success: Loaded + waiting: Loadingg… pause: action: Pause Orchestration success: Paused Orchestration @@ -903,6 +909,8 @@ catalog: rancher-charts: '{vendor}' rancher-partner-charts: Partners rancher-rke2-charts: RKE2 + rancher-ui-plugins: Rancher Extensions + target: git: Git repository containing Helm chart or cluster template definitions http: http(s) URL to an index generated by Helm @@ -3645,6 +3653,89 @@ persistentVolumeClaim: readWriteMany: Many Nodes Read-Write status: label: Status + +# UI Plugins +plugins: + labels: + builtin: Built-in + experimental: Experimental + third-party: Third-Party + installing: Installing ... + uninstalling: Uninstalling ... + descriptions: + experimental: This UI Plugin is marked as experimental + third-party: This UI plugin is provided by a Third-Party + error: + title: Error loading plugin + message: Could not load plugin code + success: + title: Loaded plugin {name} + message: Plugin was loaded successfully + developer: + label: Developer Load + title: Developer Load Plugin + prompt: Load a plugin from a URL + fields: + url: Plugin URL + name: Plugin module name + persist: Persist plugin by creating custom resource + info: + detail: Detail + versions: Versions + versionError: Could not load version information + empty: + all: No UI Plugins either installed nor available + available: No UI Plugins available + installed: No UI Plugins installed + updates: No UI Plugin updates available + loadError: An error occurred loading the code for this plugin + helmError: "An error occurred installing the plugin via Helm" + tabs: + all: All + available: Available + installed: Installed + updates: Updates + title: UI Plugins + install: + label: Install + title: Install UI Plugin {name} + prompt: "Are you sure that you want to install this UI Plugin?" + version: Version + warnNotCertified: Please ensure that you are aware of the risks of installing UI Plugins from untrusted authors + update: + label: Update + title: Update UI Plugin {name} + prompt: "Are you sure that you want to update this UI Plugin?" + rollback: + label: Rollback + title: Rollback UI Plugin {name} + prompt: "Are you sure that you want to rollback this UI Plugin?" + uninstall: + label: Uninstall + title: "Uninstall UI Plugin: {name}" + prompt: "Are you sure that you want to uninstall this UI Plugin?" + upgradeAvailable: A newer version of this UI Plugin is available + safeMode: + title: UI Plugins Safe Mode + message: UI Plugins were not loaded + setup: + title: UI Plugin Support is not enabled + prompt: + cant: Automatic installation is not available - required Helm Charts could not be found + can: You need to install the Plugin Operator + install: + title: Enable UI Plugin Support? + prompt: This will install the Helm charts to enable Rancher UI Plugin support + airgap: Un-check if your Rancher installation is air-gapped + addRancherRepo: Add the Rancher UI Plugins Repository + remove: + label: Disable UI Plugin Support + title: Disable UI Plugin Support? + prompt: This will un-install the Helm charts that enable Rancher UI Plugin support + registry: + title: Remove the Rancher UI Plugins Repository + prompt: Remove the default UI Plugins Repository + prefs: title: Preferences theme: @@ -3683,6 +3774,7 @@ prefs: viewInApi: Enable "View in API" allNamespaces: Show system Namespaces managed by Rancher (not intended for editing or deletion) themeShortcut: Enable Dark/Light Theme keyboard shortcut toggle (shift+T) + pluginDeveloper: Enable UI Plugin Developer features hideDesc: label: Hide All Type Descriptions helm: diff --git a/shell/components/AsyncButton.vue b/shell/components/AsyncButton.vue index 20895853d6..be0e8bf4da 100644 --- a/shell/components/AsyncButton.vue +++ b/shell/components/AsyncButton.vue @@ -95,7 +95,13 @@ export default Vue.extend({ currentPhase: { type: String, default: ASYNC_BUTTON_STATES.ACTION, - } + }, + + manual: { + type: Boolean, + default: false, + }, + }, data(): { phase: string, timer?: NodeJS.Timeout} { @@ -190,6 +196,12 @@ export default Vue.extend({ } }, + beforeDestroy() { + if (this.timer) { + clearTimeout(this.timer); + } + }, + methods: { clicked($event: MouseEvent) { if ($event) { @@ -205,7 +217,10 @@ export default Vue.extend({ clearTimeout(this.timer); } - this.phase = ASYNC_BUTTON_STATES.WAITING; + // If manual property is set, don't automatically change the button on click + if (!this.manual) { + this.phase = ASYNC_BUTTON_STATES.WAITING; + } const cb: AsyncButtonCallback = (success) => { this.done(success); diff --git a/shell/components/Dialog.vue b/shell/components/Dialog.vue new file mode 100644 index 0000000000..ab90332880 --- /dev/null +++ b/shell/components/Dialog.vue @@ -0,0 +1,102 @@ + + + + + diff --git a/shell/components/IconMessage.vue b/shell/components/IconMessage.vue index 4222f0c366..57be4e8069 100644 --- a/shell/components/IconMessage.vue +++ b/shell/components/IconMessage.vue @@ -21,12 +21,16 @@ export default { type: String, default: null }, + subtle: { + type: Boolean, + default: false, + } }, };