8080</template >
8181
8282<script setup>
83- var timestamp = new Date ().getTime ()
84-
85- import { inject , onMounted , ref , watch } from ' vue'
83+ import { EnumSoftwareType } from ' @/shared/utils/enum'
84+ import { inject , onMounted , ref , watch } from ' vue'
8685import { useMainStore } from ' @/renderer/store'
8786import GetPath from ' @/shared/utils/GetPath'
8887import GetAppPath from ' @/main/utils/GetAppPath'
@@ -92,7 +91,7 @@ import MessageBox from '@/renderer/utils/MessageBox'
9291import { storeToRefs } from ' pinia/dist/pinia'
9392import { APP_NAME } from ' @/shared/utils/constant'
9493import Native from ' @/main/utils/Native'
95- import { sleep } from ' @/shared/utils/utils'
94+ import { enumGetName , sleep } from ' @/shared/utils/utils'
9695import Path from ' @/main/utils/Path'
9796import ProcessExtend from ' @/main/utils/ProcessExtend'
9897import Settings from ' @/main/Settings'
@@ -102,6 +101,8 @@ import { isWindows } from '@/main/utils/utils'
102101import { createAsyncComponent } from ' @/renderer/utils/utils'
103102import { mt , t } from ' @/renderer/utils/i18n'
104103
104+ var timestamp = new Date ().getTime ()
105+
105106const serverTableLoading = ref (false )
106107const { serverReactive } = inject (' GlobalProvide' )
107108serverReactive .restartFn = restartFn
@@ -133,16 +134,20 @@ const columns = [
133134 }
134135]
135136
137+ const serverList = ref ([])
136138const store = useMainStore ()
137- const { softwareList , serverList , afterOpenAppStartServerMark } = storeToRefs (store)
139+ const { softwareList , afterOpenAppStartServerMark } = storeToRefs (store)
140+
141+ watch (softwareList, () => {
142+ serverList .value = getServerList ()
143+ }, { immediate: true , deep: 2 })
144+
138145onMounted (async () => {
139146 var timestamp2 = new Date ().getTime ()
140147 console .log (' home onMounted' , timestamp2 - timestamp)
141148
142- if (softwareList? .value ? .length > 0 ) await store .refreshServerList ()
143149 if (serverList? .value ? .length > 0 ) {
144150 serverTableLoading .value = { tip: ` ${ t (' RefreshingServer' )} ...` }
145- console .log (' softwareList' , softwareList)
146151 await initServerListStatus ()
147152 serverTableLoading .value = false
148153 }
@@ -153,6 +158,14 @@ onMounted(async () => {
153158 }
154159})
155160
161+ function getServerList () {
162+ const phpTypeName = enumGetName (EnumSoftwareType, EnumSoftwareType .PHP )
163+ const serverTypeName = enumGetName (EnumSoftwareType, EnumSoftwareType .Server )
164+ const typeArr = [phpTypeName, serverTypeName]
165+
166+ return softwareList .value .filter (item => typeArr .includes (item .Type ) && item .Installed )
167+ }
168+
156169const getProcessList = async () => {
157170 let list
158171 const options = { directory: GetPath .getSoftwareDir () }
0 commit comments