[FEAT] Move Legacy code into a legacy directory

This commit is contained in:
NADAL Jean-Baptiste
2026-02-13 10:44:51 +01:00
parent bfb703e6b9
commit 5066e1d54f
142 changed files with 194 additions and 0 deletions

23
legacy/frontend/score/.gitignore vendored Normal file
View File

@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -0,0 +1,24 @@
# score
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

View File

@@ -0,0 +1,5 @@
module.exports = {
"presets": [
"@vue/cli-plugin-babel/preset"
]
}

12094
legacy/frontend/score/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
{
"name": "score",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.0",
"bootstrap-vue": "^2.17.3",
"core-js": "^3.6.5",
"vue": "^2.6.11"
},
"devDependencies": {
"@babel/polyfill": "^7.11.5",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"bootstrap": "^4.5.2",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"mutationobserver-shim": "^0.3.7",
"popper.js": "^1.16.1",
"portal-vue": "^2.1.7",
"sass": "^1.26.11",
"sass-loader": "^10.0.2",
"vue-cli-plugin-bootstrap-vue": "~0.7.0",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -0,0 +1,111 @@
<template>
<b-container>
<div v-if="loading == true" class="text-center">
<b-spinner variant="primary" label="Chargement...."></b-spinner>
</div>
<div v-if="selected == 0">
<h1>Partitions</h1>
<br/>
<b-table selectable select-mode="single" striped hover
:fields="fields" :items="items"
@row-selected="onRowSelected">
</b-table>
</div>
<div v-if="selected > 0">
<br/>
<b-button variant="info" @click="clickBack" >Retour</b-button>
<br/>
<br/>
<h4 class="text-center"> {{selectedItem.compositor}} - {{selectedItem.name}}</h4>
<br/>
<b-card-group deck v-for="(instrument) in selectedItem.instruments" :key="instrument.id">
<b-card :header="instrument.title">
<div v-for="(number) in instrument.number" :key="number.id" >
<p>Partie: {{number.id}}</p>
<p> Page:</p>
<b-list-group>
<b-list-group-item v-for="(page) in number.pages" :key="page.name">
<b-container class="bv-example-row">
<b-row>
<b-col>{{page.name}}</b-col>
<b-col></b-col>
<b-col><b-button class="btn" style="width:100%" :href="page.uri" target="_blank"><b-icon icon="download"></b-icon></b-button></b-col>
</b-row>
</b-container>
</b-list-group-item>
</b-list-group>
</div>
<br/>
</b-card>
</b-card-group>
<br/>
</div>
</b-container>
</template>
<script>
import axios from "axios";
export default {
name: "App",
data() {
return {
loading: true,
selected: '0',
fields: [
{ key: 'id', label: 'Numéro' },
{ key: 'name', label: 'Nom' },
{ key: 'compositor', label: 'Compositeur' },
],
items: [],
selectedItem: {}
};
},
methods: {
async fetchList () {
try{
let response = await axios.get('http://ohmj2.free.fr/legacy/api/score/read.php')
this.items = response.data.scores;
this.loading = false
}catch(error) {
console.log(error);
}
},
async fetchScore (id) {
try{
let response = await axios.get('http://ohmj2.free.fr/legacy/api/score/read.php?id='+id)
this.selectedItem = response.data;
this.loading = false
console.log('item: ', this.selectedItem)
}catch(error) {
console.log(error);
}
},
async onRowSelected(items) {
this.loading = true
this.selected = items[0].id
window.scrollTo(0,0);
await this.fetchScore(this.selected)
},
clickBack(){
this.selected = 0;
}
},
async mounted() {
let uri = window.location.search.substring(1)
let params = new URLSearchParams(uri)
console.log(params.get("id"))
let id = params.get("id")
if (id === null) {
await this.fetchList()
} else {
this.selected = id
window.scrollTo(0,0);
await this.fetchScore(this.selected)
}
},
};
</script>
<style>
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -0,0 +1,11 @@
import '@babel/polyfill'
import 'mutationobserver-shim'
import Vue from 'vue'
import './plugins/bootstrap-vue'
import App from './App.vue'
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')

View File

@@ -0,0 +1,9 @@
import Vue from 'vue'
import { BootstrapVue, BootstrapVueIcons } from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
import 'bootstrap-vue/dist/bootstrap-vue-icons.min.css'
Vue.use(BootstrapVue)
Vue.use(BootstrapVueIcons)

View File

@@ -0,0 +1,3 @@
module.exports = {
publicPath: '/score/'
}