diff --git a/package.json b/package.json index a84b375e..b15fa537 100644 --- a/package.json +++ b/package.json @@ -85,10 +85,14 @@ "not dead" ], "lint-staged": { - "*.{js,jsx,ts,tsx,vue,scss,less}": [ - "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "*.{js,jsx,ts,tsx,vue}": [ + "eslint . --ext .vue,.js,.jsx,.ts,.tsx --fix --ignore-path .gitignore", "prettier --write \"src/**/*.{js,tsx,css,less,scss,vue,html,md}\"", - "stylelint --cache --fix \"**/*.{vue,less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/" + "stylelint --cache --fix \"**/*.{vue}\" --cache --cache-location node_modules/.cache/stylelint/" + ], + "*.{scss,less}": [ + "prettier --write \"src/**/*.{js,tsx,css,less,scss,vue,html,md}\"", + "stylelint --cache --fix \"**/*.{less,postcss,css,scss}\" --cache --cache-location node_modules/.cache/stylelint/" ], "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ "prettier --write" diff --git a/src/App.vue b/src/App.vue index 194f4c04..93c3bce8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,11 +15,22 @@ limitations under the License. --> + diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index fc9c0526..d50cc283 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - {{ appStore.pageTitle || t(pageName) }} + {{ route.name === "ViewWidget" ? "" : appStore.pageTitle || t(pageName) }} {{ t("timeTips") }} - + @@ -76,7 +76,7 @@ limitations under the License. --> + diff --git a/src/views/dashboard/components/WidgetLink.vue b/src/views/dashboard/components/WidgetLink.vue new file mode 100644 index 00000000..4e5c3437 --- /dev/null +++ b/src/views/dashboard/components/WidgetLink.vue @@ -0,0 +1,125 @@ + + + + + {{ t("setDuration") }} + + + + {{ t("duration") }} + + + {{ t("generateLink") }} + + + {{ host + widgetLink }} + + + + + + + + + diff --git a/src/views/dashboard/controls/Widget.vue b/src/views/dashboard/controls/Widget.vue index cb38795a..afab6592 100644 --- a/src/views/dashboard/controls/Widget.vue +++ b/src/views/dashboard/controls/Widget.vue @@ -26,18 +26,21 @@ limitations under the License. --> - + - + {{ t("edit") }} - + {{ t("delete") }} + + {{ t("generateLink") }} + @@ -161,6 +164,10 @@ limitations under the License. --> } } } + function generateLink() { + dashboardStore.setWidgetLink(true); + dashboardStore.selectWidget(props.data); + } watch( () => [props.data.metricTypes, props.data.metrics], () => { @@ -227,6 +234,7 @@ limitations under the License. --> state, appStore, removeWidget, + generateLink, editConfig, data, loading,