diff --git a/ui/app/router.js b/ui/app/router.js index 4fa9e490e..2b5d1d974 100644 --- a/ui/app/router.js +++ b/ui/app/router.js @@ -39,7 +39,7 @@ Router.map(function() { }); this.route('plugins', function() { - this.route('plugin', { path: '/:plugin-name' }); + this.route('plugin', { path: '/:plugin_name' }); }); }); diff --git a/ui/app/routes/csi/plugins/plugin.js b/ui/app/routes/csi/plugins/plugin.js new file mode 100644 index 000000000..b96c4f418 --- /dev/null +++ b/ui/app/routes/csi/plugins/plugin.js @@ -0,0 +1,41 @@ +import { inject as service } from '@ember/service'; +import Route from '@ember/routing/route'; +import { collect } from '@ember/object/computed'; +import notifyError from 'nomad-ui/utils/notify-error'; +import { watchRecord } from 'nomad-ui/utils/properties/watch'; +import WithWatchers from 'nomad-ui/mixins/with-watchers'; + +export default Route.extend(WithWatchers, { + store: service(), + system: service(), + + breadcrumbs: plugin => [ + { + label: 'Plugins', + args: ['csi.plugins'], + }, + { + label: plugin.name, + args: ['csi.plugins.plugin', plugin.name], + }, + ], + + startWatchers(controller, model) { + if (!model) return; + + controller.set('watchers', { + model: this.watch.perform(model), + }); + }, + + serialize(model) { + return { plugin_name: model.get('plainId') }; + }, + + model(params) { + return this.store.findRecord('plugin', `csi/${params.plugin_name}`).catch(notifyError(this)); + }, + + watch: watchRecord('plugin'), + watchers: collect('watch'), +}); diff --git a/ui/app/templates/csi/plugins/plugin.hbs b/ui/app/templates/csi/plugins/plugin.hbs new file mode 100644 index 000000000..78b5507d5 --- /dev/null +++ b/ui/app/templates/csi/plugins/plugin.hbs @@ -0,0 +1,24 @@ +{{title "CSI Plugin " model.id}} +
+

{{model.plainId}}

+ +
+
+ Plugin Details + + Controller Health + {{format-percentage model.controllersHealthy total=model.controllersExpected}} + ({{model.controllersHealthy}}/{{model.controllersExpected}}) + + + Node Health + {{format-percentage model.nodesHealthy total=model.nodesExpected}} + ({{model.nodesHealthy}}/{{model.nodesExpected}}) + + + Provider + {{model.provider}} + +
+
+