6
0
فهرست منبع

renamed attribute identifier -> id

Dimitri Korsch 3 سال پیش
والد
کامیت
5fbe871c64
36فایلهای تغییر یافته به همراه140 افزوده شده و 140 حذف شده
  1. 2 2
      pycs/database/Project.py
  2. 1 1
      pycs/database/base.py
  3. 1 1
      pycs/frontend/endpoints/pipelines/FitModel.py
  4. 1 1
      pycs/frontend/endpoints/pipelines/PredictFile.py
  5. 2 2
      pycs/frontend/endpoints/pipelines/PredictModel.py
  6. 1 1
      pycs/frontend/endpoints/projects/CreateProject.py
  7. 1 1
      pycs/frontend/endpoints/projects/ExecuteExternalStorage.py
  8. 1 1
      pycs/frontend/endpoints/projects/ExecuteLabelProvider.py
  9. 3 3
      pycs/interfaces/MediaFile.py
  10. 1 1
      pycs/interfaces/MediaLabel.py
  11. 2 2
      pycs/interfaces/MediaStorage.py
  12. 2 2
      pycs/jobs/Job.py
  13. 5 5
      pycs/jobs/JobRunner.py
  14. 5 5
      test/test_database.py
  15. 2 2
      webui/src/components/base/file-input.vue
  16. 11 11
      webui/src/components/media/annotated-image.vue
  17. 6 6
      webui/src/components/media/annotation-box.vue
  18. 7 7
      webui/src/components/media/annotation-overlay.vue
  19. 3 3
      webui/src/components/media/label-selector.vue
  20. 5 5
      webui/src/components/media/media-control.vue
  21. 3 3
      webui/src/components/media/media-selector.vue
  22. 5 5
      webui/src/components/media/options-bar.vue
  23. 12 12
      webui/src/components/media/paginated-media.vue
  24. 8 8
      webui/src/components/other/LabelTreeView.vue
  25. 7 7
      webui/src/components/projects/project-creation-window.vue
  26. 10 10
      webui/src/components/projects/project-labels-window.vue
  27. 4 4
      webui/src/components/projects/project-open-window.vue
  28. 5 5
      webui/src/components/projects/project-settings-window.vue
  29. 2 2
      webui/src/components/projects/settings/external-storage-settings.vue
  30. 2 2
      webui/src/components/projects/settings/general-settings.vue
  31. 2 2
      webui/src/components/projects/settings/label-provider-settings.vue
  32. 4 4
      webui/src/components/projects/settings/model-interaction-settings.vue
  33. 3 3
      webui/src/components/window/job-window.vue
  34. 1 1
      webui/src/components/window/side-navigation-bar.vue
  35. 5 5
      webui/src/components/window/top-navigation-bar.vue
  36. 5 5
      webui/src/main.js

+ 2 - 2
pycs/database/Project.py

@@ -193,7 +193,7 @@ class Project(NamedBaseModel):
                 FROM files
                 LEFT JOIN results ON files.id = results.file
                 WHERE files.project = ? AND results.id IS NULL
-            ''', [self.identifier])
+            ''', [self.id])
             return cursor.fetchone()[0]
 
     def files_without_results(self) -> Iterator[File]:
@@ -211,7 +211,7 @@ class Project(NamedBaseModel):
                 LEFT JOIN results ON files.id = results.file
                 WHERE files.project = ? AND results.id IS NULL
                 ORDER BY id ASC
-            ''', [self.identifier])
+            ''', [self.id])
 
             for row in cursor:
                 yield File(self.database, row)

+ 1 - 1
pycs/database/base.py

@@ -25,8 +25,8 @@ class BaseModel(db.Model, ModelSerializer):
 
 
     def serialize(self) -> dict:
+        return self.to_dict()
 
-        result = self.to_dict()
         result["identifier"] = result["id"]
         return result
 

+ 1 - 1
pycs/frontend/endpoints/pipelines/FitModel.py

@@ -40,7 +40,7 @@ class FitModel(View):
                           'Model Interaction',
                           f'{project.name} (fit model with new data)',
                           f'{project.name}/model-interaction',
-                          self.load_and_fit, self.db, project.identifier)
+                          self.load_and_fit, self.db, project.id)
         except JobGroupBusyException:
             return abort(400)
 

+ 1 - 1
pycs/frontend/endpoints/pipelines/PredictFile.py

@@ -49,7 +49,7 @@ class PredictFile(View):
                           f'{project.name} (create predictions)',
                           f'{project.name}/model-interaction',
                           Predict.load_and_predict,
-                          self.db, self.pipelines, notifications, project.identifier, [file],
+                          self.db, self.pipelines, notifications, project.id, [file],
                           progress=Predict.progress)
         except JobGroupBusyException:
             return abort(400)

+ 2 - 2
pycs/frontend/endpoints/pipelines/PredictModel.py

@@ -52,7 +52,7 @@ class PredictModel(View):
                           f'{project.name}/model-interaction',
                           self.load_and_predict,
                           self.db, self.pipelines, notifications,
