Compare commits
No commits in common. "0848116ff84d75ebc4c14333f5af6a2371028f5c" and "a05de0640fe3c916faf390028135a248556e5620" have entirely different histories.
0848116ff8
...
a05de0640f
7 changed files with 15 additions and 91 deletions
|
@ -12,14 +12,3 @@ def config_route():
|
||||||
config[section] = dict(config[section])
|
config[section] = dict(config[section])
|
||||||
|
|
||||||
return jsonify(config)
|
return jsonify(config)
|
||||||
|
|
||||||
@api_bp.route("/api/config/<section>/<element>/<value>")
|
|
||||||
def config_edit_route(section: str, element: str, value: str):
|
|
||||||
config = initiate_config()
|
|
||||||
|
|
||||||
config = config.app_config
|
|
||||||
config[section][element] = value
|
|
||||||
with open("data/app.ini", "w") as f:
|
|
||||||
config.write(f)
|
|
||||||
|
|
||||||
return jsonify({"result": True})
|
|
||||||
|
|
|
@ -61,7 +61,6 @@ def add_route():
|
||||||
index=int(request.json["episodeIndex"].split(".")[0]),
|
index=int(request.json["episodeIndex"].split(".")[0]),
|
||||||
correction=int(request.json["adjustedEpisodeNumber"]),
|
correction=int(request.json["adjustedEpisodeNumber"]),
|
||||||
title=request.json["dirname"],
|
title=request.json["dirname"],
|
||||||
path=request.json["filepath"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
config.args = requestData
|
config.args = requestData
|
||||||
|
|
11
app/db.py
11
app/db.py
|
@ -4,12 +4,13 @@ from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass
|
||||||
|
|
||||||
db = SQLAlchemy()
|
db = SQLAlchemy()
|
||||||
|
|
||||||
class ImagesCache(db.Model):
|
|
||||||
|
class Base(DeclarativeBase, MappedAsDataclass):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ImagesCache(Base):
|
||||||
__tablename__ = "image_cache"
|
__tablename__ = "image_cache"
|
||||||
|
|
||||||
codename: Mapped[str] = mapped_column(primary_key=True)
|
codename: Mapped[str] = mapped_column(primary_key=True)
|
||||||
image: Mapped[str] = mapped_column()
|
image: Mapped[str] = mapped_column()
|
||||||
|
|
||||||
def __init__(self, codename, image):
|
|
||||||
self.codename = codename
|
|
||||||
self.image = image
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ class RequestData:
|
||||||
correction: int = 0
|
correction: int = 0
|
||||||
title: str = ""
|
title: str = ""
|
||||||
codename: str = ""
|
codename: str = ""
|
||||||
path: str = ""
|
|
||||||
force: bool = False
|
force: bool = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
|
@ -16,7 +15,6 @@ class RequestData:
|
||||||
correction=0,
|
correction=0,
|
||||||
title="",
|
title="",
|
||||||
codename="",
|
codename="",
|
||||||
path="",
|
|
||||||
force=False,
|
force=False,
|
||||||
):
|
):
|
||||||
self.url = url
|
self.url = url
|
||||||
|
@ -25,5 +23,4 @@ class RequestData:
|
||||||
self.correction = correction
|
self.correction = correction
|
||||||
self.title = title
|
self.title = title
|
||||||
self.codename = codename
|
self.codename = codename
|
||||||
self.path = path
|
|
||||||
self.force = force
|
self.force = force
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
<dialog :class="{ 'active': Object.keys(editFormData).length > 0 }">
|
<dialog class="active" v-if="Object.keys(editFormData).length > 0">
|
||||||
<h5 class="primary-text">Редагування</h5>
|
<h5 class="primary-text">Редагування</h5>
|
||||||
<form @submit.prevent="editTitle" class="grid">
|
<form @submit.prevent="editTitle" class="grid">
|
||||||
<div class="field label prefix border s12">
|
<div class="field label prefix border s12">
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<article class="primary-text">
|
<article class="primary-text">
|
||||||
<a class="row wave" @click="openDialog('login')">
|
<a class="row wave">
|
||||||
<i>person</i>
|
<i>person</i>
|
||||||
<div class="max">
|
<div class="max">
|
||||||
<h6 class="small">Логін</h6>
|
<h6 class="small">Логін</h6>
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<a class="row wave" @click="openDialog('password')">
|
<a class="row wave">
|
||||||
<i>password</i>
|
<i>password</i>
|
||||||
<div class="max">
|
<div class="max">
|
||||||
<h6 class="small">Пароль</h6>
|
<h6 class="small">Пароль</h6>
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<a class="row wave" @click="openDialog('hub')">
|
<a class="row wave">
|
||||||
<i>hub</i>
|
<i>hub</i>
|
||||||
<div class="max">
|
<div class="max">
|
||||||
<h6 class="small">Торрент клієнт</h6>
|
<h6 class="small">Торрент клієнт</h6>
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<a class="row wave" @click="openDialog('directory')">
|
<a class="row wave">
|
||||||
<i>description</i>
|
<i>description</i>
|
||||||
<div class="max">
|
<div class="max">
|
||||||
<h6 class="small">Директорія завантажень</h6>
|
<h6 class="small">Директорія завантажень</h6>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<hr>
|
<hr>
|
||||||
<a class="row wave" @click="openDialog('delay')">
|
<a class="row wave">
|
||||||
<i>hourglass_top</i>
|
<i>hourglass_top</i>
|
||||||
<div class="max">
|
<div class="max">
|
||||||
<h6 class="small">Затримка</h6>
|
<h6 class="small">Затримка</h6>
|
||||||
|
@ -62,24 +62,6 @@
|
||||||
<hr>
|
<hr>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<dialog :class="{ 'active': isDialogOpen }">
|
|
||||||
<h5 class="primary-text">Редагування</h5>
|
|
||||||
<form @submit.prevent="editTitle" class="grid">
|
|
||||||
<div class="field label prefix border s12">
|
|
||||||
<i>folder</i>
|
|
||||||
<input type="text" v-model="dialogValue" placeholder="Назва директорії" required />
|
|
||||||
<label>Назва директорії</label>
|
|
||||||
</div>
|
|
||||||
<nav class="right-align small-padding s12">
|
|
||||||
<button class="border small-round" @click="closeDialog">
|
|
||||||
<i>cancel</i>
|
|
||||||
</button>
|
|
||||||
<button class="border small-round" type="submit">
|
|
||||||
<i>edit</i>
|
|
||||||
</button>
|
|
||||||
</nav>
|
|
||||||
</form>
|
|
||||||
</dialog>
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -88,9 +70,6 @@ import axios from 'axios';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isDialogOpen: false,
|
|
||||||
dialogValue: '',
|
|
||||||
currentField: ''
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -98,50 +77,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
goBack() {
|
|
||||||
this.$router.back();
|
|
||||||
},
|
|
||||||
openDialog(field) {
|
|
||||||
this.currentField = field;
|
|
||||||
this.dialogValue = field; // очищаем значение при открытии диалога
|
|
||||||
this.isDialogOpen = true;
|
|
||||||
},
|
|
||||||
closeDialog() {
|
|
||||||
this.isDialogOpen = false;
|
|
||||||
},
|
|
||||||
async editTitle() {
|
|
||||||
try {
|
|
||||||
// Здесь можно установить URL вашего API
|
|
||||||
const response = await fetch(`https://your-api-endpoint/${this.currentField}`, {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
value: this.dialogValue
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.ok) {
|
|
||||||
throw new Error('Network response was not ok');
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await response.json();
|
|
||||||
// Обработка ответа сервера (если необходимо)
|
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
this.closeDialog();
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Ошибка:', error);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
goBack() {
|
goBack() {
|
||||||
this.$router.back();
|
this.$router.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
|
@ -1 +1 @@
|
||||||
{"root":["./src/main.ts","./src/vite-env.d.ts","./src/App.vue","./src/components/Navbar.vue","./src/pages/about.vue","./src/pages/add.vue","./src/pages/index.vue","./src/pages/settings/account.vue","./src/pages/settings/bittorrent.vue","./src/pages/settings/debug.vue","./src/pages/settings/index.vue","./src/pages/settings/palette.vue"],"version":"5.6.2"}
|
{"root":["./src/main.ts","./src/vite-env.d.ts","./src/App.vue","./src/components/Navbar.vue","./src/pages/index.vue"],"version":"5.6.2"}
|
Loading…
Reference in a new issue