add config item

This commit is contained in:
2024-02-26 12:31:58 +01:00
parent 13096ce679
commit 49fb1ef397
15 changed files with 940 additions and 69 deletions

View File

@ -4,18 +4,52 @@ const store = createStore({
state() {
return {
assetEditable: false,
assetFiltered: false,
assetSearchable: false,
deleteAsset: false,
onAssetlist: true,
onCustomerAssetlist: false,
onAsset: false,
onSolutionlistAsset: false,
chosenAssetId: -1
chosenAssetId: -1,
filteredAssetbyClient: '',
newAsset: false,
newAssetName: '',
newCustomerID: '',
newCustomer: '',
newLocation: '',
newRemoteLocation: '',
newType: '',
newDescription: '',
newNotes: '',
newState: '',
newLastView: '',
newUser: '',
hardwareBool: false,
newModel: '',
newSerialnumber: '',
newCPU: '',
newRAM: '',
newStorageConfiguration: '',
newMiscellaneous: '',
softwareBool: false,
newSoftware: '',
newVersion: '',
newLicense: '',
};
},
mutations: {
toggleEditableAsset(state) {
state.assetEditable = !state.assetEditable
},
toggleFilteredAsset(state) {
if (state.assetFiltered == false) {
state.assetFiltered = true
state.assetSearchable = false
} else {
state.assetFiltered = false
}
},
changeToAssetlist(state) {
state.onAssetlist = true
state.onCustomerAssetlist = false
@ -44,14 +78,89 @@ const store = createStore({
state.chosenAssetId = id
},
resetAssetStore(state) {
state.chosenAssetId = -1
state.assetEditable = false
state.assetFiltered = false
state.assetSearchable = false
state.deleteAsset = false
state.chosenAssetId = -1
state.filteredAssetbyClient = ''
state.newAsset = false
state.newAssetName = ''
state.newCustomerID = ''
state.newCustomer = ''
state.newLocation = ''
state.newRemoteLocation = ''
state.newType = ''
state.newDescription = ''
state.newNotes = ''
state.newState = ''
state.newLastView = ''
state.newUser = ''
state.hardwareBool = false
state.newModel = ''
state.newSerialnumber = ''
state.newCPU = ''
state.newRAM = ''
state.newStorageConfiguration = ''
state.newMiscellaneous = ''
state.softwareBool = false
state.newSoftware = ''
state.newVersion = ''
state.newLicense = ''
},
doDeleteAsset(state) {
state.deleteAsset = true
},
undoDeleteAsset(state) {
state.deleteAsset = false
},
updateAssetFilterbyClient(state, client) {
state.filteredAssetbyClient = client
},
toggleAssetSearchable(state) {
if (state.assetSearchable == false) {
state.assetSearchable = true
state.assetFiltered = false
} else {
state.assetSearchable = false
}
state.filteredAssetbyClient = ''
},
addNewAsset(state) {
state.newAsset = true
state.assetEditable = false
state.assetFiltered = false
state.assetSearchable = false
state.onAssetlist = false
state.onCustomerAssetlist = false
state.onAsset = true
state.onSolutionlistAsset = false
},
updateAssetComponent(state, asset) {
state.newAssetName = asset.assetName
state.newCustomerID = asset.customerId
state.newCustomer = asset.customer
state.newLocation = asset.location
state.newRemoteLocation = asset.remoteLocation
state.newType = asset.type
state.newDescription = asset.description
state.newNotes = asset.notes
state.newState = asset.state
},
updateHardwareComponent(state, asset) {
state.hardwareBool = asset.hardwareBool
state.newModel = asset.model
state.newSerialnumber = asset.serialnumber
state.newCPU = asset.CPU
state.newRAM = asset.RAM
state.newStorageConfiguration = asset.storageConfig
state.newMiscellaneous = asset.miscellaneous
},
updateSoftwareComponent(state, asset) {
state.softwareBool = asset.softwareBool
state.newSoftware = asset.software
state.newVersion = asset.version
state.newLicense = asset.license
}
},
});