-                          project.identifier, data['predict'],
+                          project.id, data['predict'],
                           progress=self.progress)
         except JobGroupBusyException:
             return abort(400)
@@ -83,7 +83,7 @@ class PredictModel(View):
                     files = map(lambda f: MediaFile(f, notifications),
                                 project.files.all())
             else:
-                files = map(lambda f: MediaFile(project.file(f.identifier), notifications),
+                files = map(lambda f: MediaFile(project.file(f.id), notifications),
                             file_filter)
                 length = len(file_filter)
 

+ 1 - 1
pycs/frontend/endpoints/projects/CreateProject.py

@@ -110,7 +110,7 @@ class CreateProject(View):
         self.jobs.run(created,
                       'Media Collections',
                       f'{created.name}',
-                      f'{created.identifier}/media-collections',
+                      f'{created.id}/media-collections',
                       executable=load_model_and_get_collections,
                       result=add_collections_to_project)
 

+ 1 - 1
pycs/frontend/endpoints/projects/ExecuteExternalStorage.py

@@ -112,6 +112,6 @@ class ExecuteExternalStorage(View):
         jobs.run(project,
                  'Find Media Files',
                  project.name,
-                 f'{project.identifier}/find-files',
+                 f'{project.id}/find-files',
                  find,
                  progress=progress)

+ 1 - 1
pycs/frontend/endpoints/projects/ExecuteLabelProvider.py

@@ -88,6 +88,6 @@ class ExecuteLabelProvider(View):
         jobs.run(project,
                  'Label Provider',
                  f'{project.name} ({label_provider.name})',
-                 f'{project.identifier}/label-provider',
+                 f'{project.id}/label-provider',
                  receive,
                  result=result)

+ 3 - 3
pycs/interfaces/MediaFile.py

@@ -41,11 +41,11 @@ class MediaFile:
         """
         create a labeled-image result
 
-        :param label: label identifier
+        :param label: label id
         :param frame: frame index (only set for videos)
         """
         if label is not None and isinstance(label, MediaLabel):
-            label = label.identifier
+            label = label.id
 
         if frame is not None:
             data = {'frame': frame}
@@ -77,7 +77,7 @@ class MediaFile:
             result['frame'] = frame
 
         if label is not None and isinstance(label, MediaLabel):
-            label = label.identifier
+            label = label.id
 
         created = self.__file.create_result('pipeline', 'bounding-box', label, result)
         self.__notifications.add(self.__notifications.nm.create_result, created.id)

+ 1 - 1
pycs/interfaces/MediaLabel.py

@@ -3,7 +3,7 @@ from pycs.database.Label import Label
 
 class MediaLabel:
     def __init__(self, label: Label):
-        self.identifier = label.identifier
+        self.id = label.id
         self.parent = None
         self.children = []
         self.reference = label.reference

+ 2 - 2
pycs/interfaces/MediaStorage.py

@@ -25,11 +25,11 @@ class MediaStorage:
         :return: list of labels
         """
         label_list = self.__project.labels.all()
-        label_dict = {la.identifier: MediaLabel(la) for la in label_list}
+        label_dict = {la.id: MediaLabel(la) for la in label_list}
         result = []
 
         for label in label_list:
-            ml = label_dict[label.identifier]
+            ml = label_dict[label.id]
 
             if label.parent_id is not None:
                 ml.parent = label_dict[label.parent_id]

+ 2 - 2
pycs/jobs/Job.py

@@ -11,8 +11,8 @@ class Job:
 
     # pylint: disable=too-few-public-methods
     def __init__(self, project: Project, job_type: str, name: str):
-        self.identifier = str(uuid1())
-        self.project_id = project.identifier
+        self.id = str(uuid1())
+        self.project_id = project.id
         self.type = job_type
         self.name = name
         self.exception = None

+ 5 - 5
pycs/jobs/JobRunner.py

@@ -86,15 +86,15 @@ class JobRunner:
         """
         self.__remove_listeners.append(callback)
 
-    def remove(self, identifier):
+    def remove(self, id):
         """
-        remove a job using its unique identifier
+        remove a job using its unique id
 
-        :param identifier: job identifier
+        :param id: job id
         :return:
         """
         for i in range(len(self.__jobs)):
-            if self.__jobs[i].identifier == identifier:
+            if self.__jobs[i].id == id:
                 if self.__jobs[i].finished is not None:
                     job = self.__jobs[i]
                     del self.__jobs[i]
@@ -122,7 +122,7 @@ class JobRunner:
         :param job_type: job type
         :param name: job name
         :param group: job group (raises JobGroupBusyException if there is already a job running
-                      with the same group identifier)
+                      with the same group id)
         :param executable: function to execute
         :param args: arguments for executable
         :param progress: is called everytime executable yields a value

+ 5 - 5
test/test_database.py

@@ -52,7 +52,7 @@ class TestDatabase(unittest.TestCase):
 
         # test insert
         for i in range(2):
-            self.assertEqual(models[i].identifier, i + 1)
+            self.assertEqual(models[i].id, i + 1)
             self.assertEqual(models[i].name, f'Model {i + 1}')
             self.assertEqual(models[i].description, f'Description for Model {i + 1}')
             self.assertEqual(models[i].root_folder, f'modeldir{i + 1}')
