Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions agent/app/service/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -3000,6 +3000,15 @@ func (w WebsiteService) DeleteLoadBalance(req request.WebsiteLBDelete) error {
if err != nil {
return err
}
proxies, _ := w.GetProxies(website.ID)
if len(proxies) > 0 {
for _, proxy := range proxies {
if strings.HasSuffix(proxy.ProxyPass, fmt.Sprintf("://%s", req.Name)) {
return buserr.New("ErrProxyIsUsed")
}
}
}

includeDir := GetSitePath(website, SiteUpstreamDir)
fileOp := files.NewFileOp()
filePath := path.Join(includeDir, fmt.Sprintf("%s.conf", req.Name))
Expand Down
1 change: 1 addition & 0 deletions agent/i18n/lang/zh.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ ErrDefaultAlias: "default 为保留代号,请使用其他代号"
ErrParentWebsite: "需要先删除子网站 {{ .name }}"
ErrBuildDirNotFound: "构建目录不存在"
ErrImageNotExist: "运行环境 {{ .name }} 镜像不存在,请重新编辑运行环境"
ErrProxyIsUsed: "负载均衡已被反向代理使用,无法删除"

#ssl
ErrSSLCannotDelete: "{{ .name }} 证书正在被网站使用,无法删除"
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/log/file/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
class="log-item"
:style="{ top: `${(startIndex + index) * logHeight}px` }"
>
<hightlight :log="log" :type="config.colorMode"></hightlight>
<hightlight :log="log" :type="config.colorMode ?? 'nginx'"></hightlight>
</div>
</div>
</div>
Expand All @@ -41,7 +41,7 @@ const globalStore = GlobalStore();

interface LogProps {
id?: number;
type: string;
type?: string;
name?: string;
tail?: boolean;
taskID?: string;
Expand All @@ -63,6 +63,7 @@ const props = defineProps({
taskType: '',
taskOperate: '',
resourceID: 0,
taskID: '',
}),
},
defaultButton: {
Expand Down
12 changes: 12 additions & 0 deletions frontend/src/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,17 @@ const handleMenuClick = async (path) => {
tabsStore.activeTabPath = route.path;
};

const toLogin = () => {
let baseUrl = window.location.origin;
let newUrl = '';
if (globalStore.entrance) {
newUrl = baseUrl + '/' + globalStore.entrance;
} else {
newUrl = baseUrl + '/login';
}
window.open(newUrl, '_self');
};

const loadStatus = async () => {
loading.value = globalStore.isLoading;
loadingText.value = globalStore.loadingText;
Expand All @@ -109,6 +120,7 @@ const loadStatus = async () => {
.then((res) => {
if (res) {
location.reload();
toLogin();
clearInterval(Number(timer));
timer = null;
}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/login/components/login-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ const login = (formEl: FormInstance | undefined) => {
tabsStore.removeAllTabs();
globalStore.currentNode = 'local';
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
console.log('loiin syc');
router.push({ name: 'home' });
document.onkeydown = null;
} catch (res) {
Expand Down
16 changes: 5 additions & 11 deletions frontend/src/views/website/runtime/dotnet/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ $t('runtime.create') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="dotnet-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()">
<el-table-column
Expand Down Expand Up @@ -87,7 +91,7 @@
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref, computed } from 'vue';
import { onMounted, reactive, ref, computed } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand All @@ -105,7 +109,6 @@ import RuntimeStatus from '@/views/website/runtime/components/runtime-status.vue
import PortJump from '@/views/website/runtime/components/port-jump.vue';
import { disabledButton } from '@/utils/runtime';

let timer: NodeJS.Timer | null = null;
const loading = ref(false);
const items = ref<Runtime.RuntimeDTO[]>([]);
const operateRef = ref();
Expand Down Expand Up @@ -250,15 +253,6 @@ const toFolder = (folder: string) => {
onMounted(() => {
sync();
search();
timer = setInterval(() => {
search();
sync();
}, 1000 * 10);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code does not contain any irregularities or major issues. However, I do have some suggestions for optimizations:

  1. Remove Timer Initialization: The code attempts to initialize a timer within the onMounted lifecycle hook but immediately sets it to null before clearing it in the onUnmounted hook. This creates an unnecessary setup.

    // OnMounted
    sync();
    search();
    
    // OnUnmounted
    clearInterval(Number(timer));

    This can be simplified since initializing and clearing the interval within these hooks is redundant because the interval will stop automatically when the component is unmounted.

  2. Consistent Function Call: In the template <TableRefresh @search="search()" />, you use single quotes around "dotnet-runtime-refresh". It's better consistency to use double quotes or even remove them if they are not needed.

    <TableRefresh @search="search()" />

These changes make the code cleaner and more optimized without introducing any bugs due to the previous logic errors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code makes several changes:

  1. The rightToolBar Vue slot is added to include components such as TableRefresh and TableSetting. These components seem like utility functions related to refreshing and configuring tables, respectively. They are imported but not used within the template.

  2. A new function toFolder is introduced with a signature that takes a string parameter (folder) and returns nothing (void). No implementation or use of this function is shown.

  3. A global variable timer of type NodeJS.Timer | null is declared, initialized to null, and later assigned inside the onMounted lifecycle hook using JavaScript's interval API. This seems redundant as it could be replaced with more appropriate methods like adding event listeners for certain events or utilizing Vue's reactivity system for dynamic updates.

  4. There was an attempt to clear the previous interval before setting up a new one in the onUnmounted lifecycle hook, which is incorrect since intervals already handle auto-cleanup when their references are reassigned.

Overall, while these changes improve usability by adding interactive controls and potentially enhancing user experience, there are unnecessary components like rightToolBar, an unused function toFolder, a misused global timer, and inefficient handling of component destruction. It might be beneficial to refactor some parts of the codebase to make it cleaner and more efficient based on context-specific requirements.

Expand Down
16 changes: 5 additions & 11 deletions frontend/src/views/website/runtime/go/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ $t('runtime.create') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="go-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
<el-table-column
Expand Down Expand Up @@ -87,7 +91,7 @@
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand All @@ -109,7 +113,6 @@ const mobile = computed(() => {
return globalStore.isMobile();
});

let timer: NodeJS.Timer | null = null;
const loading = ref(false);
const items = ref<Runtime.RuntimeDTO[]>([]);
const operateRef = ref();
Expand Down Expand Up @@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
onMounted(() => {
sync();
search();
timer = setInterval(() => {
search();
sync();
}, 1000 * 10);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code has no major errors or issues that need correction at this time based on the information up until September 2021. However, there are some areas for improvement:

  1. Code Duplication: The search() method is duplicated in two places (onMounted and sync()). This could be refactored to avoid redundancy.

  2. Timer Management: Using setInterval() directly inside of Vue's lifecycle hooks can lead to unexpected behavior because components can re-render multiple times during their life cycle. Instead, consider using a more controlled approach, such as debouncing the search() call if needed.

  3. Optional Imports: It's recommended to import only what you use within each component to improve performance and readability.

Here’s an optimized version with these considerations addressed:

// Import necessary modules here

const onMounted = () => {
    sync();
    search();

// Use a debounce function to handle frequent searches
function performSearch() {
    // Add your existing search logic here
}

let searchDebounceId: number | null = null;

const delayedSearch = _.debounce(performSearch, 500);

function search() {
    searchDebounceId = delayedSearch();
}

    // Optionally clear timer when not needed anymore
};

onUnmounted(() => {
    clearInterval(searchDebounceId!);       // Ensure non-null assertion operator
});

// ... other methods and components ...

By implementing a debounce function like lodash's _.debounce, we ensure that calls to search() do not occur too frequently due to rapid user interaction. Additionally, we manage the timing around searching and syncing by clearing it appropriately when unmounted.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code has some slight improvements and necessary corrections:

  1. Missing Closing Brace for Refresh Tool Bar:
    Add a closing brace </template> to properly close the <template #rightToolBar>. Without this, the template block will not be correctly rendered.

     <template slot-scope="{ rowData }">
        <!-- Existing elements -->
    </template>
    
    <!-- Added here -->
    <tr class="table-row" v-for="(row, rowIndex) in listData" :key="row.uuid">
       <!-- existing table columns -->
    </tr>
  2. Fixed Incorrect Variable Name:
    In the script setup section, replace operateRef with an appropriate variable name that makes sense given the context, e.g., use operateForm.

  3. Removed Redundant Code:
    The interval logic can be optimized since setting up the interval on mount is enough unless needed elsewhere. Also, removing repeated calls in the mounted hook improves performance.

  • let timer: NodeJS.Timer | null = null;

    onMounted(() => {
    sync();
    search();

    // Removed setInterval as it's sufficient
    });

  • onUnmounted(() => {

  • clearInterval(Number(timer));

  • timer = null;
    });


These changes ensure better structure, correct syntax, and optimal functionality of the code while maintaining its original purpose.

Expand Down
16 changes: 5 additions & 11 deletions frontend/src/views/website/runtime/java/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ $t('runtime.create') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="java-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
<el-table-column
Expand Down Expand Up @@ -87,7 +91,7 @@
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand All @@ -109,7 +113,6 @@ const mobile = computed(() => {
return globalStore.isMobile();
});

let timer: NodeJS.Timer | null = null;
const loading = ref(false);
const items = ref<Runtime.RuntimeDTO[]>([]);
const operateRef = ref();
Expand Down Expand Up @@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
onMounted(() => {
sync();
search();
timer = setInterval(() => {
search();
sync();
}, 1000 * 10);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Expand Down
16 changes: 5 additions & 11 deletions frontend/src/views/website/runtime/node/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ $t('runtime.create') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="node-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
<el-table-column
Expand Down Expand Up @@ -88,7 +92,7 @@
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand All @@ -111,7 +115,6 @@ const mobile = computed(() => {
return globalStore.isMobile();
});

let timer: NodeJS.Timer | null = null;
const loading = ref(false);
const items = ref<Runtime.RuntimeDTO[]>([]);
const operateRef = ref();
Expand Down Expand Up @@ -265,15 +268,6 @@ const toFolder = (folder: string) => {
onMounted(() => {
sync();
search();
timer = setInterval(() => {
search();
sync();
}, 1000 * 10);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Expand Down
27 changes: 8 additions & 19 deletions frontend/src/views/website/runtime/php/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
<div>
<RouterMenu />
<LayoutContent :title="'PHP'" v-loading="loading">
<template #prompt>
<el-alert type="info" :closable="false">
<template #title>
<span>{{ $t('runtime.systemRestartHelper') }}</span>
</template>
</el-alert>
</template>
<template #prompt></template>
<template #leftToolBar>
<el-button type="primary" @click="openCreate">
{{ $t('runtime.create') }}
Expand All @@ -22,6 +16,10 @@
{{ $t('container.cleanBuildCache') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="php-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
<el-table-column
Expand Down Expand Up @@ -101,15 +99,15 @@
<Log ref="logRef" @close="search" :heightDiff="280" />
<Extensions ref="extensionsRef" @close="search" />
<AppResources ref="checkRef" @close="search" />
<ExtManagement ref="extManagementRef" @close="search" />
<ExtManagement ref="extManagementRef" />
<ComposeLogs ref="composeLogRef" />
<Config ref="configRef" />
<Supervisor ref="supervisorRef" />
</div>
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { DeleteRuntime, OperateRuntime, RuntimeDeleteCheck, SearchRuntimes } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand Down Expand Up @@ -146,7 +144,6 @@ let req = reactive<Runtime.RuntimeReq>({
pageSize: 40,
type: 'php',
});
let timer: NodeJS.Timer | null = null;
const opRef = ref();
const logRef = ref();
const extensionsRef = ref();
Expand Down Expand Up @@ -265,7 +262,7 @@ const openLog = (row: Runtime.RuntimeDTO) => {
if (row.status == 'Running') {
composeLogRef.value.acceptParams({ compose: row.path + '/docker-compose.yml', resource: row.name });
} else {
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'building', heightDiff: 220 });
logRef.value.acceptParams({ id: row.id, type: 'php', tail: row.status == 'Building', heightDiff: 220 });
}
};

Expand Down Expand Up @@ -348,14 +345,6 @@ const onOpenBuildCache = () => {

onMounted(() => {
search();
timer = setInterval(() => {
search();
}, 10000 * 1);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided JavaScript/TypeScript code contains several potential issues and areas for improvement:

  1. Deprecated Code: The variable timer is declared as an integer (NodeJS.Timer | null) but assigned a string value when starting the interval, which can lead to errors.

  2. Variable Naming Convention: Variables like opRef, logRef, etc., should be consistent with CamelCase convention to follow Vue.js best practices.

  3. Function Calls: There are several function calls that seem unnecessary. For instance, calling SearchRuntimes unnecessarily after a runtime has been updated could impact performance.

  4. Comments and Descriptions: Comments explaining variables and functionalities enhance readability and maintainability.

  5. Code Organization: Ensure that imports and exports are organized clearly within the script block instead of outside it.

Here's the revised version of the code incorporating these improvements:

// Define dependencies at the top of the file
import { onMounted, reactive, ref } from "vue";
import { Runtime } from "@/api/interface/runtime";
import { DeleteRuntime, OperateRuntime, RuntimeDeleteCheck, SearchRuntimes } from "@/api/modules/runtime";
import { dateFormat } from "@/utils/util";

interface PaginationConfig {
  // Define pagination configuration interface here
}

export default defineComponent({
  components: {
    RouterMenu,
    LayoutContent,
    ElAlert, // Assuming you have these imported somewhere
    ElButton, // Assuming you have these imported somewhere
    ComplexTable, // Assuming you have this imported somewhere
    TableRefresh,
    ExtManagement, // Assuming you haven't used any external library for table settings
    ComposeLogs,
    Config,
    Supervisor,
  },

  setup() {
    const loading = ref(false); // Initialize loading state

    const items = reactive([]); // Reactively hold data
    const paginationConfig: PaginationConfig = {}; // Initialize pagination config object

    const req = reactive<Runtime.RuntimeReq>({
      keyword: "",
      startTime: undefined,
      endTime: undefined,
      currentPage: 1,
      pageSize: 40,
      type: "php",
    });

    let timerId: ReturnType<typeof setInterval> | null = null;

    const opRef = ref();
    const logRef = ref();
    const extensionsRef = ref();
    const extManagementRef = ref(); // Corrected component reference
    const composeLogRef = ref();
    const configRef = ref();
    const supervisorRef = ref();

    const openLog = (row: Runtime.RuntimeDTO) => {
      if (row.status === "Running") {
        composeLogRef.value.acceptParams({ compose: row.path + "/docker-compose.yml", resource: row.name });
      } else if (row.status === "Pending") {
      } else {
        logRef.value.acceptParams({ id: row.id, type: "php", tail: false, heightDiff: 220 }); // Updated tail status condition
      }
    };

    const onOpenBuildCache = async () => {
      try {
        await OnOperateAsync(Runtime.DELETE_CACHES);
        alert("Operation successful!");
       } catch (error) {
        console.error("Failed to delete build cache:", error);
       }
     };

    const search = () => {
      // Call SearchRuntimes and update logic here based on response
      // Example:
      SearchRuntimes(req).then(response => {
        items.data = response.runtimes;
        items.total = response.count; // Update total count if available
      }).catch(error => {
        console.error("Error fetching runtimes:", error);
      });
    };

    const initPolling = () => {
      if (!timerId) {
        timerId = setInterval(search, 10000 * 1); // No need to convert number to string
      }
    };

    const stopPolling = () => {
      if (timerId !== null) {
        clearInterval(Number(timerId)); // Convert to number before clearing
        timerId = null;
      }
    };

    onMounted(() => {
      initPolling();
      search(); // Initial load
    });

    onUnmounted(() => {
      stopPolling();
    });

    return {
      loading,
      items,
      search,
      openLog,
      onOpenBuildCache,
      paginationConfig,
      opRef,
      logRef,
      extensionsRef,
      extManagementRef,
      composeLogRef,
      configRef,
      supervisorRef,
    };
  },
});

These changes address the identified issues while maintaining good coding standards and functionality. Please note that I've assumed certain functions and components exist based on comments in the original snippet. Adjust them according to your actual project structure and requirements.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code provided appears to be an update to a web component's Vue template and script sections, likely for managing PHP runtime configurations. Here are some observations:

Potential Issues and Recommendations:

  1. Missing Imports:

    • Ensure that all components (TableRefresh, TableSetting) used in templates are imported at the top of the file.
  2. Dynamic Content:

    • The dynamic content within the <template> tags is slightly inconsistent between .prompt and other areas:
      <!-- Left toolbar -->
      <el-button type="primary" @click="openCreate">
        ... {{ $t('runtime.create') }} ...
      </el-button>
      
      <!-- Right toolbar -->
      <Button icon="refresh" class-name="table-operation-btn">{{ $t('container.refreshCache') }}</button>
  3. Typographical Errors and Consistency:

    • In right tool bar buttons, consider using consistent icons or removing them if not necessary.

      <Button icon="refresh" class-name="table-operation-btn">... {{ $t('container.refreshCache') }}...</button> // Possibly remove "..." after refresh?
    • For alignment in right tool bars, use padding styles consistently:

      .table-toolbar-right button {
          margin-left: 5px; /* Add this */
      }
  4. Timer and Unsubscribe Management:

    • There seems to be no need to clear a timer automatically when unmounting the component since it is done explicitly in the onUnmounted() method. This can be removed unless there are specific conditions where you might want to restart the interval.

    • Alternatively, keep auto-search functionality using a setInterval but ensure it has a proper mechanism to stop it cleanly upon component destruction.

  5. Code Cleanup:

    • Remove redundant comments like these before each template area:
      /* prompt */ 
      /*
       * leftToolBar
       *
       *
      */
      
   These comments don't add value and increase clutter so they should be either removed or replaced with more descriptive explanations if needed.

Overall, make sure that components used in the `<template>` section have been properly declared at the start. Clean up unnecessary comments and align styles appropriately to enhance readability.

Expand Down
16 changes: 5 additions & 11 deletions frontend/src/views/website/runtime/python/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
{{ $t('runtime.create') }}
</el-button>
</template>
<template #rightToolBar>
<TableRefresh @search="search()" />
<TableSetting title="python-runtime-refresh" @search="search()" />
</template>
<template #main>
<ComplexTable :pagination-config="paginationConfig" :data="items" @search="search()" :heightDiff="350">
<el-table-column
Expand Down Expand Up @@ -87,7 +91,7 @@
</template>

<script setup lang="ts">
import { onMounted, onUnmounted, reactive, ref } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import { Runtime } from '@/api/interface/runtime';
import { OperateRuntime, RuntimeDeleteCheck, SearchRuntimes, SyncRuntime } from '@/api/modules/runtime';
import { dateFormat } from '@/utils/util';
Expand All @@ -109,7 +113,6 @@ const mobile = computed(() => {
return globalStore.isMobile();
});

let timer: NodeJS.Timer | null = null;
const loading = ref(false);
const items = ref<Runtime.RuntimeDTO[]>([]);
const operateRef = ref();
Expand Down Expand Up @@ -249,15 +252,6 @@ const toFolder = (folder: string) => {
onMounted(() => {
sync();
search();
timer = setInterval(() => {
search();
sync();
}, 1000 * 10);
});

onUnmounted(() => {
clearInterval(Number(timer));
timer = null;
});
</script>

Expand Down
Loading