Skip to content

Commit e2f6fa5

Browse files
committed
👌 IMPROVE: Remove outdated code
1 parent f90ec83 commit e2f6fa5

File tree

1 file changed

+0
-128
lines changed

1 file changed

+0
-128
lines changed

templates/core.php

Lines changed: 0 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -8685,24 +8685,17 @@ class="mt-5"
86858685
selected_site: {},
86868686
active_console: 0,
86878687
view_console: { show: false, open: false },
8688-
view_timeline: false,
86898688
search: null,
86908689
users_search: "",
8691-
advanced_filter: false,
86928690
sites_selected: [],
8693-
sites_filtered: [],
8694-
site_selected: null,
86958691
filter_logic: "and",
86968692
filter_version_logic: "and",
86978693
filter_status_logic: "and",
86988694
site_filters: <?php echo json_encode( ( new CaptainCore\Environments )->filters() ); ?>,
86998695
site_filter_version: null,
87008696
site_filter_status: null,
8701-
sort_direction: "asc",
87028697
toggle_site: true,
87038698
toggle_plan: true,
8704-
toggle_site_sort: null,
8705-
toggle_site_counter: { key: "", count: 0 },
87068699
countries: wc_countries,
87078700
states: wc_states,
87088701
states_selected: [],
@@ -8724,14 +8717,6 @@ class="mt-5"
87248717
{ title: 'Status', value: 'status', width: "100px" },
87258718
{ title: 'Actions', value: 'actions', width: "90px", sortable: false }
87268719
],
8727-
header_updatelog: [
8728-
{ title: 'Date', value: 'date' },
8729-
{ title: 'Type', value: 'type' },
8730-
{ title: 'Name', value: 'name' },
8731-
{ title: 'Old Version', value: 'old_version' },
8732-
{ title: 'New Version', value: 'new_version' },
8733-
{ title: 'Status', value: 'status' }
8734-
],
87358720
header_users: [
87368721
{ title: 'Login', key: 'user_login' },
87378722
{ title: 'Display Name', key: 'display_name' },
@@ -9638,10 +9623,6 @@ class="mt-5"
96389623
this.viewSnapshots()
96399624
}
96409625
},
9641-
clearFilters() {
9642-
this.applied_site_filter = []
9643-
this.filterSites()
9644-
},
96459626
closeVersionFilter(index) {
96469627
this.$nextTick(() => {
96479628
if (this.$refs.versionFilterRefs && this.$refs.versionFilterRefs[index]) {
@@ -9726,43 +9707,6 @@ class="mt-5"
97269707
}
97279708
return response
97289709
},
9729-
compare(key, order='asc') {
9730-
return function(a, b) {
9731-
//if(!a.hasOwnProperty(key) || !b.hasOwnProperty(key)) {
9732-
// // property doesn't exist on either object
9733-
// return 0;
9734-
//}
9735-
if ( key == 'name' ) {
9736-
varA = a.name || "";
9737-
varB = b.name || "";
9738-
}
9739-
if ( key == 'multisite' ) {
9740-
varA = parseInt(a.subsite_count) || 0;
9741-
varB = parseInt(b.subsite_count) || 0;
9742-
}
9743-
if ( key == 'visits' ) {
9744-
varA = parseInt(a[key].replace(/\,/g,'')) || 0;
9745-
varB = parseInt(b[key].replace(/\,/g,'')) || 0;
9746-
}
9747-
if ( key == 'storage' ) {
9748-
varA = parseInt(a.storage) || 0;
9749-
varB = parseInt(b.storage) || 0;
9750-
}
9751-
if ( key == 'provider' ) {
9752-
varA = a.provider || "";
9753-
varB = b.provider || "";
9754-
}
9755-
let comparison = 0;
9756-
if (varA > varB) {
9757-
comparison = 1;
9758-
} else if (varA < varB) {
9759-
comparison = -1;
9760-
}
9761-
return (
9762-
(order == 'desc') ? (comparison * -1) : comparison
9763-
);
9764-
};
9765-
},
97669710
resetColors() {
97679711
this.currentThemeColors = {
97689712
primary: '#1976D2',
@@ -9964,25 +9908,6 @@ class="mt-5"
99649908
this.view_console.open = false
99659909
this.active_console = 0
99669910
},
9967-
siteSearch(value, search, item) {
9968-
const searchLower = search?.toString().toLowerCase() ?? '';
9969-
if (searchLower === '') {
9970-
return true; // Match all items if search is empty
9971-
}
9972-
9973-
const valueString = value?.toString().toLowerCase() ?? '';
9974-
const valueMatch = valueString.includes(searchLower);
9975-
const usernameString = item?.username?.toString().toLowerCase() ?? '';
9976-
const usernameMatch = usernameString.includes(searchLower);
9977-
return valueMatch || usernameMatch;
9978-
9979-
return value != null &&
9980-
search != null &&
9981-
value.toString().includes(search) || item.username.toString().includes(search)
9982-
},
9983-
removeFromBulk( site_id ) {
9984-
this.sites_selected = this.sites_selected.filter(site => site.site_id != site_id);
9985-
},
99869911
magicLoginSite( site_id, user ) {
99879912
// Adds new job
99889913
job_id = Math.round((new Date()).getTime());
@@ -10212,11 +10137,6 @@ class="mt-5"
1021210137
this.dialog_new_site_kinsta.verifing = false
1021310138
});
1021410139
},
10215-
showNewSiteDialog() {
10216-
this.dialog_new_site_kinsta.verifing = true
10217-
this.dialog_new_site_kinsta.connection_verified = false
10218-
this.dialog_new_site_kinsta.show = true
10219-
},
1022010140
showNewSiteKinsta() {
1022110141
this.dialog_new_site_kinsta.verifing = false
1022210142
this.dialog_new_site_kinsta.connection_verified = true
@@ -11021,32 +10941,6 @@ class="mt-5"
1102110941
})
1102210942
this.states_selected = states_selected
1102310943
},
11024-
fetchFilteredSites() {
11025-
const themes = this.applied_theme_filters;
11026-
const plugins = this.applied_plugin_filters;
11027-
// Map the version and status objects to just their names, which the backend likely expects.
11028-
const versions = this.applied_site_filter_version.map(v => v.name);
11029-
const statuses = this.applied_site_filter_status.map(s => s.name);
11030-
11031-
axios.post(
11032-
`/wp-json/captaincore/v1/filters`, {
11033-
themes,
11034-
plugins,
11035-
versions,
11036-
statuses
11037-
}, {
11038-
headers: {'X-WP-Nonce': this.wp_nonce}
11039-
})
11040-
.then(response => {
11041-
const sites_filtered_by_backend = new Set(response.data.sites);
11042-
this.sites.forEach(s => {
11043-
s.filtered = sites_filtered_by_backend.has(s.site);
11044-
});
11045-
})
11046-
.catch(error => {
11047-
console.error("Error fetching filtered sites:", error);
11048-
});
11049-
},
1105010944
fetchSites() {
1105110945
this.sites_loading = false
1105210946
if (( this.role == 'administrator' || this.role == 'owner' ) && this.keys.length == 0 ) {
@@ -11204,17 +11098,6 @@ class="mt-5"
1120411098
})
1120511099
})
1120611100
},
11207-
argumentsForActions() {
11208-
arguments = [];
11209-
this.select_bulk_action.forEach(action => {
11210-
this.bulk_actions.filter(bulk_action => bulk_action.value == action).forEach(filtered_action => {
11211-
if ( filtered_action.arguments ) {
11212-
filtered_action.arguments.forEach(argument => arguments.push({ name: argument.name, value: argument.value, command: action }) );
11213-
}
11214-
});
11215-
});
11216-
this.select_bulk_action_arguments = arguments;
11217-
},
1121811101
bulkEdit ( site_id, type ) {
1121911102
this.bulk_edit.show = true;
1122011103
site = this.dialog_site.site
@@ -16129,11 +16012,6 @@ class="mt-5"
1612916012
});
1613016013

1613116014
},
16132-
themeAndPluginChecks( site_id ) {
16133-
site = this.dialog_site.site
16134-
this.dialog_theme_and_plugin_checks.site = site;
16135-
this.dialog_theme_and_plugin_checks.show = true;
16136-
},
1613716015
killCommand( job_id ) {
1613816016
job = this.jobs.filter(job => job.job_id == job_id)[0]
1613916017
job.conn.send( '{ "token" : "'+ job.job_id +'", "action" : "kill" }' );
@@ -16909,12 +16787,6 @@ class="mt-5"
1690916787
search = quicksave.search;
1691016788
quicksave.filtered_files = quicksave.view_files.filter( file => file.includes( search ) );
1691116789
},
16912-
filteredAccounts( value ) {
16913-
if ( value ) {
16914-
return true
16915-
}
16916-
return false
16917-
},
1691816790
clearSiteFilters() {
1691916791
this.search = '';
1692016792
this.isUnassignedFilterActive = false;

0 commit comments

Comments
 (0)