@@ -62,7 +62,7 @@ class TestDatabase(unittest.TestCase):
 
         # test copy
         copy, _ = models[0].copy_to('Copied Model', 'modeldir3')
-        self.assertEqual(copy.identifier, 3)
+        self.assertEqual(copy.id, 3)
         self.assertEqual(copy.name, 'Copied Model')
         self.assertEqual(copy.description, 'Description for Model 1')
         self.assertEqual(copy.root_folder, 'modeldir3')
@@ -75,7 +75,7 @@ class TestDatabase(unittest.TestCase):
         self.assertEqual(len(label_providers), 2)
 
         for i in range(2):
-            self.assertEqual(label_providers[i].identifier, i + 1)
+            self.assertEqual(label_providers[i].id, i + 1)
             self.assertEqual(label_providers[i].name, f'Label Provider {i + 1}')
             self.assertEqual(label_providers[i].description, f'Description for Label Provider {i + 1}')
             self.assertEqual(label_providers[i].root_folder, f'labeldir{i + 1}')
@@ -89,12 +89,12 @@ class TestDatabase(unittest.TestCase):
         for i in range(3):
             project = projects[i]
 
-            self.assertEqual(project.identifier, i + 1)
+            self.assertEqual(project.id, i + 1)
             self.assertEqual(project.name, f'Project {i + 1}')
             self.assertEqual(project.description, f'Project Description {i + 1}')
             self.assertEqual(project.model_id, i + 1)
             self.assertEqual(project.model().__dict__, models[i].__dict__)
