@appscode/design-system 2.2.36 → 2.2.37

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.2.36",
3
+ "version": "2.2.37",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -56,14 +56,14 @@ function onAddClick() {
56
56
  prop.clearAllFields();
57
57
  }
58
58
 
59
- function onSaveItem() {
60
- prop.saveNewItem();
61
- resetAllData();
59
+ async function onSaveItem() {
60
+ const resetData = await prop.saveNewItem();
61
+ if (resetData) resetAllData();
62
62
  }
63
63
 
64
- function onSaveEditedItem(row: number) {
65
- prop.saveEditedItem(row);
66
- resetAllData();
64
+ async function onSaveEditedItem(row: number) {
65
+ const resetData = await prop.saveEditedItem(row);
66
+ if (resetData) resetAllData();
67
67
  }
68
68
 
69
69
  function resetAllData() {
@@ -11,69 +11,80 @@ const props = withDefaults(defineProps<Props>(), {
11
11
  baseUrl: "https://appscode.com",
12
12
  });
13
13
 
14
- const NavbarItem = defineAsyncComponent(() => import("./NavbarItem.vue"));
15
- const NavbarItemContent = defineAsyncComponent(() => import("./NavbarItemContent.vue"));
16
- const showDrawer = ref(false);
17
-
18
- function handleIsActiveChange(isActive: string) {
19
- showDrawer.value = !!isActive?.length;
20
- }
21
-
22
- const getUrl = (products: Props["currentApp"]) => {
23
- return `${props.baseUrl}/${products}`;
24
- };
25
-
26
14
  const appList = [
27
15
  {
28
16
  name: "console",
29
- url: getUrl("console"),
30
17
  icon_url: "https://cdn.appscode.com/images/products/console/console_512x512.svg",
31
18
  title: "Console",
19
+ port: "5990",
32
20
  sub_title: "Manage your kubernetes clusters",
33
21
  },
34
22
  {
35
23
  name: "db",
36
- url: getUrl("db"),
37
24
  icon_url: "https://cdn.appscode.com/images/products/kubedb/kubedb-512x512_1.svg",
38
25
  title: "KubeDB",
26
+ port: "5996",
39
27
  sub_title: "Manage your databases",
40
28
  },
41
29
  {
42
30
  name: "grafana",
43
- url: getUrl("grafana"),
44
31
  icon_url: "https://cdn.appscode.com/images/products/others/logos/grafana.svg",
45
32
  title: "Grafana",
33
+ port: "3005",
46
34
  sub_title: "Analyze your activities",
47
35
  },
48
36
  {
49
37
  name: "selfhost",
50
- url: getUrl("selfhost"),
51
38
  icon_url: "https://cdn.appscode.com/images/products/selfhost/logos/selfhost.svg",
52
39
  title: "SelfHost",
40
+ port: "5993",
53
41
  sub_title: "Host AppsCode on your own cluster",
54
42
  },
55
43
  {
56
44
  name: "billing",
57
- url: getUrl("billing"),
58
45
  icon_url: "https://cdn.appscode.com/images/products/billing/logos/billing.svg",
59
46
  title: "Billing",
60
47
  sub_title: "Manage your contracts, licenses & billings",
61
48
  },
62
49
  {
63
50
  name: "learn",
64
- url: getUrl("learn"),
65
51
  icon_url: "https://cdn.appscode.com/images/products/learn/logos/learn.svg",
66
52
  title: "Learn",
67
53
  sub_title: "Be an Expert in Cloud Native technologies",
68
54
  },
69
55
  ];
70
56
 
57
+ const NavbarItem = defineAsyncComponent(() => import("./NavbarItem.vue"));
58
+ const NavbarItemContent = defineAsyncComponent(() => import("./NavbarItemContent.vue"));
59
+ const showDrawer = ref(false);
60
+
61
+ function handleIsActiveChange(isActive: string) {
62
+ showDrawer.value = !!isActive?.length;
63
+ }
64
+
65
+ const getUrl = (product: (typeof appList)[0]) => {
66
+ if (props.baseUrl.search("bb.test") !== -1) {
67
+ return `http://bb.test:${product.port}/${product.name}`;
68
+ } else if (props.baseUrl.search("localhost") !== -1) {
69
+ return `http://localhost:${product.port}/${product.name}`;
70
+ }
71
+
72
+ return `${props.baseUrl}/${product.name}`;
73
+ };
74
+
75
+ const appListWithUrl = appList.map((el) => {
76
+ return {
77
+ ...el,
78
+ url: getUrl(el),
79
+ };
80
+ });
81
+
71
82
  const isSelfHosted = computed(() => {
72
83
  const list = ["https://appscode.ninja", "https://appscode.com", "http://bb.test:8080"];
73
84
  return !list.includes(props.baseUrl);
74
85
  });
75
86
 
76
- const filteredAppList = appList.filter((element) => {
87
+ const filteredAppList = appListWithUrl.filter((element) => {
77
88
  // remove own app from dropdown
78
89
  if (element.name === props.currentApp) return false;
79
90