Create skeleton

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia
2024-10-23 17:00:40 +02:00
committed by Francesco Torchia
parent 13e4e92c75
commit 56000e609e
19 changed files with 18089 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
module.exports = require('./.shell/pkg/babel.config.js');
+18
View File
@@ -0,0 +1,18 @@
import { importTypes } from '@rancher/auto-import';
import { IPlugin } from '@shell/core/types';
import extensionRouting from './routing/extension-routing';
// Init the package
export default function(plugin: IPlugin): void {
// Auto-import model, detail, edit from the folders
importTypes(plugin);
// Provide plugin metadata from package.json
plugin.metadata = require('./package.json');
// Load a product
plugin.addProduct(require('./product'));
// Add Vue Routes
plugin.addRoutes(extensionRouting);
}
+28
View File
@@ -0,0 +1,28 @@
{
"name": "harvester",
"description": "harvester plugin",
"version": "0.1.0",
"private": false,
"rancher": {
"annotations": {
"catalog.cattle.io/rancher-version": ">= v2.8.3"
}
},
"scripts": {
"dev": "./node_modules/.bin/nuxt dev",
"nuxt": "./node_modules/.bin/nuxt"
},
"engines": {
"node": ">=16"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.5.18",
"@vue/cli-service": "4.5.18",
"@vue/cli-plugin-typescript": "4.5.18"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
+10
View File
@@ -0,0 +1,10 @@
<script>
export default {
name: 'Dashboard',
};
</script>
<template>
<span>hello harvester</span>
</template>
+23
View File
@@ -0,0 +1,23 @@
import { IPlugin } from '@shell/core/types';
export function init($plugin: IPlugin, store: any) {
const PRODUCT_NAME = 'harvester';
const BLANK_CLUSTER = '_';
const { product } = $plugin.DSL(store, PRODUCT_NAME);
product({
icon: 'gear',
inStore: 'management',
weight: 100,
to: {
name: `${ PRODUCT_NAME }-c-cluster`,
path: `/${ PRODUCT_NAME }/c/:cluster/dashboard`,
params: {
product: PRODUCT_NAME,
cluster: BLANK_CLUSTER,
pkg: PRODUCT_NAME
}
}
});
}
@@ -0,0 +1,20 @@
// Don't forget to create a VueJS page called index.vue in the /pages folder!!!
import Dashboard from '../pages/index.vue';
const BLANK_CLUSTER = '_';
const PRODUCT_NAME = 'harvester';
const routes = [
{
name: `${ PRODUCT_NAME }-c-cluster`,
path: `/${ PRODUCT_NAME }/c/:cluster`,
component: Dashboard,
meta: {
product: PRODUCT_NAME,
cluster: BLANK_CLUSTER,
pkg: PRODUCT_NAME
}
}
];
export default routes;
+53
View File
@@ -0,0 +1,53 @@
{
"compilerOptions": {
"allowJs": true,
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": ".",
"preserveSymlinks": true,
"typeRoots": [
"../../node_modules",
"../../node_modules/@rancher/shell/types"
],
"types": [
"node",
"webpack-env",
"@types/node",
"@types/jest",
"@types/lodash",
"rancher",
"shell"
],
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
],
"paths": {
"@shell/*": [
"../../node_modules/@rancher/shell/*"
],
"@components/*": [
"@rancher/components/*"
]
}
},
"include": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.vue"
],
"exclude": [
"../../node_modules"
]
}
+1
View File
@@ -0,0 +1 @@
module.exports = require('./.shell/pkg/vue.config')(__dirname);