-            self.assertEqual(project.label_provider_id, label_providers[i].identifier if i < 2 else None)
+            self.assertEqual(project.label_provider_id, label_providers[i].id if i < 2 else None)
             self.assertEqual(
                 project.label_provider().__dict__ if project.label_provider() is not None else None,
                 label_providers[i].__dict__ if i < 2 else None

+ 2 - 2
webui/src/components/base/file-input.vue

@@ -69,7 +69,7 @@ export default {
       this.total += files.length;
 
       for (let file of files) {
-        this.$root.socket.upload(`/projects/${this.$root.project.identifier}/data`, file)
+        this.$root.socket.upload(`/projects/${this.$root.project.id}/data`, file)
             .then(() => this.current += 1);
       }
     }
@@ -120,4 +120,4 @@ img {
   opacity: 1;
   filter: invert(1);
 }
-</style>
+</style>

+ 11 - 11
webui/src/components/media/annotated-image.vue

@@ -73,7 +73,7 @@ export default {
     this.$root.socket.on('edit-label', this.editLabelInList);
 
     // get model
-    this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
+    this.$root.socket.get(`/projects/${this.$root.project.id}/model`)
         .then(response => response.json())
         .then(model => {
           this.supported.labeledImages = model.supports.includes('labeled-images');
@@ -197,18 +197,18 @@ export default {
       }
     },
     createResult: function (result) {
-      if (result['file_id'] !== this.current.identifier)
+      if (result['file_id'] !== this.current.id)
         return;
 
       for (let r of this.results)
-        if (r.identifier === result.identifier)
+        if (r.id === result.id)
           return;
 
       this.results.push(result);
     },
     removeResult: function (result) {
       for (let i = 0; i < this.results.length; i++) {
-        if (this.results[i].identifier === result.identifier) {
+        if (this.results[i].id === result.id) {
           this.results.splice(i, 1);
           return;
         }
@@ -216,14 +216,14 @@ export default {
     },
     editResult: function (result) {
       for (let i = 0; i < this.results.length; i++) {
-        if (this.results[i].identifier === result.identifier) {
+        if (this.results[i].id === result.id) {
           this.$set(this.results, i, result);
           return;
         }
       }
     },
     getLabels: function () {
-      this.$root.socket.get(`/projects/${this.$root.project.identifier}/labels`)
+      this.$root.socket.get(`/projects/${this.$root.project.id}/labels`)
           .then(response => response.json())
           .then(labels => {
             this.labels = [];
@@ -231,18 +231,18 @@ export default {
           });
     },
     addLabelToList: function (label) {
-      if (label['project_id'] !== this.$root.project.identifier)
+      if (label['project_id'] !== this.$root.project.id)
         return;
 
       for (let l of this.labels)
-        if (l.identifier === label.identifier)
+        if (l.id === label.id)
           return;
 
       this.labels.push(label);
     },
     removeLabelFromList: function (label) {
       for (let i = 0; i < this.labels.length; i++) {
-        if (this.labels[i].identifier === label.identifier) {
+        if (this.labels[i].id === label.id) {
           this.labels.splice(i, 1);
           return;
         }
@@ -250,7 +250,7 @@ export default {
     },
     editLabelInList: function (label) {
       for (let i = 0; i < this.labels.length; i++) {
-        if (this.labels[i].identifier === label.identifier) {
+        if (this.labels[i].id === label.id) {
           this.$set(this.labels, i, label);
           return;
         }
@@ -264,7 +264,7 @@ export default {
         this.video.play = false;
         this.video.frame = 0;
 
-        this.$root.socket.get(`/data/${newVal.identifier}/results`)
+        this.$root.socket.get(`/data/${newVal.id}/results`)
             .then(response => response.json())
             .then(results => {
               this.results = results;

+ 6 - 6
webui/src/components/media/annotation-box.vue

@@ -31,7 +31,7 @@ export default {
         return false;
 
       for (let label of this.labels) {
-        if (label.identifier === this.box.label_id) {
+        if (label.id === this.box.label_id) {
           return label.name;
         }
       }
@@ -65,7 +65,7 @@ export default {
     click: function (event) {
       if (this.deletable) {
         // TODO then / error
-        this.$root.socket.post(`/results/${this.box.identifier}/remove`, {remove: true});
+        this.$root.socket.post(`/results/${this.box.id}/remove`, {remove: true});
         event.stopPropagation();
       }
       if (this.draggable) {
@@ -75,14 +75,14 @@ export default {
       }
       if (this.taggable) {
         // TODO then / error
-        this.$root.socket.post(`/results/${this.box.identifier}/label`, {
-          label: this.taggable.identifier
+        this.$root.socket.post(`/results/${this.box.id}/label`, {
+          label: this.taggable.id
         });
         event.stopPropagation();
       }
       if (this.confirmable) {
         // TODO then / error
-        this.$root.socket.post(`/results/${this.box.identifier}/confirm`, {
+        this.$root.socket.post(`/results/${this.box.id}/confirm`, {
           confirm: true
         });
         event.stopPropagation();
@@ -92,7 +92,7 @@ export default {
       this.$emit('resize', mode, this.position, this.update);
     },
     update: function (value) {
-      this.$root.socket.post(`/results/${this.box.identifier}/data`, {
+      this.$root.socket.post(`/results/${this.box.id}/data`, {
         data: value
       });
     }

+ 7 - 7
webui/src/components/media/annotation-overlay.vue

@@ -5,7 +5,7 @@
        @dragstart.stop>
 
     <annotation-box v-for="box in boundingBoxes"
-                    v-bind:key="box.identifier"
+                    v-bind:key="box.id"
                     :box="box"
                     :position="box.data"
                     :draggable="interaction === 'move-box'"
@@ -65,7 +65,7 @@ export default {
         return false;
 
       for (let label of this.labels)
-        if (label.identifier === this.imageLabelResult.label)
+        if (label.id === this.imageLabelResult.label)
           return label;
 
       return 'unknown label';
@@ -141,21 +141,21 @@ export default {
         }
       }
       if (this.interaction === 'label-box') {
-        this.$root.socket.post(`/data/${this.file.identifier}/results`, {
+        this.$root.socket.post(`/data/${this.file.id}/results`, {
           type: 'labeled-image',
-          label: this.label.identifier
+          label: this.label.id
         });
       }
       if (this.interaction === 'confirm-box') {
         if (this.imageLabelResult) {
-          this.$root.socket.post(`/results/${this.imageLabelResult.identifier}/confirm`, {
+          this.$root.socket.post(`/results/${this.imageLabelResult.id}/confirm`, {
             confirm: true
           });
         }
       }
       if (this.interaction === 'remove-box') {
         if (this.imageLabelResult) {
-          this.$root.socket.post(`/results/${this.imageLabelResult.identifier}/remove`, {
+          this.$root.socket.post(`/results/${this.imageLabelResult.id}/remove`, {
             remove: true
           });
         }
@@ -185,7 +185,7 @@ export default {
           this.callback(this.current);
         else
             // TODO then / error
-          this.$root.socket.post(`/data/${this.file.identifier}/results`, {
+          this.$root.socket.post(`/data/${this.file.id}/results`, {
             type: 'bounding-box',
             data: this.current
           });

+ 3 - 3
webui/src/components/media/label-selector.vue

@@ -4,7 +4,7 @@
            v-model="search" placeholder="Search...">
 
     <div v-if="results.length > 0" class="labels">
-      <div v-for="(label, index) in results" v-bind:key="label.identifier"
+      <div v-for="(label, index) in results" v-bind:key="label.id"
            class="label selectable"
            :class="{selected: index === selectedIndex}"
            @click="select(label)">
@@ -52,7 +52,7 @@ export default {
         identifier: null,
         name: 'None'
       }, ...this.labels]
-          .filter(l => !this.search || !l.identifier || l.name.toLowerCase().includes(search));
+          .filter(l => !this.search || !l.id || l.name.toLowerCase().includes(search));
     }
   },
   methods: {
@@ -129,4 +129,4 @@ input {
   background-color: var(--primary);
   padding: 0.25rem 0.5rem;
 }
-</style>
+</style>

+ 5 - 5
webui/src/components/media/media-control.vue

@@ -23,8 +23,8 @@
       <option>no filter</option>
       <option>without collection</option>
 
-      <option v-for="collection in collections" :key="collection.identifier"
-              :value="collection.identifier"
+      <option v-for="collection in collections" :key="collection.id"
+              :value="collection.id"
               :selected="collection.autoselect">
         {{ collection.name }}
       </option>
@@ -61,14 +61,14 @@ export default {
     window.addEventListener('keypress', this.keypressEvent);
 
     // receive collections
-    this.$root.socket.get(`/projects/${this.$root.project.identifier}/collections`)
+    this.$root.socket.get(`/projects/${this.$root.project.id}/collections`)
         .then(response => response.json())
         .then(collections => {
           this.collections = collections;
 
           for (let collection of collections)
             if (collection.autoselect)
-              this.$emit('filter', collection.identifier);
+              this.$emit('filter', collection.id);
         });
   },
   destroyed: function () {
@@ -144,4 +144,4 @@ select {
   max-width: 15rem;
   margin: 0 1rem;
 }
-</style>
+</style>

+ 3 - 3
webui/src/components/media/media-selector.vue

@@ -2,7 +2,7 @@
   <div class="media-selector">
     <div class="element"
          v-for="m in mediaObjects"
-         v-bind:key="m.identifier"
+         v-bind:key="m.id"
          @click="$emit('click', m.index)">
       <img alt="media" :src="m.src"
            :srcset="m.srcset" :sizes="m.sizes">
@@ -25,7 +25,7 @@ export default {
     mediaObjects: function() {
       let index = 0;
       return this.media.map(e => {
-        const src = this.socket.media(this.projectId, e.identifier);
+        const src = this.socket.media(this.projectId, e.id);
 
         return {
           index: index++,
@@ -78,4 +78,4 @@ img {
   max-width: 100%;
   max-height: 100%;
 }
-</style>
+</style>

+ 5 - 5
webui/src/components/media/options-bar.vue

@@ -100,7 +100,7 @@ export default {
     // get data
     this.getJobs();
 
-    this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
+    this.$root.socket.get(`/projects/${this.$root.project.id}/model`)
         .then(response => response.json())
         .then(model => this.model = model);
 
@@ -153,7 +153,7 @@ export default {
     predict: function () {
       if (!this.isPredictionRunning) {
         // TODO then / error
-        this.$root.socket.post(`/data/${this.file.identifier}/predict`, {
+        this.$root.socket.post(`/data/${this.file.id}/predict`, {
           predict: true
         });
       }
@@ -200,14 +200,14 @@ export default {
     },
     addJob: function (job) {
       for (let j of this.jobs)
-        if (j.identifier === job.identifier)
+        if (j.id === job.id)
           return;
 
       this.jobs.push(job);
     },
     removeJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.jobs.splice(i, 1);
           return;
         }
@@ -215,7 +215,7 @@ export default {
     },
     editJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.$set(this.jobs, i, job);
           return;
         }

+ 12 - 12
webui/src/components/media/paginated-media.vue

@@ -2,12 +2,12 @@
   <div class="paginated-media">
     <div class="media" ref="media">
       <div v-for="image in images"
-           v-bind:key="image.identifier"
+           v-bind:key="image.id"
            class="image"
            @click="$emit('click', image)">
         <img :alt="image.name" :src="image.src">
 
-        <div v-if="current && current.identifier === image.identifier"
+        <div v-if="current && current.id === image.id"
              class="active"/>
 
         <div v-if="deletable"
@@ -84,7 +84,7 @@ export default {
       }, 500);
     },
     change: function (file) {
-      if (file.project_id === this.$root.project.identifier)
+      if (file.project_id === this.$root.project.id)
         this.get();
     },
     edit: function (file) {
@@ -98,10 +98,10 @@ export default {
       // edited file is in the current image list
       if (this.filter !== false) {
         for (let image of this.images) {
-          if (image.identifier === file.identifier) {
+          if (image.id === file.id) {
             this.get(() => {
               // click the first image if the current shown was removed
-              if (this.current.identifier === file.identifier) {
+              if (this.current.id === file.id) {
                 this.$emit('click', this.images[0]);
               }
             });
@@ -111,7 +111,7 @@ export default {
       }
     },
     deleteElement: function (element) {
-      this.$root.socket.post(`/data/${element.identifier}/remove`, {remove: true});
+      this.$root.socket.post(`/data/${element.id}/remove`, {remove: true});
     },
     prevPage: function (callback) {
       if (this.page > 1)
@@ -160,11 +160,11 @@ export default {
 
       let url;
       if (this.filter === undefined || this.filter === false)
-        url = `/projects/${this.$root.project.identifier}/data/${offset}/${limit}`;
+        url = `/projects/${this.$root.project.id}/data/${offset}/${limit}`;
       else if (this.filter === null)
-        url = `/projects/${this.$root.project.identifier}/data/0/${offset}/${limit}`;
+        url = `/projects/${this.$root.project.id}/data/0/${offset}/${limit}`;
       else
-        url = `/projects/${this.$root.project.identifier}/data/${this.filter}/${offset}/${limit}`;
+        url = `/projects/${this.$root.project.id}/data/${this.filter}/${offset}/${limit}`;
 
       // call endpoint
       this.$root.socket.get(url)
@@ -201,9 +201,9 @@ export default {
       if (this.images.length === 0)
         return;
 
-      if (this.current.identifier < this.images[0].identifier)
+      if (this.current.id < this.images[0].id)
         this.prevPage(this.findCurrent);
-      else if (this.current.identifier > this.images[this.images.length - 1].identifier)
+      else if (this.current.id > this.images[this.images.length - 1].id)
         this.nextPage(this.findCurrent);
     }
   },
@@ -221,7 +221,7 @@ export default {
       this.findCurrent();
 
       // receive previous and next element
-      this.$root.socket.get(`/data/${this.current.identifier}/previous_next`)
+      this.$root.socket.get(`/data/${this.current.id}/previous_next`)
           .then(response => response.json())
           .then(data => {
             if (this.filter === undefined || this.filter === false) {

+ 8 - 8
webui/src/components/other/LabelTreeView.vue

@@ -5,8 +5,8 @@
        draggable="true" @dragstart="dragstart" @dragend="dragend"
        @dragover="dragover" @dragleave="dragleave" @drop="drop">
     <editable-headline :value="label.name"
-                       @change="editLabel(label.identifier, $event)"
-                       @remove="removeLabel(label.identifier)">
+                       @change="editLabel(label.id, $event)"
+                       @remove="removeLabel(label.id)">
       <img v-if="collapse"
            src="@/assets/icons/triangle-down.svg"
            :style="{opacity: label.children.length > 0 ? 1 : 0.1}"
@@ -18,7 +18,7 @@
     </editable-headline>
 
     <template v-if="!collapse">
-      <label-tree-view v-for="child of label.children" :key="child.identifier"
+      <label-tree-view v-for="child of label.children" :key="child.id"
                        :label="child"
                        :indent="indent"
                        :targetable="droppable"
@@ -54,15 +54,15 @@ export default {
   methods: {
     editLabel: function (id, value) {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/labels/${id}/name`, {name: value});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/labels/${id}/name`, {name: value});
     },
     removeLabel: function (id) {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/labels/${id}/remove`, {remove: true});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/labels/${id}/remove`, {remove: true});
     },
     dragstart: function (e) {
       this.untouched = false;
-      e.dataTransfer.setData('text/identifier', this.label.identifier)
+      e.dataTransfer.setData('text/identifier', this.label.id)
       e.stopPropagation();
     },
     dragend: function () {
@@ -85,8 +85,8 @@ export default {
       this.dragleave();
 
       const element = e.dataTransfer.getData('text/identifier');
-      const parent = this.label.identifier;
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/labels/${element}/parent`, {parent: parent});
+      const parent = this.label.id;
+      this.$root.socket.post(`/projects/${this.$root.project.id}/labels/${element}/parent`, {parent: parent});
     }
   }
 }

+ 7 - 7
webui/src/components/projects/project-creation-window.vue

@@ -118,21 +118,21 @@ export default {
     },
     addModel: function (model) {
       for (let m of this.models)
-        if (m.identifier === model.identifier)
+        if (m.id === model.id)
           return;
 
       this.models.push(model);
     },
     removeModel: function (model) {
       for (let i = 0; i < this.models.length; i++) {
-        if (this.models[i].identifier === model.identifier) {
+        if (this.models[i].id === model.id) {
           this.models.splice(i, 1);
           break;
         }
       }
 
-      if (model.identifier === parseInt(this.model) && this.models.length > 0) {
-        this.model = this.models[0].identifier;
+      if (model.id === parseInt(this.model) && this.models.length > 0) {
+        this.model = this.models[0].id;
       }
     },
     getLabels: function () {
@@ -179,13 +179,13 @@ export default {
       return this.models.map(m => {
         return {
           name: m.name,
-          value: m.identifier,
+          value: m.id,
         }
       }).sort((m1, m2) => m1.name < m2.name ? -1 : +1);
     },
     currentModel: function () {
       for (let model of this.models)
-        if (model.identifier === parseInt(this.model))
+        if (model.id === parseInt(this.model))
           return model;
 
       return false;
@@ -199,7 +199,7 @@ export default {
       for (let label of this.labels) {
         result.push({
           name: label.name,
-          value: label.identifier,
+          value: label.id,
         });
       }
 

+ 10 - 10
webui/src/components/projects/project-labels-window.vue

@@ -6,7 +6,7 @@
       Labels
     </h1>
 
-    <label-tree-view v-for="label in labelTree" :key="label.identifier"
+    <label-tree-view v-for="label in labelTree" :key="label.id"
                      :label="label"
                      :targetable="true"
                      indent="2rem"/>
@@ -78,7 +78,7 @@ export default {
             }, labels.splice(i, 1)[0]);
 
             tree.push(label);
-            references[label.identifier] = label;
+            references[label.id] = label;
           } else if (labels[i]['parent_id'] in references) {
             const parent = references[labels[i]['parent_id']];
             const label = Object.assign({
@@ -87,7 +87,7 @@ export default {
             }, labels.splice(i, 1)[0]);
 
             parent.children.push(label);
-            references[label.identifier] = label;
+            references[label.id] = label;
           }
         }
 
@@ -103,7 +103,7 @@ export default {
   },
   methods: {
     getLabels: function () {
-      this.$root.socket.get(`/projects/${this.$root.project.identifier}/labels`)
+      this.$root.socket.get(`/projects/${this.$root.project.id}/labels`)
           .then(response => response.json())
           .then(labels => {
             this.labels = [];
@@ -111,18 +111,18 @@ export default {
           });
     },
     addLabelToList: function (label) {
-      if (label['project_id'] !== this.$root.project.identifier)
+      if (label['project_id'] !== this.$root.project.id)
         return;
 
       for (let l of this.labels)
-        if (l.identifier === label.identifier)
+        if (l.id === label.id)
           return;
 
       this.labels.push(label);
     },
     removeLabelFromList: function (label) {
       for (let i = 0; i < this.labels.length; i++) {
-        if (this.labels[i].identifier === label.identifier) {
+        if (this.labels[i].id === label.id) {
           this.labels.splice(i, 1);
           return;
         }
@@ -130,7 +130,7 @@ export default {
     },
     editLabelInList: function (label) {
       for (let i = 0; i < this.labels.length; i++) {
-        if (this.labels[i].identifier === label.identifier) {
+        if (this.labels[i].id === label.id) {
           this.$set(this.labels, i, label);
           return;
         }
@@ -141,7 +141,7 @@ export default {
         return;
 
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/labels`, {name: this.createLabelValue});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/labels`, {name: this.createLabelValue});
       this.createLabelValue = '';
     },
     dragover: function (e) {
@@ -155,7 +155,7 @@ export default {
       this.dragleave();
 
       const element = e.dataTransfer.getData('text/identifier');
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/labels/${element}/parent`, {parent: null});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/labels/${element}/parent`, {parent: null});
     }
   }
 }

+ 4 - 4
webui/src/components/projects/project-open-window.vue

@@ -13,7 +13,7 @@
 
         <div class="project"
              v-for="project in sortedProjects"
-             :key="project.identifier"
+             :key="project.id"
              @click="load(project)">
           <h2>{{ project.name }}</h2>
 
@@ -86,14 +86,14 @@ export default {
     },
     addProject: function (project) {
       for (let p of this.projects)
-        if (p.identifier === project.identifier)
+        if (p.id === project.id)
           return;
 
       this.projects.push(project);
     },
     removeProject: function (project) {
       for (let i = 0; i < this.projects.length; i++) {
-        if (this.projects[i].identifier === project.identifier) {
+        if (this.projects[i].id === project.id) {
           this.projects.splice(i, 1);
           return;
         }
@@ -101,7 +101,7 @@ export default {
     },
     editProject: function (project) {
       for (let i = 0; i < this.projects.length; i++) {
-        if (this.projects[i].identifier === project.identifier) {
+        if (this.projects[i].id === project.id) {
           this.$set(this.projects, i, project);
           return;
         }

+ 5 - 5
webui/src/components/projects/project-settings-window.vue

@@ -49,7 +49,7 @@ export default {
     this.$root.socket.on('edit-job', this.editJob);
 
     // get model
-    this.$root.socket.get(`/projects/${this.$root.project.identifier}/model`)
+    this.$root.socket.get(`/projects/${this.$root.project.id}/model`)
         .then(response => response.json())
         .then(model => this.model = model);
   },
@@ -69,18 +69,18 @@ export default {
           });
     },
     addJob: function (job) {
-      if (job['project_id'] !== this.$root.project.identifier)
+      if (job['project_id'] !== this.$root.project.id)
         return;
 
       for (let j of this.jobs)
-        if (j.identifier === job.identifier)
+        if (j.id === job.id)
           return;
 
       this.jobs.push(job);
     },
     removeJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.jobs.splice(i, 1);
           return;
         }
@@ -88,7 +88,7 @@ export default {
     },
     editJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.$set(this.jobs, i, job);
           return;
         }

+ 2 - 2
webui/src/components/projects/settings/external-storage-settings.vue

@@ -27,7 +27,7 @@ export default {
   methods: {
     executeFileIndexer: function () {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/external_storage`, {'execute': true});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/external_storage`, {'execute': true});
     }
   }
 }
@@ -40,4 +40,4 @@ export default {
   height: 1.3rem;
   margin: -0.15rem -0.4rem -0.15rem 0.5rem;
 }
-</style>
+</style>

+ 2 - 2
webui/src/components/projects/settings/general-settings.vue

@@ -49,7 +49,7 @@ export default {
   name: "general-settings",
   components: {ButtonInput, ConfirmedButtonInput, TextareaInput, TextInput},
   created: function () {
-    this.projectId = this.$root.project.identifier;
+    this.projectId = this.$root.project.id;
     this.name = this.$root.project.name;
     this.description = this.$root.project.description;
   },
@@ -109,4 +109,4 @@ export default {
   font-size: 80%;
   margin-bottom: 0.1rem;
 }
-</style>
+</style>

+ 2 - 2
webui/src/components/projects/settings/label-provider-settings.vue

@@ -27,7 +27,7 @@ export default {
   methods: {
     executeLabelProvider: function () {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/label_provider`, {'execute': true});
+      this.$root.socket.post(`/projects/${this.$root.project.id}/label_provider`, {'execute': true});
     }
   }
 }
@@ -40,4 +40,4 @@ export default {
   height: 1.3rem;
   margin: -0.15rem -0.4rem -0.15rem 0.5rem;
 }
-</style>
+</style>

+ 4 - 4
webui/src/components/projects/settings/model-interaction-settings.vue

@@ -63,16 +63,16 @@ export default {
   methods: {
     predict: function (name) {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/pipelines/predict`, {
+      this.$root.socket.post(`/projects/${this.$root.project.id}/pipelines/predict`, {
         predict: name
       });
     },
     download: function () {
-      window.location.href = this.$root.socket.url(`/projects/${this.$root.project.identifier}/results`);
+      window.location.href = this.$root.socket.url(`/projects/${this.$root.project.id}/results`);
     },
     fit: function () {
       // TODO then / error
-      this.$root.socket.post(`/projects/${this.$root.project.identifier}/pipelines/fit`, {
+      this.$root.socket.post(`/projects/${this.$root.project.id}/pipelines/fit`, {
         fit: true
       });
     }
@@ -95,4 +95,4 @@ h3 {
   height: 1.3rem;
   margin: -0.15rem -0.4rem -0.15rem 0.5rem;
 }
-</style>
+</style>

+ 3 - 3
webui/src/components/window/job-window.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="job-window">
     <div v-for="job in sortedJobs"
-         v-bind:key="job.identifier"
+         v-bind:key="job.id"
          class="job">
       <div v-if="job.finished"
-           class="remove" @click="removeJob(job.identifier)">
+           class="remove" @click="removeJob(job.id)">
         <img alt="remove" src="@/assets/icons/x-circle.svg">
       </div>
 
@@ -95,4 +95,4 @@ export default {
   border-color: whitesmoke;
   margin-top: 0.2rem;
 }
-</style>
+</style>

+ 1 - 1
webui/src/components/window/side-navigation-bar.vue

@@ -78,7 +78,7 @@ export default {
   watch: {
     currentProject: function (newVal) {
       if (newVal) {
-        this.$root.socket.get(`/projects/${newVal.identifier}/model`)
+        this.$root.socket.get(`/projects/${newVal.id}/model`)
             .then(response => response.json())
             .then(model => this.model = model);
       } else {

+ 5 - 5
webui/src/components/window/top-navigation-bar.vue

@@ -74,7 +74,7 @@ export default {
       if (!this.$root.project)
         return this.jobs;
       else
-        return this.jobs.filter(j => j['project_id'] === this.$root.project.identifier);
+        return this.jobs.filter(j => j['project_id'] === this.$root.project.id);
     },
     activeJobCount: function () {
       return this.activeJobs.length;
@@ -103,14 +103,14 @@ export default {
     },
     addJob: function (job) {
       for (let j of this.jobs)
-        if (j.identifier === job.identifier)
+        if (j.id === job.id)
           return;
 
       this.jobs.push(job);
     },
     removeJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.jobs.splice(i, 1);
           return;
         }
@@ -118,7 +118,7 @@ export default {
     },
     editJob: function (job) {
       for (let i = 0; i < this.jobs.length; i++) {
-        if (this.jobs[i].identifier === job.identifier) {
+        if (this.jobs[i].id === job.id) {
           this.$set(this.jobs, i, job);
           return;
         }
@@ -190,4 +190,4 @@ export default {
 .jobs.colored {
   color: var(--secondary);
 }
-</style>
+</style>

+ 5 - 5
webui/src/main.js

@@ -20,12 +20,12 @@ new Vue({
     render: h => h(App),
     created: function () {
         this.socket.on('edit-project', project => {
-            if (this.project && this.project.identifier === project.identifier) {
+            if (this.project && this.project.id === project.id) {
                 this.project = project;
             }
         });
         this.socket.on('remove-project', project => {
-            if (this.project && this.project.identifier === project.identifier) {
+            if (this.project && this.project.id === project.id) {
                 this.project = null;
             }
         });
@@ -80,11 +80,11 @@ new Vue({
                 },
                 media: function (file, maxWidth, maxHeight) {
                     if (maxHeight)
-                        return `${self}/data/${file.identifier}/${maxWidth}x${maxHeight}?uuid=${file.uuid}`
+                        return `${self}/data/${file.id}/${maxWidth}x${maxHeight}?uuid=${file.uuid}`
                     else if (maxWidth)
-                        return `${self}/data/${file.identifier}/${maxWidth}?uuid=${file.uuid}`
+                        return `${self}/data/${file.id}/${maxWidth}?uuid=${file.uuid}`
                     else
-                        return `${self}/data/${file.identifier}?uuid=${file.uuid}`
+                        return `${self}/data/${file.id}?uuid=${file.uuid}`
                 }
             }
         }