2424 class =" px-4 py-2 rounded hover:bg-gray-600"
2525 >
2626 Edit Service Config
27- </button >
27+ </button >
2828 <button
2929 v-if =" hasServiceLogs"
3030 @click =" () => { fetchLogs(); showLogsView = true; }"
4242 <!-- Logs View with Filters -->
4343 <div v-if =" showLogsView" class =" log-container" >
4444 <div class =" log-header flex justify-between items-center w-full" >
45- <h3 >Logs for {{ currentService.process_name }}</h3 >
45+ <h3 >Logs for {{ currentService.process_name }}</h3 >
4646 <!-- Filters and Actions -->
4747 <div class =" flex gap-2" >
4848 <input
162162
163163
164164<script >
165- import useService from " @/composables /useService" ;
165+ import useService from " ~/services /useService.js " ;
166166import { performServiceAction } from " @/composables/serviceActions" ;
167167
168168export default {
@@ -185,8 +185,8 @@ export default {
185185 selectedLog: " " ,
186186 showLogsView: false ,
187187 logFilterText: " " ,
188- logLevelFilter: " " ,
189- logLimit: 1000 ,
188+ logLevelFilter: " " ,
189+ logLimit: 1000 ,
190190 };
191191 },
192192 async mounted () {
@@ -228,11 +228,11 @@ export default {
228228 this .loading = true ;
229229 this .hasServiceConfig = false ;
230230 this .hasServiceLogs = false ;
231- this .selectedLog = " " ;
231+ this .selectedLog = " " ;
232232 try {
233- const { fetchProcesses , fetchProcessStatus } = useService ();
233+ const { processService } = useService ()
234234 const serviceId = this .$route .params .serviceId ;
235- const services = await fetchProcesses ();
235+ const services = await processService . fetchProcesses ();
236236 this .currentService =
237237 services .find ((service ) => service .process_name === serviceId) || {};
238238 const serviceWithConfig = this .currentService .config && this .currentService .config .config_file ;
@@ -242,8 +242,8 @@ export default {
242242 this .editableConfig = this .currentService .config_raw || JSON .stringify (this .currentService .config , null , 2 );
243243 this .configFormat = " json" ;
244244 const logsExist = await this .checkLogsAvailability (this .currentService .process_name );
245- this .hasServiceLogs = logsExist;
246- this .serviceStatus = await fetchProcessStatus (this .currentService .process_name );
245+ this .hasServiceLogs = logsExist;
246+ this .serviceStatus = await processService . fetchProcessStatus (this .currentService .process_name );
247247 this .updateLineCount ();
248248 } catch (error) {
249249 console .error (" Failed to load DMB config:" , error);
@@ -259,9 +259,9 @@ export default {
259259 this .errorMessage = " " ;
260260 this .loading = true ;
261261 try {
262- const { fetchServiceConfig } = useService ();
262+ const { configService } = useService ()
263263 const serviceId = this .$route .params .serviceId ;
264- const serviceConfig = await fetchServiceConfig (serviceId);
264+ const serviceConfig = await configService . fetchServiceConfig (serviceId);
265265 const configMapping = {
266266 yaml : () => serviceConfig .raw ,
267267 json : () => JSON .stringify (serviceConfig .config , null , 2 ),
@@ -287,8 +287,8 @@ export default {
287287 },
288288 async checkLogsAvailability (serviceName ) {
289289 try {
290- const { fetchServiceLogs } = useService ();
291- const logs = await fetchServiceLogs (serviceName);
290+ const { logsService } = useService ()
291+ const logs = await logsService . fetchServiceLogs (serviceName);
292292 if (! logs || logs .trim () === " " || logs .includes (" No logs" )){
293293 return false ;
294294 }
@@ -302,8 +302,8 @@ export default {
302302 if (! this .currentService .process_name ) return ;
303303
304304 try {
305- const { fetchServiceLogs } = useService ();
306- this .selectedLog = await fetchServiceLogs (this .currentService .process_name );
305+ const { logsService } = useService ()
306+ this .selectedLog = await logsService . fetchServiceLogs (this .currentService .process_name );
307307 this .showLogsView = true ;
308308
309309 this .$nextTick (() => {
@@ -323,20 +323,20 @@ export default {
323323 link .href = URL .createObjectURL (blob);
324324 link .download = ` logs_${ this .currentService .process_name } .log` ;
325325 link .click ();
326- },
326+ },
327327 async updateConfig (persist ) {
328328 this .isProcessing = true ;
329329 this .persisting = persist;
330330 this .successMessage = " " ;
331331 this .errorMessage = " " ;
332332 try {
333- const { updateDMBConfig , updateServiceConfig } = useService ();
333+ const { configService } = useService ()
334334 if (this .isDMBConfig ) {
335335 const configToSend =
336336 this .configFormat === " json" ? JSON .parse (this .editableConfig ) : this .editableConfig ;
337- await updateDMBConfig (this .currentService .process_name , configToSend, persist);
337+ await configService . updateDMBConfig (this .currentService .process_name , configToSend, persist);
338338 } else {
339- await updateServiceConfig (
339+ await configService . updateServiceConfig (
340340 this .currentService .process_name ,
341341 this .editableConfig ,
342342 this .configFormat
0 commit comments