File tree Expand file tree Collapse file tree
frontend/src/pages/instance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,34 +234,33 @@ export default {
234234 }
235235 },
236236 watch: {
237- ' instance.id ' : function (old , news ) {
238- this .loadLogs ()
239- this .getUpdateSchedule (this .instance .id )
237+ instance: {
238+ handler : function (instance ) {
239+ if (instance) {
240+ this .loadLogs ()
241+ this .getUpdateSchedule (instance .id )
242+ }
243+ },
244+ immediate: true
240245 }
241246 },
242- mounted () {
243- this .loadLogs ()
244- this .getUpdateSchedule (this .instance .id )
245- },
246247 methods: {
247248 openUrl () {
248249 this .openInANewTab (this .instance .url , ` _${ this .instance .id } ` )
249250 },
250251 loadLogs () {
251- if (this .instance && this .instance .id ) {
252- this .loading = true
253- this .loadItems (this .instance .id )
254- .then ((data ) => {
255- this .auditLog = data .log
256- })
257- .catch ((error ) => {
258- console .error (' Error loading logs:' , error)
259- this .auditLog = []
260- })
261- .finally (() => {
262- this .loading = false
263- })
264- }
252+ this .loading = true
253+ this .loadItems (this .instance .id )
254+ .then ((data ) => {
255+ this .auditLog = data .log
256+ })
257+ .catch ((error ) => {
258+ console .error (' Error loading logs:' , error)
259+ this .auditLog = []
260+ })
261+ .finally (() => {
262+ this .loading = false
263+ })
265264 },
266265 loadItems : async function (instanceId , cursor ) {
267266 return await InstanceApi .getInstanceAuditLog (instanceId, null , cursor, 4 )
You can’t perform that action at this time.
0 commit comments