diff --git a/src/ui/client/builder/pages/services.py b/src/ui/client/builder/pages/services.py index 4686efbff..27547f651 100644 --- a/src/ui/client/builder/pages/services.py +++ b/src/ui/client/builder/pages/services.py @@ -269,7 +269,7 @@ def services_action( } ) - if operation == "edit" or operation == "new": + if operation == "edit" or operation == "new" or operation == "clone": modes = ("easy", "advanced", "raw") mode_buttons = [] for mode in modes: @@ -281,7 +281,7 @@ def services_action( size="normal", attrs={ "role": "link", - "data-link": f"modes?service_name={server_name}&mode={mode}" if operation != "new" else f"modes?mode={mode}", + "data-link": f"modes?service_name={'' if operation == 'new' else server_name}&mode={mode}&operation={operation}", }, ) ) @@ -340,7 +340,7 @@ def get_services_list(services): ), button_widget( id=f"open-modal-manage-{index}", - text="manage", + text="action_manage", hideText=True, color="edit", size="normal", @@ -373,6 +373,23 @@ def get_services_list(services): is_draft=is_draft, ), ), + button_widget( + id=f"open-modal-clone-{index}", + text="action_clone", + hideText=True, + color="sky", + size="normal", + iconName="clone", + iconColor="white", + modal=services_action( + server_name=server_name, + operation="clone", + title="services_clone_title", + subtitle="services_clone_subtitle", + additional=server_name, + ), + attrs={"data-server-name": server_name}, + ), button_widget( attrs={"data-server-name": server_name}, id=f"open-modal-delete-{index}", diff --git a/src/ui/client/dashboard/components/Icons/Clone.vue b/src/ui/client/dashboard/components/Icons/Clone.vue new file mode 100644 index 000000000..d5cdd8cd0 --- /dev/null +++ b/src/ui/client/dashboard/components/Icons/Clone.vue @@ -0,0 +1,59 @@ + + diff --git a/src/ui/client/dashboard/components/Widget/Icons.vue b/src/ui/client/dashboard/components/Widget/Icons.vue index 34a1d2128..0563eb863 100644 --- a/src/ui/client/dashboard/components/Widget/Icons.vue +++ b/src/ui/client/dashboard/components/Widget/Icons.vue @@ -41,6 +41,8 @@ import Uncheck from "@components/Icons/Uncheck.vue"; import Back from "@components/Icons/Back.vue"; import Refresh from "@components/Icons/Refresh.vue"; import Download from "@components/Icons/Download.vue"; +import Clone from "@components/Icons/Clone.vue"; + /** * @name Widget/Icons.vue * @description This component is a wrapper that contains all the icons available in the application (Icons folder). @@ -112,6 +114,7 @@ onMounted(() => { v-if="useEqualStr(props.iconName, 'exclamation')" v-bind="icon" /> + diff --git a/src/ui/client/dashboard/components/Widget/Tabulator.vue b/src/ui/client/dashboard/components/Widget/Tabulator.vue index c5b920918..f793af155 100644 --- a/src/ui/client/dashboard/components/Widget/Tabulator.vue +++ b/src/ui/client/dashboard/components/Widget/Tabulator.vue @@ -291,7 +291,9 @@ onMounted(() => { a11yTable(table.instance); // Add table instance to store in order to use it in other components tableStore.setTable(props.id, table.instance); - table.instance.redraw(); + setTimeout(() => { + table.instance.redraw(); + }, 20); }); } catch (e) {} diff --git a/src/ui/client/dashboard/lang/en.json b/src/ui/client/dashboard/lang/en.json index 9bf2d6d1c..779a7af0e 100644 --- a/src/ui/client/dashboard/lang/en.json +++ b/src/ui/client/dashboard/lang/en.json @@ -144,6 +144,8 @@ "icons_linkedin_desc": "Linkedin icon representing a link to a Linkedin profile.", "icons_twitter_desc": "Twitter icon representing a link to a Twitter account.", "action_switch": "switch {name}", + "action_manage": "manage {name}", + "action_clone": "clone {name}", "action_send": "send {name}", "action_start": "start {name}", "action_disable": "disable {name}", @@ -329,6 +331,8 @@ "services_mode_subtitle": "Manage your service settings.", "services_manage_subtitle": "Manage your service settings.", "services_no_easy_mode": "No easy mode for this template", + "services_clone_title": "Clone service", + "services_clone_subtitle": "Choose a mode to clone service", "logs_title": "Logs", "logs_not_found": "No logs found", "logs_no_files_found": "No log files found", diff --git a/src/ui/client/dashboard/pages/services/index.html b/src/ui/client/dashboard/pages/services/index.html index b9ee1b594..977077c54 100644 --- a/src/ui/client/dashboard/pages/services/index.html +++ b/src/ui/client/dashboard/pages/services/index.html @@ -20,7 +20,7 @@ >